Commit d77fee7a authored by Ralf Jung's avatar Ralf Jung
Browse files

support giving multiple compiler packages

parent 3dd3eb52
......@@ -5,7 +5,7 @@ set -eo pipefail
## This runs a default build job. The following variables are noteworthy:
## - $OCAML: The OCaml version to use. This MUST start with a package name, e.g.
## `ocaml-base-compiler.4.07.0`.
## `ocaml-base-compiler.4.07.0`. Can be a space-separated list of packages.
## - $OPAM_PINS: Space-separated list of packages to pin in opam.
## Each package can be:
## - a group of three list elements: `PACKAGE KIND TARGET`.
......
......@@ -16,10 +16,12 @@ if test -d "$OPAMROOT" && fgrep 'opam-version: "1.2"' "$OPAMROOT/config" -q; the
fi
# Delete root if compiler does not match
if test -d "$OPAMROOT" && ! opam list -s -i "$OCAML" | egrep . -q; then
warn "[prepare-opam] Deleting opam root with outdated compiler"
rm -rf "$OPAMROOT"
fi
for PACKAGE IN $OCAML; do
if test -d "$OPAMROOT" && ! opam list -s -i "$PACKAGE" | egrep . -q; then
warn "[prepare-opam] Deleting opam root with outdated compiler ($PACKAGE not found)"
rm -rf "$OPAMROOT"
fi
done
# Make sure we got a good OPAM.
if test -d "$OPAMROOT"; then
......@@ -27,7 +29,9 @@ if test -d "$OPAMROOT"; then
else
warn "[prepare-opam] Creating new opam root (compiler: $OCAML)"
mkdir "$OPAMROOT"
opam init --no-setup --disable-sandboxing --compiler="$OCAML" -y
opam init --no-setup --disable-sandboxing --bare
# Deliberately no quotes around OCAML; this can be multiple packages.
opam switch create default $OCAML -y
FRESH_OPAM=yes
fi
eval `opam conf env`
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment