...
 
Commits (1)
......@@ -5,13 +5,19 @@ export OPAMROOT="$(pwd)/opamroot"
export OPAMJOBS="$((2*$CPU_CORES))"
export OPAM_EDITOR="$(which false)"
# Delete OPAM 1.2 root, if that's what we got
if fgrep 'opam-version: "1.2"' "$OPAMROOT/config" > /dev/null; then
echo_color "$BOLDYELLOW" "[prepare-opam] Deleting opam 1.2 root"
rm -rf "$OPAMROOT"
fi
# Make sure we got a good OPAM.
if test -d "$OPAMROOT"; then
echo_color "$BOLDGREEN" "[prepare-opam] Re-using cached opam root"
else
echo_color "$BOLDYELLOW" "[prepare-opam] Creating new opam root"
mkdir "$OPAMROOT"
opam init --no-setup -y
opam init --no-setup --disable-sandboxing -y
FRESH_OPAM=yes
fi
eval `opam conf env`
......@@ -28,15 +34,15 @@ fi
# Make sure we got the right set of repositories registered
if echo "$@" | egrep "(dev|beta)" > /dev/null; then
# We are compiling against a dev version of something. Get ourselves the dev repositories.
test -d "$OPAMROOT/repo/coq-extra-dev" || opam repo add coq-extra-dev https://coq.inria.fr/opam/extra-dev -p 0
test -d "$OPAMROOT/repo/coq-core-dev" || opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev -p 5
test -d "$OPAMROOT/repo/coq-extra-dev" || opam repo add coq-extra-dev https://coq.inria.fr/opam/extra-dev --rank 0
test -d "$OPAMROOT/repo/coq-core-dev" || opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev --rank 5
else
# No dev version, make sure we do not have the dev repositories.
test -d "$OPAMROOT/repo/coq-extra-dev" && opam repo remove coq-extra-dev
test -d "$OPAMROOT/repo/coq-core-dev" && opam repo remove coq-core-dev
fi
test -d "$OPAMROOT/repo/coq-released" || opam repo add coq-released https://coq.inria.fr/opam/released -p 10
test -d "$OPAMROOT/repo/iris-dev" || opam repo add iris-dev https://gitlab.mpi-sws.org/FP/opam-dev.git -p 20
test -d "$OPAMROOT/repo/coq-released" || opam repo add coq-released https://coq.inria.fr/opam/released --rank 10
test -d "$OPAMROOT/repo/iris-dev" || opam repo add iris-dev https://gitlab.mpi-sws.org/FP/opam-dev.git --rank 20
echo
# We really want to run all of the following in one opam transaction, but due to opam limitations,
......@@ -64,7 +70,7 @@ echo
if [[ -z "$FRESH_OPAM" ]]; then # skip if this is a fresh opam root
# Upgrade cached things
echo_color "$BOLDGREEN" "[prepare-opam] Upgrading packages"
opam upgrade -y --fixup && opam upgrade -y
opam upgrade -y
echo
fi
......