From f51100fc61ffab142a7f57f89b89bd1b71e2c79d Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 13 Dec 2021 20:32:46 +0000 Subject: [PATCH 1/5] OpamSystem.real_path: Remove the double chdir trick on OCaml >= 4.13.0 --- src/core/dune | 2 +- src/core/opamSystem.ml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/dune b/src/core/dune index 02069d7dcac..a480cf6472a 100644 --- a/src/core/dune +++ b/src/core/dune @@ -14,7 +14,7 @@ (:include ../ocaml-flags-configure.sexp) (:include ../ocaml-context-flags.sexp))) (preprocess (per_module - ((action (run %{bin:cppo} -V OCAML:%{ocaml_version} %{input-file})) opamCompat) + ((action (run %{bin:cppo} -V OCAML:%{ocaml_version} %{input-file})) opamCompat opamSystem) ((action (run %{bin:cppo} %{read-lines:developer} %{input-file})) opamCoreConfig) ((action (run %{bin:cppo} -D "VERSION %{read-lines:version}" %{input-file})) opamVersion))) (wrapped false)) diff --git a/src/core/opamSystem.ml b/src/core/opamSystem.ml index 2dc84d697b6..b3587d29f75 100644 --- a/src/core/opamSystem.ml +++ b/src/core/opamSystem.ml @@ -317,6 +317,9 @@ let remove file = else remove_file file +#if OCAML_VERSION >= (4, 13, 0) +let normalize = Unix.realpath +#else (* Sets path to s and returns the old path *) let getchdir s = let p = @@ -330,6 +333,7 @@ let getchdir s = let normalize s = try getchdir (getchdir s) with File_not_found _ -> s +#endif let real_path p = (* if Filename.is_relative p then *) From 248b51b55b21e319e95dee98725b8f2e3c758355 Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 13 Dec 2021 20:05:52 +0000 Subject: [PATCH 2/5] Update master_changes.md --- master_changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/master_changes.md b/master_changes.md index 36b80473a57..3828dfd7a5e 100644 --- a/master_changes.md +++ b/master_changes.md @@ -234,3 +234,4 @@ users) * `OpamStd.ABSTRACT`: add `compare` and `equal`, that added those functions to `OpamFilename`, `OpamHash`, `OpamStd`, `OpamStd`, `OpamUrl`, and `OpamVersion` [#4918 @rjbou] * `OpamHash`: add `sort` from strongest to weakest kind + * OpamSystem.real_path: Remove the double chdir trick on OCaml >= 4.13.0 [#4961 @kit-ty-kate] From 71df7865ce0d05b27fbb50768b69cff6093f1382 Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 13 Dec 2021 20:43:04 +0000 Subject: [PATCH 3/5] Update CI to OCaml 4.13 --- .github/workflows/main.yml | 18 +++++++++--------- appveyor.yml | 4 ++-- appveyor_test.sh | 2 +- release/Dockerfile.in | 8 ++++---- release/Makefile | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e59177f2f6..82e3f86fc45 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,10 +41,10 @@ env: OPAM12CACHE: ~/.cache/opam1.2/cache # These should be identical to the values in appveyor.yml and the other workflows OPAM_REPO: https://github.com/ocaml/opam-repository.git - OPAM_TEST_REPO_SHA: ec07d6d5f363d1c5b9ed3b927d0df1d58dad333c - OPAM_REPO_SHA: ec07d6d5f363d1c5b9ed3b927d0df1d58dad333c + OPAM_TEST_REPO_SHA: fd4405c83bcd23f91373978b45479694079a8c79 + OPAM_REPO_SHA: fd4405c83bcd23f91373978b45479694079a8c79 # Default ocaml version for some jobs - OCAML_VERSION: 4.12.0 + OCAML_VERSION: 4.13.1 ## variables for cache paths GH_OCAML_CACHE: ~/.cache/ocaml-local/** SOLVER: @@ -109,10 +109,10 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - ocamlv: [ 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.0 ] + ocamlv: [ 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.1, 4.13.1 ] include: - os: macos-latest - ocamlv: 4.12.0 + ocamlv: 4.13.1 # Intentionally fail fast, no need to run all build if there is a # problem in a given version; usually it is functions not defined in lower # versions of OCaml @@ -181,7 +181,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest ] - ocamlv: [ 4.12.0 ] + ocamlv: [ 4.13.1 ] fail-fast: false env: OPAM_TEST: 1 @@ -233,7 +233,7 @@ jobs: matrix: # os: [ ubuntu-latest, macos-latest ] os: [ ubuntu-latest ] - ocamlv: [ 4.12.0 ] + ocamlv: [ 4.13.1 ] fail-fast: false steps: - name: install deps @@ -263,7 +263,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest ] - ocamlv: [ 4.12.0 ] + ocamlv: [ 4.13.1 ] solver: [ z3, 0install ] fail-fast: false env: @@ -312,7 +312,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest ] - ocamlv: [ 4.12.0 ] + ocamlv: [ 4.13.1 ] fail-fast: false steps: - name: install deps diff --git a/appveyor.yml b/appveyor.yml index 5c367d1f91a..7e81ca389c6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,8 +13,8 @@ environment: DEP_MODE: lib-ext # These should be identical to the values in .github/workflows/*.yml OPAM_REPO: https://github.com/ocaml/opam-repository.git - OPAM_REPO_SHA: ec07d6d5f363d1c5b9ed3b927d0df1d58dad333c - OPAM_TEST_REPO_SHA: ec07d6d5f363d1c5b9ed3b927d0df1d58dad333c + OPAM_REPO_SHA: fd4405c83bcd23f91373978b45479694079a8c79 + OPAM_TEST_REPO_SHA: fd4405c83bcd23f91373978b45479694079a8c79 matrix: - CYG_ROOT: cygwin CYG_ARCH: x86 diff --git a/appveyor_test.sh b/appveyor_test.sh index 7d79f9a15f0..b73b56aa102 100755 --- a/appveyor_test.sh +++ b/appveyor_test.sh @@ -1,5 +1,5 @@ #!/bin/bash -opam init -y -a --compiler=ocaml.4.12.0 git+$OPAM_REPO#$OPAM_TEST_REPO_SHA +opam init -y -a --compiler=ocaml.4.13.1 git+$OPAM_REPO#$OPAM_TEST_REPO_SHA eval $(opam config env) opam install -y -v ocamlfind diff --git a/release/Dockerfile.in b/release/Dockerfile.in index 8545bce58bf..598cc36910f 100644 --- a/release/Dockerfile.in +++ b/release/Dockerfile.in @@ -7,15 +7,15 @@ RUN apk add gcc g++ make coreutils openssl RUN addgroup -S opam && adduser -S opam -G opam -s /bin/sh -ADD https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-4.12.0.tar.gz /root/ +ADD https://caml.inria.fr/pub/distrib/ocaml-4.13/ocaml-4.13.1.tar.gz /root/ WORKDIR /root -RUN tar xzf ocaml-4.12.0.tar.gz -WORKDIR ocaml-4.12.0 +RUN tar xzf ocaml-4.13.1.tar.gz +WORKDIR ocaml-4.13.1 RUN sed -i 's/gnueabi/*eabi/' configure RUN sed -i 's/musl/musl*/' configure RUN ./configure %CONF% -prefix /usr/local -RUN make world opt.opt && make install && rm -rf /root/ocaml-4.12.0 /root/ocaml-4.12.0.tar.gz +RUN make world opt.opt && make install && rm -rf /root/ocaml-4.13.1 /root/ocaml-4.13.1.tar.gz RUN apk add patch diff --git a/release/Makefile b/release/Makefile index fbd3472c2ee..909aa620021 100644 --- a/release/Makefile +++ b/release/Makefile @@ -7,7 +7,7 @@ FULL_ARCHIVE_URL = https://github.com/ocaml/opam/releases/download/$(VERSION)/op TARGETS = x86_64-linux i686-linux armhf-linux arm64-linux -OCAMLV = 4.12.0 +OCAMLV = 4.13.1 # currently hardcoded in Dockerfile.in OCAML_URL = https://caml.inria.fr/pub/distrib/ocaml-$(basename $(OCAMLV))/ocaml-$(OCAMLV).tar.gz From bd522fbed08e43fe6ca5254d0985ea6867edd94e Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Fri, 7 Jan 2022 14:29:59 +0000 Subject: [PATCH 4/5] Fix AppVeyor deployment target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9faf156e193..5cbaba3cdc1 100644 --- a/Makefile +++ b/Makefile @@ -268,4 +268,4 @@ cold-%: .PHONY: run-appveyor-test run-appveyor-test: - env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" ./appveyor_test.sh + env -u OCAMLLIB -u CAML_LD_LIBRARY_PATH PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" ./appveyor_test.sh From 2821bbca409838fa1e5e7fbc497706cdb1dc1abf Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Fri, 7 Jan 2022 14:42:53 +0000 Subject: [PATCH 5/5] Select cold compiler for AppVeyor test This test is becoming a bit dated, though, now that the testsuite actually works. --- appveyor_test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor_test.sh b/appveyor_test.sh index b73b56aa102..b642a5c1f24 100755 --- a/appveyor_test.sh +++ b/appveyor_test.sh @@ -1,5 +1,7 @@ #!/bin/bash -opam init -y -a --compiler=ocaml.4.13.1 git+$OPAM_REPO#$OPAM_TEST_REPO_SHA +COLD_OCAML="$(sed -ne 's/URL_ocaml = .*ocaml-.*ocaml-\(.*\)\.tar\.gz/ocaml.\1/p' src_ext/Makefile)" +# This is supposed to be able to select ocaml-system using the bootstrap compiler +opam init -y -a --compiler=$COLD_OCAML git+$OPAM_REPO#$OPAM_TEST_REPO_SHA eval $(opam config env) opam install -y -v ocamlfind