Skip to content

Commit 36215fa

Browse files
committed
build: allow the system OCaml compiler to be used
Previously we always supplied a `--comp` argument to `opam init` and would therefore build a custom OCaml compiler -- this is fine for the CI case where we wish to control the version precisely. This patch interprets an empty `OPAM_COMP` environment variable as meaning "use the system compiler" which is useful for (eg) the homebrew case. Signed-off-by: David Scott <[email protected]>
1 parent b8528d4 commit 36215fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/common.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ export OPAMROOT
1313
export OPAMYES=1
1414
export OPAMCOLORS=1
1515

16-
opam init -v -n --comp="${OPAM_COMP}" --switch="${OPAM_COMP}" local "${OPAM_REPO}"
16+
# if a compiler is specified, use it; otherwise use the system compiler
17+
if [ -n "${OPAM_COMP}" ]; then
18+
OPAM_COMP_ARG="--comp=${OPAM_COMP}"
19+
OPAM_SWITCH_ARG="--switch=${OPAM_COMP}"
20+
fi
21+
22+
opam init -v -n "${OPAM_COMP_ARG}" "${OPAM_SWITCH_ARG}" local "${OPAM_REPO}"
1723
echo opam configuration is:
1824
opam config env
1925
eval $(opam config env)

0 commit comments

Comments
 (0)