Skip to content

Commit 7e5deb0

Browse files
committed
Pin dune to work around compiler options split
ocaml/ocaml@51e5cf2 split the compiler flags for native and bytecode compiler to separate flags. It also changes the flag names which breaks builds of several packages. This commit is a workaround for that change.
1 parent 981306e commit 7e5deb0

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,21 @@ ifeq (1, $(USE_SYS_DUNE_HACK))
111111
opam install --switch=$(CONFIG_SWITCH_NAME) --yes "dune.$(SANDMARK_DUNE_VERSION)" "dune-configurator.$(SANDMARK_DUNE_VERSION)"
112112
# Pin the version so it doesn't change when installing packages
113113
opam pin add --switch=$(CONFIG_SWITCH_NAME) --yes -n dune "$(SANDMARK_DUNE_VERSION)"
114+
else
115+
@{ case "$*" in \
116+
5.3.*) \
117+
opam repo add upstream "git+https://github.com/ocaml/opam-repository.git" --on-switch=$(CONFIG_SWITCH_NAME) --rank 2; \
118+
opam install --switch=$(CONFIG_SWITCH_NAME) --yes ocamlfind; \
119+
echo "Pinning dune to fixed version to work around binary and native compiler options split"; \
120+
opam pin add --yes -n --switch=$(CONFIG_SWITCH_NAME) dune."$(SANDMARK_DUNE_VERSION)" https://github.com/ocaml-bench/dune.git#fix-compiler-opts; \
121+
opam pin add --yes -n --switch=$(CONFIG_SWITCH_NAME) dune-configurator."$(SANDMARK_DUNE_VERSION)" https://github.com/ocaml-bench/dune.git#fix-compiler-opts; \
122+
opam reinstall --switch=$(CONFIG_SWITCH_NAME) --yes dune dune-configurator ;; \
123+
*) \
124+
opam repo add upstream "git+https://github.com/ocaml/opam-repository.git" --on-switch=$(CONFIG_SWITCH_NAME) --rank 2; \
125+
opam install --switch=$(CONFIG_SWITCH_NAME) --yes ocamlfind; \
126+
opam install --switch=$(CONFIG_SWITCH_NAME) --yes "dune.$(SANDMARK_DUNE_VERSION)" "dune-configurator.$(SANDMARK_DUNE_VERSION)"; \
127+
opam pin add --switch=$(CONFIG_SWITCH_NAME) --yes -n dune "$(SANDMARK_DUNE_VERSION)";; \
128+
esac };
114129
endif
115130

116131
ocamls=$(wildcard ocaml-versions/*.json)

0 commit comments

Comments
 (0)