Skip to content
Snippets Groups Projects
Commit c3c8ce45 authored by Ralf Jung's avatar Ralf Jung
Browse files

opam CI: more verbose output; more robust opam

parent 860821b3
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
set -e set -e
set -x
## This script installs the build dependencies for CI builds. ## This script installs the build dependencies for CI builds.
function run_and_print() {
echo "$ $@"
"$@"
}
# Prepare OPAM configuration # Prepare OPAM configuration
export OPAMROOT="$(pwd)/opamroot" export OPAMROOT="$(pwd)/opamroot"
...@@ -12,27 +9,27 @@ export OPAMJOBS="$((2*$CPU_CORES))" ...@@ -12,27 +9,27 @@ export OPAMJOBS="$((2*$CPU_CORES))"
export OPAM_EDITOR="$(which false)" export OPAM_EDITOR="$(which false)"
# Make sure we got a good OPAM. # Make sure we got a good OPAM.
test -d "$OPAMROOT" || (mkdir "$OPAMROOT" && run_and_print opam init --no-setup -y) test -d "$OPAMROOT" || (mkdir "$OPAMROOT" && opam init --no-setup -y)
eval `opam conf env` eval `opam conf env`
# Make sure the pin for the builddep package is not stale. # Make sure the pin for the builddep package is not stale.
run_and_print make build-dep/opam make build-dep/opam
# Update repositories # Update repositories
run_and_print opam update opam update
# Make sure we got the right set of repositories registered # Make sure we got the right set of repositories registered
if echo "$@" | fgrep "dev" > /dev/null; then if echo "$@" | fgrep "dev" > /dev/null; then
# We are compiling against a dev version of something. Get ourselves the dev repositories. # We are compiling against a dev version of something. Get ourselves the dev repositories.
test -d "$OPAMROOT/repo/coq-extra-dev" || run_and_print opam repo add coq-extra-dev https://coq.inria.fr/opam/extra-dev -p 0 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" || run_and_print opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev -p 5 test -d "$OPAMROOT/repo/coq-core-dev" || opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev -p 5
else else
# No dev version, make sure we do not have the dev repositories. # No dev version, make sure we do not have the dev repositories.
test -d "$OPAMROOT/repo/coq-extra-dev" && run_and_print opam repo remove coq-extra-dev test -d "$OPAMROOT/repo/coq-extra-dev" && opam repo remove coq-extra-dev
test -d "$OPAMROOT/repo/coq-core-dev" && run_and_print opam repo remove coq-core-dev test -d "$OPAMROOT/repo/coq-core-dev" && opam repo remove coq-core-dev
fi fi
test -d "$OPAMROOT/repo/coq-released" || run_and_print opam repo add coq-released https://coq.inria.fr/opam/released -p 10 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" || run_and_print opam repo add iris-dev https://gitlab.mpi-sws.org/FP/opam-dev.git -p 20 test -d "$OPAMROOT/repo/iris-dev" || opam repo add iris-dev https://gitlab.mpi-sws.org/FP/opam-dev.git -p 20
echo echo
# We really want to run all of the following in one opam transaction, but due to opam limitations, # We really want to run all of the following in one opam transaction, but due to opam limitations,
...@@ -51,14 +48,14 @@ while (( "$#" )); do # while there are arguments left ...@@ -51,14 +48,14 @@ while (( "$#" )); do # while there are arguments left
echo "[opam-ci] $PACKAGE already $KIND-pinned to $VERSION" echo "[opam-ci] $PACKAGE already $KIND-pinned to $VERSION"
else else
echo "[opam-ci] $KIND-pinning $PACKAGE to $VERSION" echo "[opam-ci] $KIND-pinning $PACKAGE to $VERSION"
run_and_print opam pin add -y -k "$KIND" "$PACKAGE" "$VERSION" opam pin add -y -k "$KIND" "$PACKAGE" "$VERSION"
fi fi
done done
# Upgrade cached things. # Upgrade cached things.
echo echo
echo "[opam-ci] Upgrading opam" echo "[opam-ci] Upgrading opam"
run_and_print opam upgrade -y opam upgrade -y --fixup
# Install build-dependencies. # Install build-dependencies.
echo echo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment