From 70c1893b29b2b996f37cde987c6228776408ff2a Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 22 Jul 2021 12:58:30 +0100 Subject: [PATCH] Control C stubs compilation using enabled_if --- .gitignore | 1 - Makefile | 7 ++----- configure | 9 --------- configure.ac | 6 ------ dune-project | 2 +- master_changes.md | 1 + opam-admin.opam | 2 +- opam-client.opam | 2 +- opam-core.opam | 3 +-- opam-devel.opam | 2 +- opam-format.opam | 3 +-- opam-installer.opam | 2 +- opam-repository.opam | 2 +- opam-solver.opam | 2 +- opam-state.opam | 2 +- opam.opam | 2 +- src/stubs/win32/{dune-win32 => dune} | 6 ++++-- 17 files changed, 18 insertions(+), 36 deletions(-) rename src/stubs/win32/{dune-win32 => dune} (89%) diff --git a/.gitignore b/.gitignore index c8aefda9225..b2838fbc97c 100644 --- a/.gitignore +++ b/.gitignore @@ -89,7 +89,6 @@ src/manifest/install.inc src/stubs/libacl/dune src/stubs/libacl/c-libraries.sexp src/stubs/win32/cc64 -src/stubs/win32/dune src/stubs/c-flags.sexp # doc doc/dev-manual/*aux diff --git a/Makefile b/Makefile index ed9b92b0791..c5c47841604 100644 --- a/Makefile +++ b/Makefile @@ -42,10 +42,7 @@ DUNE_ARGS ?= $(JBUILDER_ARGS) DUNE_PROFILE ?= release ifeq ($(DUNE_PROFILE_ARG),release) - # TODO Replace with --release when we require dune >= 2.5 - DUNE_PROFILE_ARG = --profile=release -else - DUNE_PROFILE_ARG = --profile=$(DUNE_PROFILE) + DUNE_PROFILE_ARG = --release endif src_ext/dune-local/dune.exe: src_ext/dune-local.stamp $(DUNE_SECONDARY) @@ -102,7 +99,7 @@ clean: distclean: clean clean-ext rm -rf autom4te.cache bootstrap rm -f Makefile.config config.log config.status aclocal.m4 - rm -f src/*.META src/*/.merlin src/manifest/dune src/manifest/install.inc src/stubs/libacl/dune src/stubs/win32/dune src/stubs/win32/cc64 src/ocaml-flags-configure.sexp src/stubs/libacl/c-libraries.sexp + rm -f src/*.META src/*/.merlin src/manifest/dune src/manifest/install.inc src/stubs/libacl/dune src/stubs/win32/cc64 src/ocaml-flags-configure.sexp src/stubs/libacl/c-libraries.sexp rm -f src/client/linking.sexp src/stubs/c-flags.sexp src/core/developer src/core/version OPAMINSTALLER_FLAGS = --prefix "$(call CYGPATH,$(DESTDIR)$(prefix))" diff --git a/configure b/configure index 7d1a7c5e28a..88117476e2f 100755 --- a/configure +++ b/configure @@ -8542,15 +8542,6 @@ fi fi -rm -f src/stubs/win32/dune -if test ${WIN32} -eq 1 -then : - - cd src/stubs/win32 - ${LN_S} -f dune-win32 dune - cd ../../.. - -fi rm -f src/stubs/libacl/dune if test "x${with_libacl}" = "xyes" then : diff --git a/configure.ac b/configure.ac index f1596fe59ea..4d146343195 100644 --- a/configure.ac +++ b/configure.ac @@ -443,12 +443,6 @@ AS_IF([test "x${with_private_runtime}" != "xno"],[ ]) ]) -rm -f src/stubs/win32/dune -AS_IF([ test ${WIN32} -eq 1],[ - cd src/stubs/win32 - ${LN_S} -f dune-win32 dune - cd ../../.. -]) rm -f src/stubs/libacl/dune AS_IF([ test "x${with_libacl}" = "xyes" ],[ cd src/stubs/libacl diff --git a/dune-project b/dune-project index daf152f29e7..d6a42b6c8b4 100644 --- a/dune-project +++ b/dune-project @@ -1,2 +1,2 @@ -(lang dune 2.0) +(lang dune 2.6) (name opam) diff --git a/master_changes.md b/master_changes.md index e1e949b9eb3..b5074879a16 100644 --- a/master_changes.md +++ b/master_changes.md @@ -247,6 +247,7 @@ users) * Remove unused variable in opamACL.c [#5403 @purplearmadillo77] * Upgrade spdx_licenses to 1.2.0 [#5412 @kit-ty-kate] * Upgrade the vendored sha to 1.15.4 [#5424 @kit-ty-kate] + * Control the Windows stubs using `(enabled_if)` [#4777 @dra27 - fix #4726] ## Infrastructure * Fix caching of Cygwin compiler on AppVeyor [#4988 @dra27] diff --git a/opam-admin.opam b/opam-admin.opam index 238546248fa..755e2bc2b87 100644 --- a/opam-admin.opam +++ b/opam-admin.opam @@ -17,7 +17,7 @@ homepage: "https://opam.ocaml.org/" bug-reports: "https://github.com/ocaml/opam/issues" license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" depends: [ - "dune" {>= "2.0.0"} + "dune" {>= "2.6.0"} "re" {>= "1.9.0"} "opam-file-format" {>= "2.1.4"} ] diff --git a/opam-client.opam b/opam-client.opam index 5807b44166b..e29316a1d98 100644 --- a/opam-client.opam +++ b/opam-client.opam @@ -33,7 +33,7 @@ depends: [ "opam-repository" {= version} "re" {>= "1.9.0"} "cmdliner" {>= "1.1.0"} - "dune" {>= "2.0.0"} + "dune" {>= "2.6.0"} ] conflicts: [ "extlib" {< "1.7.8"} diff --git a/opam-core.opam b/opam-core.opam index 03df167df8b..c57bf6fb2b7 100644 --- a/opam-core.opam +++ b/opam-core.opam @@ -22,7 +22,6 @@ bug-reports: "https://github.com/ocaml/opam/issues" dev-repo: "git+https://github.com/ocaml/opam.git" license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" build: [ - ["./configure" "--disable-checks" "--prefix" prefix] ["dune" "build" "-p" name "-j" jobs] ] depends: [ @@ -31,7 +30,7 @@ depends: [ "base-bigarray" "ocamlgraph" "re" {>= "1.9.0"} - "dune" {>= "2.0.0"} + "dune" {>= "2.6.0"} "cppo" {build & >= "1.1.0"} "sha" {>= "1.13"} "jsonm" diff --git a/opam-devel.opam b/opam-devel.opam index 65efbc3705d..54f8b7b1043 100644 --- a/opam-devel.opam +++ b/opam-devel.opam @@ -29,7 +29,7 @@ depends: [ "ocaml" {>= "4.08.0"} "opam-client" {= version} "cmdliner" {>= "1.1.0"} - "dune" {>= "2.0.0"} + "dune" {>= "2.6.0"} "conf-openssl" {with-test} "conf-diffutils" {with-test} ] diff --git a/opam-format.opam b/opam-format.opam index d678652f581..ba752d4802f 100644 --- a/opam-format.opam +++ b/opam-format.opam @@ -22,7 +22,6 @@ bug-reports: "https://github.com/ocaml/opam/issues" dev-repo: "git+https://github.com/ocaml/opam.git" license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" build: [ - ["./configure" "--disable-checks" "--prefix" prefix] ["dune" "build" "-p" name "-j" jobs] ] depends: [ @@ -30,5 +29,5 @@ depends: [ "opam-core" {= version} "opam-file-format" {>= "2.1.4"} "re" {>= "1.9.0"} - "dune" {>= "2.0.0"} + "dune" {>= "2.6.0"} ] diff --git a/opam-installer.opam b/opam-installer.opam index 90c82995493..ec53347f573 100644 --- a/opam-installer.opam +++ b/opam-installer.opam @@ -31,5 +31,5 @@ depends: [ "ocaml" {(>= "4.03.0" & os != "win32") | >= "4.06.0"} "opam-format" {= version} "cmdliner" {>= "0.9.8"} - "dune" {>= "2.0.0"} + "dune" {>= "2.6.0"} ] diff --git a/opam-repository.opam b/opam-repository.opam index 64fc4603a44..52f0bec2863 100644 --- a/opam-repository.opam +++ b/opam-repository.opam @@ -28,5 +28,5 @@ build: [ depends: [ "ocaml" {>= "4.08.0"} "opam-format" {= version} - "dune" {>= "2.0.0"} + "dune" {>= "2.6.0"} ] diff --git a/opam-solver.opam b/opam-solver.opam index 13e7f97f94a..e5a6eb29945 100644 --- a/opam-solver.opam +++ b/opam-solver.opam @@ -32,7 +32,7 @@ depends: [ "dose3" {>= "6.1"} "cudf" {>= "0.7"} "re" {>= "1.9.0"} - "dune" {>= "2.0.0"} + "dune" {>= "2.6.0"} "opam-0install-cudf" {>= "0.4"} ] depopts: [ diff --git a/opam-state.opam b/opam-state.opam index 5ab22fead8a..e52bfb43d98 100644 --- a/opam-state.opam +++ b/opam-state.opam @@ -30,5 +30,5 @@ depends: [ "opam-repository" {= version} "re" {>= "1.9.0"} "spdx_licenses" {>= "1.0.0"} - "dune" {>= "2.0.0"} + "dune" {>= "2.6.0"} ] diff --git a/opam.opam b/opam.opam index 690826f9abe..e1f0d50b74e 100644 --- a/opam.opam +++ b/opam.opam @@ -18,6 +18,6 @@ homepage: "https://opam.ocaml.org/" bug-reports: "https://github.com/ocaml/opam/issues" license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" depends: [ - "dune" {>= "2.0.0"} + "dune" {>= "2.6.0"} "opam-client" {= version} ] diff --git a/src/stubs/win32/dune-win32 b/src/stubs/win32/dune similarity index 89% rename from src/stubs/win32/dune-win32 rename to src/stubs/win32/dune index 4cfc4b8e03a..d38a121c419 100644 --- a/src/stubs/win32/dune-win32 +++ b/src/stubs/win32/dune @@ -16,7 +16,8 @@ (:include ../c-flags.sexp))) (c_library_flags (:standard (:include c-libraries.sexp))) - (wrapped false)) + (wrapped false) + (enabled_if (= %{os_type} "Win32"))) (rule (copy opamWin32Stubs.ml opamWin32Stubs.mli)) @@ -34,7 +35,8 @@ (install (section bin) (package opam) - (files opam-putenv.exe)) + (files opam-putenv.exe) + (enabled_if (= %{os_type} "Win32"))) (rule (with-stdout-to c-libraries.sexp (run ocaml %{dep:../../../shell/context_flags.ml} clibs)))