Skip to content

Commit

Permalink
Pin dune to work around compiler options split
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
punchagan committed Jun 5, 2024
1 parent 5f17123 commit cf0ba40
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,21 @@ ifeq (1, $(USE_SYS_DUNE_HACK))
opam install --switch=$(CONFIG_SWITCH_NAME) --yes "dune.$(SANDMARK_DUNE_VERSION)" "dune-configurator.$(SANDMARK_DUNE_VERSION)"
# Pin the version so it doesn't change when installing packages
opam pin add --switch=$(CONFIG_SWITCH_NAME) --yes -n dune "$(SANDMARK_DUNE_VERSION)"
else
@{ case "$*" in \
5.3.*) \
opam repo add upstream "git+https://github.com/ocaml/opam-repository.git" --on-switch=$(CONFIG_SWITCH_NAME) --rank 2; \
opam install --switch=$(CONFIG_SWITCH_NAME) --yes ocamlfind; \
echo "Pinning dune to fixed version to work around binary and native compiler options split"; \
opam pin add --yes -n --switch=$(CONFIG_SWITCH_NAME) dune."$(SANDMARK_DUNE_VERSION)" https://github.com/punchagan/dune.git#fix-compiler-opts; \
opam pin add --yes -n --switch=$(CONFIG_SWITCH_NAME) dune-configurator."$(SANDMARK_DUNE_VERSION)" https://github.com/punchagan/dune.git#fix-compiler-opts; \
opam reinstall --switch=$(CONFIG_SWITCH_NAME) --yes dune dune-configurator ;; \
*) \
opam repo add upstream "git+https://github.com/ocaml/opam-repository.git" --on-switch=$(CONFIG_SWITCH_NAME) --rank 2; \
opam install --switch=$(CONFIG_SWITCH_NAME) --yes ocamlfind; \
opam install --switch=$(CONFIG_SWITCH_NAME) --yes "dune.$(SANDMARK_DUNE_VERSION)" "dune-configurator.$(SANDMARK_DUNE_VERSION)"; \
opam pin add --switch=$(CONFIG_SWITCH_NAME) --yes -n dune "$(SANDMARK_DUNE_VERSION)";; \
esac };
endif

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

0 comments on commit cf0ba40

Please sign in to comment.