diff --git a/.github/scripts/cygwin.cmd b/.github/scripts/cygwin.cmd index c60835be74a..cfc9ee38a52 100644 --- a/.github/scripts/cygwin.cmd +++ b/.github/scripts/cygwin.cmd @@ -83,10 +83,10 @@ md %CYGWIN_ROOT% :: Download the required setup program: the mingw-w64 compilers are only :: installed with Cygwin64. if "%1" equ "x86_64-pc-cygwin" ( - curl -sLo %CYGWIN_ROOT%\setup.exe https://cygwin.com/setup-x86_64.exe + curl -fsSLo %CYGWIN_ROOT%\setup.exe https://cygwin.com/setup-x86_64.exe set CYGWIN_PACKAGES=,mingw64-i686-gcc-core=14.3.0-0.1,mingw64-x86_64-gcc-core=14.3.0-0.1,mingw64-i686-gcc-g++=14.3.0-0.1,mingw64-x86_64-gcc-g++=14.3.0-0.1 ) else ( - curl -sLo %CYGWIN_ROOT%\setup.exe https://cygwin.com/setup-x86.exe + curl -fsSLo %CYGWIN_ROOT%\setup.exe https://cygwin.com/setup-x86.exe set CYGWIN_PACKAGES= ) diff --git a/.github/scripts/main/ocaml-cache.sh b/.github/scripts/main/ocaml-cache.sh index 8effee34363..355e2e73bc1 100644 --- a/.github/scripts/main/ocaml-cache.sh +++ b/.github/scripts/main/ocaml-cache.sh @@ -42,10 +42,11 @@ esac FLEXDLL_VERSION=0.43 MINGW_W64_VERSION=12.0.0 -curl -sLO "https://github.com/ocaml/ocaml/archive/refs/tags/${OCAML_VERSION}.tar.gz" +curl -fsSLO "https://github.com/ocaml/ocaml/archive/refs/tags/${OCAML_VERSION}.tar.gz" || \ +curl -fsSLO "https://github.com/ocaml/ocaml/archive/refs/heads/${OCAML_VERSION}.tar.gz" if [[ $PLATFORM = 'Windows' ]] ; then - curl -sLO "https://github.com/ocaml/flexdll/archive/refs/tags/$FLEXDLL_VERSION.tar.gz" - curl -sLO "https://github.com/mingw-w64/mingw-w64/archive/refs/tags/v${MINGW_W64_VERSION}.tar.gz" + curl -fsSLO "https://github.com/ocaml/flexdll/archive/refs/tags/$FLEXDLL_VERSION.tar.gz" + curl -fsSLO "https://github.com/mingw-w64/mingw-w64/archive/refs/tags/v${MINGW_W64_VERSION}.tar.gz" fi tar -xzf "$OCAML_VERSION.tar.gz" @@ -61,7 +62,7 @@ esac cd "ocaml-$OCAML_VERSION" for sha in $PATCHES; do - curl -sL "https://github.com/ocaml/ocaml/commit/$sha.patch" -o "../$sha.patch" + curl -fsSL "https://github.com/ocaml/ocaml/commit/$sha.patch" -o "../$sha.patch" patch -p1 -i "../$sha.patch" done @@ -96,8 +97,8 @@ OCAML_BRANCH="${OCAML_BRANCH/./}" if [[ $OPAM_TEST -ne 1 ]] ; then if [[ -e configure.ac ]]; then CONFIGURE_SWITCHES="--disable-debugger --disable-debug-runtime --disable-ocamldoc --disable-installing-bytecode-programs --disable-installing-source-artifacts" - if [[ $OCAML_BRANCH -eq 408 ]]; then - curl -L https://github.com/ocaml/ocaml/commit/c8ee39b320207717135d88cad67fb65d0901d6b6.patch -o pr8858.patch + if [[ $OCAML_BRANCH = 408 ]]; then + curl -fsSL https://github.com/ocaml/ocaml/commit/c8ee39b320207717135d88cad67fb65d0901d6b6.patch -o pr8858.patch patch -p1 -i pr8858.patch CONFIGURE_SWITCHES="$CONFIGURE_SWITCHES --disable-graph-lib" fi diff --git a/.github/scripts/main/opam-bs-cache.sh b/.github/scripts/main/opam-bs-cache.sh index 8db122194c5..dd723be07c6 100644 --- a/.github/scripts/main/opam-bs-cache.sh +++ b/.github/scripts/main/opam-bs-cache.sh @@ -12,7 +12,7 @@ if [ "$os" = "darwin" ] ; then os=macos fi -curl -sL -o $OPAM_LOCAL/bin/opam-bootstrap \ +curl -fsSL -o $OPAM_LOCAL/bin/opam-bootstrap \ "https://github.com/ocaml/opam/releases/download/$OPAMBSVERSION/opam-$OPAMBSVERSION-$(uname -m)-$os" cp -f $OPAM_LOCAL/bin/opam-bootstrap $OPAM_LOCAL/bin/opam chmod a+x $OPAM_LOCAL/bin/opam diff --git a/.github/scripts/main/preamble.sh b/.github/scripts/main/preamble.sh index 4d3b9062bf9..53865eba2a2 100644 --- a/.github/scripts/main/preamble.sh +++ b/.github/scripts/main/preamble.sh @@ -22,7 +22,7 @@ OPAM_DOC=${OPAM_DOC:-0} OPAM_DEPENDS=${OPAM_DEPENDS:-0} OPAM_UPGRADE=${OPAM_UPGRADE:-0} -OPAM_REPO_MAIN=https://github.com/ocaml/opam-repository.git +OPAM_REPO_MAIN=https://github.com/kit-ty-kate/opam-repository.git OPAM12CACHE=`eval echo $OPAM12CACHE` OPAMBSROOT=`eval echo $OPAMBSROOT` diff --git a/.github/scripts/main/upgrade.sh b/.github/scripts/main/upgrade.sh index 7435f698b57..2d8731dc4e6 100644 --- a/.github/scripts/main/upgrade.sh +++ b/.github/scripts/main/upgrade.sh @@ -16,7 +16,7 @@ if [[ ! -f $OPAM12 ]]; then if [ "$RUNNER_OS" = "macOS" ]; then os="Darwin" fi - curl -sL "https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-$os" -o $OPAM12 + curl -fsSL "https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-$os" -o $OPAM12 chmod +x $OPAM12 fi export OPAMROOT=/tmp/opamroot diff --git a/.github/scripts/scripts/hygiene.sh b/.github/scripts/scripts/hygiene.sh index 2d41b6c3fca..8c7a8ed811e 100644 --- a/.github/scripts/scripts/hygiene.sh +++ b/.github/scripts/scripts/hygiene.sh @@ -32,7 +32,7 @@ if [[ $GITHUB_EVENT_NAME = 'pull_request' ]]; then fi URL="$OPAM_BIN_URL_BASE$tag/opam-$tag-$platform" echo "Downloading $URL" - check=$(curl -Ls "$URL" | sha512sum | cut -d' ' -f1) + check=$(curl -fsSL "$URL" | sha512sum | cut -d' ' -f1) if [[ $check = $sha ]] ; then echo " as expected ($sha)" else diff --git a/.github/workflows/ci.ml b/.github/workflows/ci.ml index 24a9873597b..389508e564e 100644 --- a/.github/workflows/ci.ml +++ b/.github/workflows/ci.ml @@ -14,16 +14,17 @@ open Lib let latest_ocaml4 = "4.14.2" -let latest_ocaml5 = "5.3.0" (* Add this number to ocamls below when the next version comes out *) +let latest_ocaml5 = "5.4.0-beta2" (* Add this number to ocamls below when the next version comes out *) let ocamls = [ (* Fully supported versions *) "4.08.1"; "4.09.1"; "4.10.2"; "4.11.2"; "4.12.1"; "4.13.1"; - "5.0.0"; "5.1.1"; "5.2.1"; + "5.0.0"; "5.1.1"; "5.2.1"; "5.3.0"; "trunk"; (* The last elements of the list after 4.14 will be used as default versions *) latest_ocaml4; latest_ocaml5; ] -let start_latests_ocaml = (4, 14) +let start_latests_ocaml = latest_ocaml4 +let oldest_ocamlv = List.hd ocamls (* Entry point for the workflow. Workflows are specified as continuations where each job is passed as a continuation to the [workflow], terminated with @@ -69,12 +70,9 @@ jobs: let end_workflow ~oc:_ ~workflow:_ = () -let ocamls = - List.map (fun v -> Scanf.sscanf v "%u.%u.%u" (fun major minor _ -> ((major, minor), v))) ocamls - let platform_ocaml_matrix ?(dir=List.drop_while) ~fail_fast start_version = (fail_fast, - [("ocamlv", List.map snd (dir (fun ocaml -> fst ocaml <> start_version) ocamls))], + [("ocamlv", dir (fun ocaml -> not (String.equal ocaml start_version)) ocamls)], []) let git_lf_checkouts ?(title="Configure Git") ?cond ?shell () = @@ -315,7 +313,7 @@ let main_build_job ~analyse_job ~cygwin_job ?section runner start_version ~oc ~w "x86_64-pc-windows" ] in let ocaml5 = [ - (* "x86_64-pc-cygwin"; *) (* TODO: Restore Cygwin + OCaml 5.3 when C++ support is fixed and released *) + "x86_64-pc-cygwin"; "x86_64-w64-mingw32"; "x86_64-pc-windows"; ] in @@ -543,9 +541,9 @@ let main oc : unit = ("OPAMBSROOT", "~/.cache/.opam.cached"); ("OPAM12CACHE", "~/.cache/opam1.2/cache"); (* These should be identical to the values in appveyor.yml *) - ("OPAM_REPO", "https://github.com/ocaml/opam-repository.git"); - ("OPAM_TEST_REPO_SHA", "3dab8c734b15bf2b5c1d8b99bb134f51361a6bee"); - ("OPAM_REPO_SHA", "3dab8c734b15bf2b5c1d8b99bb134f51361a6bee"); + ("OPAM_REPO", "https://github.com/kit-ty-kate/opam-repository.git"); + ("OPAM_TEST_REPO_SHA", "2e86b4d508e56b2affe6458ef776e20b9b4ec253"); + ("OPAM_REPO_SHA", "2e86b4d508e56b2affe6458ef776e20b9b4ec253"); ("SOLVER", ""); (* Cygwin configuration *) ("CYGWIN_MIRROR", "http://mirrors.kernel.org/sourceware/cygwin/"); @@ -562,7 +560,7 @@ let main oc : unit = workflow ~oc ~env "Builds, tests & co" ++ analyse_job ~keys ~platforms:[Linux] @@ fun analyse_job -> cygwin_job ~analyse_job - @@ fun cygwin_job -> main_build_job ~analyse_job ~cygwin_job ~section:"Build" Linux (4, 08) + @@ fun cygwin_job -> main_build_job ~analyse_job ~cygwin_job ~section:"Build" Linux oldest_ocamlv @@ fun build_linux_job -> main_build_job ~analyse_job ~cygwin_job Windows start_latests_ocaml @@ fun build_windows_job -> main_build_job ~analyse_job ~cygwin_job MacOS start_latests_ocaml @@ fun build_macOS_job -> main_test_job ~analyse_job ~build_linux_job ~build_windows_job ~build_macOS_job ~section:"Opam tests" Linux diff --git a/.github/workflows/depexts.yml b/.github/workflows/depexts.yml index 2a5f863c35c..35d91b85d51 100644 --- a/.github/workflows/depexts.yml +++ b/.github/workflows/depexts.yml @@ -18,8 +18,8 @@ defaults: env: OPAMVERSION: 2.4.1 - OPAM_REPO: https://github.com/ocaml/opam-repository.git - OPAM_REPO_SHA: 3dab8c734b15bf2b5c1d8b99bb134f51361a6bee + OPAM_REPO: https://github.com/kit-ty-kate/opam-repository.git + OPAM_REPO_SHA: 2e86b4d508e56b2affe6458ef776e20b9b4ec253 jobs: opam-cache: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d3671d41a1c..e3b679ff8bb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,9 +25,9 @@ env: OPAMBSVERSION: 2.1.0 OPAMBSROOT: ~/.cache/.opam.cached OPAM12CACHE: ~/.cache/opam1.2/cache - OPAM_REPO: https://github.com/ocaml/opam-repository.git - OPAM_TEST_REPO_SHA: 3dab8c734b15bf2b5c1d8b99bb134f51361a6bee - OPAM_REPO_SHA: 3dab8c734b15bf2b5c1d8b99bb134f51361a6bee + OPAM_REPO: https://github.com/kit-ty-kate/opam-repository.git + OPAM_TEST_REPO_SHA: 2e86b4d508e56b2affe6458ef776e20b9b4ec253 + OPAM_REPO_SHA: 2e86b4d508e56b2affe6458ef776e20b9b4ec253 SOLVER: CYGWIN_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/ CYGWIN_ROOT: D:\cygwin @@ -106,7 +106,7 @@ jobs: needs: Analyse strategy: matrix: - ocamlv: [ 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.1, 4.13.1, 5.0.0, 5.1.1, 5.2.1, 4.14.2, 5.3.0 ] + ocamlv: [ 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.1, 4.13.1, 5.0.0, 5.1.1, 5.2.1, 5.3.0, trunk, 4.14.2, 5.4.0-beta2 ] fail-fast: true steps: - name: Install bubblewrap @@ -159,12 +159,15 @@ jobs: - host: x86_64-pc-windows build: x86_64-pc-cygwin ocamlv: 4.14.2 + - host: x86_64-pc-cygwin + build: x86_64-pc-cygwin + ocamlv: 5.4.0-beta2 - host: x86_64-w64-mingw32 build: x86_64-pc-cygwin - ocamlv: 5.3.0 + ocamlv: 5.4.0-beta2 - host: x86_64-pc-windows build: x86_64-pc-cygwin - ocamlv: 5.3.0 + ocamlv: 5.4.0-beta2 fail-fast: false defaults: run: @@ -250,7 +253,7 @@ jobs: needs: Analyse strategy: matrix: - ocamlv: [ 4.14.2, 5.3.0 ] + ocamlv: [ 4.14.2, 5.4.0-beta2 ] fail-fast: true steps: - name: Install GNU patch @@ -288,7 +291,7 @@ jobs: needs: [ Analyse, Build-Linux ] strategy: matrix: - ocamlv: [ 4.14.2, 5.3.0 ] + ocamlv: [ 4.14.2, 5.4.0-beta2 ] fail-fast: false env: OPAM_TEST: 1 @@ -345,7 +348,7 @@ jobs: needs: Analyse strategy: matrix: - ocamlv: [ 4.14.2, 5.3.0 ] + ocamlv: [ 4.14.2, 5.4.0-beta2 ] fail-fast: false env: OPAM_TEST: 1 @@ -434,7 +437,7 @@ jobs: needs: [ Analyse, Build-Linux ] strategy: matrix: - ocamlv: [ 4.14.2, 5.3.0 ] + ocamlv: [ 4.14.2, 5.4.0-beta2 ] fail-fast: false env: OPAM_DOC: 1 @@ -491,7 +494,7 @@ jobs: strategy: matrix: solver: [ z3, 0install ] - ocamlv: [ 4.14.2, 5.3.0 ] + ocamlv: [ 4.14.2, 5.4.0-beta2 ] fail-fast: false env: SOLVER: ${{ matrix.solver }} @@ -541,7 +544,7 @@ jobs: strategy: matrix: solver: [ z3, 0install ] - ocamlv: [ 4.14.2, 5.3.0 ] + ocamlv: [ 4.14.2, 5.4.0-beta2 ] fail-fast: false env: SOLVER: ${{ matrix.solver }} @@ -589,7 +592,7 @@ jobs: needs: [ Analyse, Build-Linux ] strategy: matrix: - ocamlv: [ 4.14.2, 5.3.0 ] + ocamlv: [ 4.14.2, 5.4.0-beta2 ] fail-fast: false steps: - name: Install bubblewrap @@ -624,7 +627,7 @@ jobs: needs: [ Analyse, Build-macOS ] strategy: matrix: - ocamlv: [ 4.14.2, 5.3.0 ] + ocamlv: [ 4.14.2, 5.4.0-beta2 ] fail-fast: false steps: - name: Checkout tree @@ -694,7 +697,7 @@ jobs: needs: [ Analyse, Build-Linux ] strategy: matrix: - ocamlv: [ 4.14.2, 5.3.0 ] + ocamlv: [ 4.14.2, 5.4.0-beta2 ] fail-fast: false env: OPAM_DEPENDS: 1 diff --git a/src/client/opamTreeCommand.ml b/src/client/opamTreeCommand.ml index e8fd1c49a45..ee3c7169258 100644 --- a/src/client/opamTreeCommand.ml +++ b/src/client/opamTreeCommand.ml @@ -12,8 +12,8 @@ open OpamTypes open OpamStateTypes -type deps -type revdeps +type deps = private [`deps] +type revdeps = private [`revdeps] type 'a node = | Root of package | Dependency : {