From ad95f5a905cf37129957baa48f8f3ba8faf9cb2d Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Wed, 5 Jun 2024 16:38:14 +0530 Subject: [PATCH] Pin dune to work around compiler options split ocaml/ocaml@51e5cf226b39986abf03cbaad47cf49a1c35bc69 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. --- Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Makefile b/Makefile index 79798fea4..cbe629482 100644 --- a/Makefile +++ b/Makefile @@ -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/ocaml-bench/dune.git#fix-compiler-opts; \ + opam pin add --yes -n --switch=$(CONFIG_SWITCH_NAME) dune-configurator."$(SANDMARK_DUNE_VERSION)" https://github.com/ocaml-bench/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)