From 220449e6d39fa114fc8c0a2ab783aeca9b76eeb0 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 22 Jul 2021 13:19:37 +0100 Subject: [PATCH 1/2] Update minimum OCaml versions for 2.2.0 opam-core, opam-format and opam-installer remain with OCaml 4.03.0 as the minimum requirement; the rest of opam winds forwards to 4.08.0 --- .github/scripts/legacy.sh | 16 ++++++++++++++ .github/workflows/main.yml | 41 ++++++++++++++++++++++++++++++++---- configure | 8 +------ configure.ac | 6 +----- master_changes.md | 1 + opam-client.opam | 2 +- opam-core.opam | 2 +- opam-devel.opam | 2 +- opam-format.opam | 2 +- opam-installer.opam | 2 +- opam-repository.opam | 2 +- opam-solver.opam | 2 +- opam-state.opam | 2 +- src/client/opamCLIVersion.ml | 12 +++++------ 14 files changed, 70 insertions(+), 30 deletions(-) create mode 100644 .github/scripts/legacy.sh diff --git a/.github/scripts/legacy.sh b/.github/scripts/legacy.sh new file mode 100644 index 00000000000..d7c52806026 --- /dev/null +++ b/.github/scripts/legacy.sh @@ -0,0 +1,16 @@ +#!/bin/bash -xue + +. .github/scripts/preamble.sh + +export OPAMYES=1 +export OCAMLRUNPARAM=b + +opam init default git+$OPAM_REPO#$OPAM_REPO_SHA +eval $(opam env) +OPAMCLI=2.0 opam reinstall ocaml-system --unlock-base +opam upgrade +for package in core format installer ; do + opam pin add -yn opam-$package . +done +opam install opam-core opam-format opam-installer --deps-only +dune build --profile=dev --only-packages opam-core,opam-format,opam-installer @install diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4612e5f6065..b4bb3940067 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,14 +108,14 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - ocamlv: [ 4.03.0, 4.04.2, 4.05.0, 4.06.1, 4.07.1, 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.0 ] include: - os: macos-latest ocamlv: 4.12.0 - # Intentionnaly fail fast, no need to run all build if there is a + # 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 caml - # fail-fast: false + # versions of OCaml + fail-fast: true steps: - name: install deps if: ${{ matrix.os == 'ubuntu-latest' }} @@ -137,6 +137,39 @@ jobs: OCAML_VERSION: ${{ matrix.ocamlv }} run: bash -exu .github/scripts/main.sh +#### +# Legacy +#### + legacy: + runs-on: ubuntu-latest + strategy: + matrix: + os: [ Linux ] + ocamlv: [ 4.03.0, 4.04.2, 4.05.0, 4.06.1, 4.07.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 + fail-fast: true + steps: + - name: install deps + run: sudo apt install opam + - uses: actions/checkout@v2 + - name: ocaml ${{ matrix.ocamlv }} cache + id: ocaml-cache + uses: actions/cache@v2 + with: + path: ${{ env.GH_OCAML_CACHE }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ hashFiles ('.github/scripts/ocaml-cache.sh', '.github/scripts/preamble.sh') }} + - name: Building ocaml ${{ matrix.ocamlv }} cache + if: steps.ocaml-cache.outputs.cache-hit != 'true' + env: + OCAML_VERSION: ${{ matrix.ocamlv }} + run: bash -exu .github/scripts/ocaml-cache.sh ocaml + - name: Build + env: + OCAML_VERSION: ${{ matrix.ocamlv }} + run: bash -exu .github/scripts/legacy.sh + #### # Opam tests #### diff --git a/configure b/configure index 73fb7f5fa78..d183df6724e 100755 --- a/configure +++ b/configure @@ -2184,8 +2184,7 @@ if test -x bootstrap/ocaml/bin/ocamlc -o -x bootstrap/ocaml/bin/ocamlopt ; then fi -# XXX This isn't strictly correct for Windows -MIN_OCAML_VERSION=4.03.0 +MIN_OCAML_VERSION=4.08.0 # checking for ocamlc if test -n "$ac_tool_prefix"; then @@ -3504,8 +3503,6 @@ CPATH=$CPATH LIBRARY_PATH=$LIBRARY_PATH -# Check that OCaml version is greater or equal to 4.03.0 -# Native Windows builds require at least 4.06.0 for the Unicode runtime. for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -3550,9 +3547,6 @@ done if test "x${enable_version_check}" != "xno"; then : - if test ${WIN32} -eq 1 ; then : - MIN_OCAML_VERSION=4.06.0 -fi diff --git a/configure.ac b/configure.ac index c87b5b297a5..13cb6686791 100644 --- a/configure.ac +++ b/configure.ac @@ -14,8 +14,7 @@ AS_IF([ test -x bootstrap/ocaml/bin/ocamlc -o -x bootstrap/ocaml/bin/ocamlopt ], export PATH="$PATH_PREPEND$PATH" ]) -# XXX This isn't strictly correct for Windows -MIN_OCAML_VERSION=4.03.0 +MIN_OCAML_VERSION=4.08.0 AC_PROG_OCAML if test "x$OCAMLC" = "xno"; then @@ -86,10 +85,7 @@ AC_SUBST(LIB_PREFIX,$LIB_PREFIX) AC_SUBST(CPATH,$CPATH) AC_SUBST(LIBRARY_PATH,$LIBRARY_PATH) -# Check that OCaml version is greater or equal to 4.03.0 -# Native Windows builds require at least 4.06.0 for the Unicode runtime. AS_IF([test "x${enable_version_check}" != "xno"], [ - AS_IF([ test ${WIN32} -eq 1 ],[MIN_OCAML_VERSION=4.06.0]) AX_COMPARE_VERSION( [$OCAMLVERSION], [lt], [$MIN_OCAML_VERSION], AC_MSG_ERROR([Your version of OCaml ($OCAMLVERSION) is not supported])) diff --git a/master_changes.md b/master_changes.md index f54f7a8dfd2..44744f40a9d 100644 --- a/master_changes.md +++ b/master_changes.md @@ -83,6 +83,7 @@ users) * Upgrade to dose3 >= 6.1 and vendor dose3 7.0.0 [#4760 @kit-ty-kate] * Change minimum required OCaml to 4.03.0 [#4770 @dra27] * Change minimum required Dune to 2.0 [#4770 @dra27] + * Change minimum required OCaml to 4.08.0 for everything except opam-core, opam-format and opam-installer [#4775 @dra27] ## Infrastructure * diff --git a/opam-client.opam b/opam-client.opam index 681a26f0ca3..5d4054fffa7 100644 --- a/opam-client.opam +++ b/opam-client.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.03.0"} + "ocaml" {>= "4.08.0"} "opam-state" {= version} "opam-solver" {= version} "base64" {>= "3.1.0"} diff --git a/opam-core.opam b/opam-core.opam index c93038b99a6..540f4a20f77 100644 --- a/opam-core.opam +++ b/opam-core.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.03.0"} + "ocaml" {(>= "4.03.0" & os != "win32") | >= "4.06.0"} "base-unix" "base-bigarray" "ocamlgraph" diff --git a/opam-devel.opam b/opam-devel.opam index ffe40831003..5327bb6c9ee 100644 --- a/opam-devel.opam +++ b/opam-devel.opam @@ -26,7 +26,7 @@ build: [ [make "%{name}%.install"] ] depends: [ - "ocaml" {>= "4.03.0"} + "ocaml" {>= "4.08.0"} "opam-client" {= version} "cmdliner" {>= "0.9.8"} "dune" {>= "2.0.0"} diff --git a/opam-format.opam b/opam-format.opam index 4f1b5e3b090..0ad9425595e 100644 --- a/opam-format.opam +++ b/opam-format.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.03.0"} + "ocaml" {(>= "4.03.0" & os != "win32") | >= "4.06.0"} "opam-core" {= version} "opam-file-format" {>= "2.1.3"} "re" {>= "1.9.0"} diff --git a/opam-installer.opam b/opam-installer.opam index d7fd2e54f6e..90c82995493 100644 --- a/opam-installer.opam +++ b/opam-installer.opam @@ -28,7 +28,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.03.0"} + "ocaml" {(>= "4.03.0" & os != "win32") | >= "4.06.0"} "opam-format" {= version} "cmdliner" {>= "0.9.8"} "dune" {>= "2.0.0"} diff --git a/opam-repository.opam b/opam-repository.opam index 4c19e342f2f..64fc4603a44 100644 --- a/opam-repository.opam +++ b/opam-repository.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.03.0"} + "ocaml" {>= "4.08.0"} "opam-format" {= version} "dune" {>= "2.0.0"} ] diff --git a/opam-solver.opam b/opam-solver.opam index 3fd0e05f328..3775aeb942a 100644 --- a/opam-solver.opam +++ b/opam-solver.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.03.0"} + "ocaml" {>= "4.08.0"} "opam-format" {= version} "mccs" {>= "1.1+9"} "dose3" {>= "6.1"} diff --git a/opam-state.opam b/opam-state.opam index fa44715904a..fbf1ff61650 100644 --- a/opam-state.opam +++ b/opam-state.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.03.0"} + "ocaml" {>= "4.08.0"} "opam-repository" {= version} "re" {>= "1.9.0"} "dune" {>= "2.0.0"} diff --git a/src/client/opamCLIVersion.ml b/src/client/opamCLIVersion.ml index 8c941bfcc23..c403cb6aaff 100644 --- a/src/client/opamCLIVersion.ml +++ b/src/client/opamCLIVersion.ml @@ -39,9 +39,9 @@ let of_json = function | `String x -> of_string_opt x | _ -> None -let ( >= ) = OpamCompat.Stdlib.( >= ) -let ( < ) = OpamCompat.Stdlib.( < ) -let compare = OpamCompat.Stdlib.compare +let ( >= ) = Stdlib.( >= ) +let ( < ) = Stdlib.( < ) +let compare = Stdlib.compare let previous cli = let f previous version = @@ -64,9 +64,9 @@ module Sourced = struct end module Op = struct - let ( @>= ) (c,_) = OpamCompat.Stdlib.( >= ) c - let ( @< ) (c,_) = OpamCompat.Stdlib.( < ) c - let ( @= ) (c,_) = OpamCompat.Stdlib.( = ) c + let ( @>= ) (c,_) = Stdlib.( >= ) c + let ( @< ) (c,_) = Stdlib.( < ) c + let ( @= ) (c,_) = Stdlib.( = ) c end module O = struct From ec39ef19177a21315223f9b815da97d93bec62f3 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 22 Jul 2021 12:53:32 +0100 Subject: [PATCH 2/2] Stop disabling warning 67 in configure --- configure | 7 +------ configure.ac | 5 +---- master_changes.md | 2 +- src/repository/opamVCS.mli | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/configure b/configure index d183df6724e..4f25c26ff5c 100755 --- a/configure +++ b/configure @@ -4788,13 +4788,8 @@ fi fi -CONF_OCAMLFLAGS="-w -67" +CONF_OCAMLFLAGS='' -if test "x${CI}" != "x"; then : - - CONF_OCAMLFLAGS="${CONF_OCAMLFLAGS} -w -67" - -fi if test "x${CI}" != "x" -o "x${enable_developer_mode}" = "xyes"; then : if test "x${CCOMP_TYPE}" = "xmsvc"; then : diff --git a/configure.ac b/configure.ac index 13cb6686791..f7a2a6dfe22 100644 --- a/configure.ac +++ b/configure.ac @@ -164,11 +164,8 @@ AS_IF([test "x${with_libacl}" = "xyes"],[ ]) ]) -CONF_OCAMLFLAGS="-w -67" +CONF_OCAMLFLAGS='' -AS_IF([test "x${CI}" != "x"], [ - CONF_OCAMLFLAGS="${CONF_OCAMLFLAGS} -w -67" -],[]) AS_IF([test "x${CI}" != "x" -o "x${enable_developer_mode}" = "xyes"],[ AS_IF([test "x${CCOMP_TYPE}" = "xmsvc"],[ CONF_CFLAGS="\"/WX\"" diff --git a/master_changes.md b/master_changes.md index 44744f40a9d..616afac0cfd 100644 --- a/master_changes.md +++ b/master_changes.md @@ -76,7 +76,7 @@ users) * ## VCS - * + * Use 4.08's unnamed functor arguments to silence warning 67 [#4775 @dra27] ## Build * Bump src_exts and fix build compat with Dune 2.9.0 [#4752 @dra27] diff --git a/src/repository/opamVCS.mli b/src/repository/opamVCS.mli index 82b8d98a5c0..87ea8e82c9a 100644 --- a/src/repository/opamVCS.mli +++ b/src/repository/opamVCS.mli @@ -75,4 +75,4 @@ module type VCS = sig end (** Create a backend from a [VCS] implementation. *) -module Make(VCS : VCS) : OpamRepositoryBackend.S +module Make(_ : VCS) : OpamRepositoryBackend.S