From 80f643fc6a826f729c8efb8cbae159c26657ea59 Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 4 Mar 2024 21:17:45 +0000 Subject: [PATCH 1/8] Upgrade the vendored dune to 3.14.0 --- .github/scripts/main/create-ocaml-cache.sh | 4 ++-- Makefile | 4 ++-- master_changes.md | 1 + src_ext/Makefile | 2 +- src_ext/Makefile.dune | 4 ++-- src_ext/Makefile.packages | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/scripts/main/create-ocaml-cache.sh b/.github/scripts/main/create-ocaml-cache.sh index e7a3456aa03..c1f6468d4ee 100755 --- a/.github/scripts/main/create-ocaml-cache.sh +++ b/.github/scripts/main/create-ocaml-cache.sh @@ -16,8 +16,8 @@ if [[ $OCAML_BRANCH -gt 407 ]]; then fi make -C src_ext dune-local.stamp cd src_ext/dune-local - ocaml bootstrap.ml - cp dune.exe "$PREFIX/bin/dune$EXE" + ocaml boot/bootstrap.ml + cp _boot/dune.exe "$PREFIX/bin/dune$EXE" cd ../.. ./configure --with-vendored-deps diff --git a/Makefile b/Makefile index 922e0c58490..bd348316466 100644 --- a/Makefile +++ b/Makefile @@ -50,9 +50,9 @@ endif src_ext/dune-local/dune.exe: src_ext/dune-local.stamp $(DUNE_SECONDARY) ifeq ($(DUNE_SECONDARY),) - cd src_ext/dune-local && ocaml bootstrap.ml + cd src_ext/dune-local && ocaml boot/bootstrap.ml else - cd src_ext/dune-local && ( unset OCAMLLIB ; unset CAML_LD_LIBRARY_PATH ; PATH="$(dir $(realpath $(DUNE_SECONDARY))):$$PATH" ../../$(DUNE_SECONDARY) bootstrap.ml ) + cd src_ext/dune-local && ( unset OCAMLLIB ; unset CAML_LD_LIBRARY_PATH ; PATH="$(dir $(realpath $(DUNE_SECONDARY))):$$PATH" ../../$(DUNE_SECONDARY) boot/bootstrap.ml ) endif src_ext/dune-local.stamp: diff --git a/master_changes.md b/master_changes.md index fe0164428f7..10ddce48939 100644 --- a/master_changes.md +++ b/master_changes.md @@ -84,6 +84,7 @@ users) * Do not check for cppo in the configure script (not used directly anymore since #5498) [#5794 @kit-ty-kate] * Upgrade vendored cmdliner to 1.2.0 [#5797 @kit-ty-kate] * Add winsymlinks:native to the CYGWIN environment variable when installing a package on Windows [#5793 @kit-ty-kate - fix #5782] + * Upgrade the vendored dune to 3.14.0 [#5869 @kit-ty-kate] ## Infrastructure * Fix depexts CI workflow and ensure all workflows run on master push [#5788 @dra27] diff --git a/src_ext/Makefile b/src_ext/Makefile index ee43ea971a6..bcb7ed1fbf6 100644 --- a/src_ext/Makefile +++ b/src_ext/Makefile @@ -115,7 +115,7 @@ DUNE_CLONE= endif dune-local/_boot/install/default/bin/dune$(EXE): $(DUNE_CLONE) - cd dune-local && ocaml bootstrap.ml && ./boot.exe --release + cd dune-local && ocaml boot/bootstrap.ml && ./boot.exe --release build-pkg: clone-pkg $(PKG_EXTS:=.pkgbuild) @ diff --git a/src_ext/Makefile.dune b/src_ext/Makefile.dune index 1374e140d10..d1e43cc3854 100644 --- a/src_ext/Makefile.dune +++ b/src_ext/Makefile.dune @@ -1,3 +1,3 @@ # NB If minimum OCaml version for Dune changes, update DUNE_SECONDARY in configure.ac -URL_dune-local = https://github.com/ocaml/dune/releases/download/3.5.0/dune-3.5.0.tbz -MD5_dune-local = 46d1bde258ef60f60f053e88fe9d937b +URL_dune-local = https://github.com/ocaml/dune/releases/download/3.14.0/dune-3.14.0.tbz +MD5_dune-local = bff778fff4996b890e5af3da7ecf5baa diff --git a/src_ext/Makefile.packages b/src_ext/Makefile.packages index 6212dab04f2..0ad553137bb 100644 --- a/src_ext/Makefile.packages +++ b/src_ext/Makefile.packages @@ -115,7 +115,7 @@ dose3-pkg-build: dune install "--prefix=$(OCAMLROOT)" -p dose3 dose3 dune-local-pkg-build: - ocaml bootstrap.ml + ocaml boot/bootstrap.ml cp dune.exe $(OCAMLBIN)/dune$(EXT_EXE) mccs-pkg-build: stublibs From 6ff21740f68df782d58d2f28bea6c763f3ea9b0c Mon Sep 17 00:00:00 2001 From: Kate Date: Tue, 5 Mar 2024 13:11:07 +0000 Subject: [PATCH 2/8] GHA: Add src_ext/Makefile.dune to the archive cache key --- .github/workflows/ci.ml | 4 ++-- .github/workflows/main.yml | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.ml b/.github/workflows/ci.ml index 7c486e77d91..2ea12514e59 100644 --- a/.github/workflows/ci.ml +++ b/.github/workflows/ci.ml @@ -128,7 +128,7 @@ let get_cache_cont : type s . s cache_name -> s = function | _ -> fun _ b -> b in let is_windows = if_windows true false in f {name = Printf.sprintf "OCaml %s" version; - key = Printf.sprintf "${{ runner.os }}%s-ocaml-%s-${{ %s.outputs.ocaml-cache }}" (if_windows ("-" ^ host) "") version; + key = Printf.sprintf "${{ runner.os }}%s-ocaml-%s-${{ %s.outputs.ocaml-cache }}-${{ %s.outputs.archives }}" (if_windows ("-" ^ host) "") version version; id = "ocaml-cache"; force_gzip = is_windows; paths = [if_windows {|D:\Cache\ocaml-local.tar|} "~/.cache/ocaml-local/**"]; @@ -487,7 +487,7 @@ let main oc : unit = ("CYGWIN_EPOCH", "3"); ] in let keys = [ - ("archives", "archives-1-${{ hashFiles('src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }}"); + ("archives", "archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }}"); ("ocaml-cache", "${{ hashFiles('.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }}"); ("cygwin", "${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }}"); ("opam-bs-cache", "${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }}"); diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 48026cdf55a..a63bcb559d3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,8 +56,8 @@ jobs: - name: Determine cache keys id: keys run: | - echo archives=archives-1-${{ hashFiles('src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} - echo archives=archives-1-${{ hashFiles('src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} >> $GITHUB_OUTPUT + echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} + echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} >> $GITHUB_OUTPUT echo ocaml-cache=${{ hashFiles('.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }} echo ocaml-cache=${{ hashFiles('.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }} >> $GITHUB_OUTPUT echo cygwin=${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }} @@ -127,7 +127,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -179,7 +179,7 @@ jobs: uses: ocaml-opam/cache@opam with: path: D:\Cache\ocaml-local.tar - key: ${{ runner.os }}-${{ matrix.host }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} + key: ${{ runner.os }}-${{ matrix.host }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} force-gzip: true - name: Unpack Cygwin shell: cmd @@ -245,7 +245,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -285,7 +285,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -339,7 +339,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -428,7 +428,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -474,7 +474,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -517,7 +517,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -548,7 +548,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} From f46bf69d5314e7fd7bb5cc2a10d8b7a08b831f87 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 5 Mar 2024 21:59:54 +0000 Subject: [PATCH 3/8] Fix cache key --- .github/scripts/main/create-ocaml-cache.sh | 13 ++++++++----- .github/workflows/ci.ml | 4 ++-- .github/workflows/main.yml | 22 +++++++++++----------- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/scripts/main/create-ocaml-cache.sh b/.github/scripts/main/create-ocaml-cache.sh index c1f6468d4ee..25b9bcdca94 100755 --- a/.github/scripts/main/create-ocaml-cache.sh +++ b/.github/scripts/main/create-ocaml-cache.sh @@ -9,17 +9,20 @@ OCAML_LOCAL="$4" PLATFORM="$5" if [[ $OCAML_BRANCH -gt 407 ]]; then - if [[ -n $GITHUB_BASE_REF ]]; then - git tag combak - git fetch origin $GITHUB_BASE_REF - git checkout origin/$GITHUB_BASE_REF - fi make -C src_ext dune-local.stamp cd src_ext/dune-local ocaml boot/bootstrap.ml cp _boot/dune.exe "$PREFIX/bin/dune$EXE" cd ../.. + git clean -dfX + + if [[ -n $GITHUB_BASE_REF ]]; then + git tag combak + git fetch origin $GITHUB_BASE_REF + git checkout origin/$GITHUB_BASE_REF + fi + ./configure --with-vendored-deps make cp -a _build "$OCAML_LOCAL/" diff --git a/.github/workflows/ci.ml b/.github/workflows/ci.ml index 2ea12514e59..27d6e738a37 100644 --- a/.github/workflows/ci.ml +++ b/.github/workflows/ci.ml @@ -128,7 +128,7 @@ let get_cache_cont : type s . s cache_name -> s = function | _ -> fun _ b -> b in let is_windows = if_windows true false in f {name = Printf.sprintf "OCaml %s" version; - key = Printf.sprintf "${{ runner.os }}%s-ocaml-%s-${{ %s.outputs.ocaml-cache }}-${{ %s.outputs.archives }}" (if_windows ("-" ^ host) "") version version; + key = Printf.sprintf "${{ runner.os }}%s-ocaml-%s-${{ %s.outputs.ocaml-cache }}" (if_windows ("-" ^ host) "") version; id = "ocaml-cache"; force_gzip = is_windows; paths = [if_windows {|D:\Cache\ocaml-local.tar|} "~/.cache/ocaml-local/**"]; @@ -488,7 +488,7 @@ let main oc : unit = ] in let keys = [ ("archives", "archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }}"); - ("ocaml-cache", "${{ hashFiles('.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }}"); + ("ocaml-cache", "${{ hashFiles('src_ext/Makefile.dune', '.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }}"); ("cygwin", "${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }}"); ("opam-bs-cache", "${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }}"); ] in diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a63bcb559d3..9ceba48dba7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,8 +58,8 @@ jobs: run: | echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} >> $GITHUB_OUTPUT - echo ocaml-cache=${{ hashFiles('.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }} - echo ocaml-cache=${{ hashFiles('.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }} >> $GITHUB_OUTPUT + echo ocaml-cache=${{ hashFiles('src_ext/Makefile.dune', '.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }} + echo ocaml-cache=${{ hashFiles('src_ext/Makefile.dune', '.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }} >> $GITHUB_OUTPUT echo cygwin=${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }} echo cygwin=${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }} >> $GITHUB_OUTPUT echo opam-bs-cache=${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }} @@ -127,7 +127,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -179,7 +179,7 @@ jobs: uses: ocaml-opam/cache@opam with: path: D:\Cache\ocaml-local.tar - key: ${{ runner.os }}-${{ matrix.host }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-${{ matrix.host }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} force-gzip: true - name: Unpack Cygwin shell: cmd @@ -245,7 +245,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -285,7 +285,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -339,7 +339,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -428,7 +428,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -474,7 +474,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -517,7 +517,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -548,7 +548,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} From c9962cdd52e9c178a41c6cd08aadb1064cd4a7b1 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 5 Mar 2024 15:16:13 +0000 Subject: [PATCH 4/8] Update src_ext/Makefile.dune The script only scanned src_ext/Makefile.sources. Trivial refactoring to scan and update packages in both files. --- master_changes.md | 1 + src_ext/update-sources.sh | 78 +++++++++++++++++++++------------------ 2 files changed, 43 insertions(+), 36 deletions(-) diff --git a/master_changes.md b/master_changes.md index 10ddce48939..f2f9708f7a1 100644 --- a/master_changes.md +++ b/master_changes.md @@ -88,6 +88,7 @@ users) ## Infrastructure * Fix depexts CI workflow and ensure all workflows run on master push [#5788 @dra27] + * Update src_ext/Makefile.dune along with src_ext/Makefile.sources [#5871 @dra27] ## Release scripts diff --git a/src_ext/update-sources.sh b/src_ext/update-sources.sh index 732d1d5205d..e95f3e3382e 100755 --- a/src_ext/update-sources.sh +++ b/src_ext/update-sources.sh @@ -1,46 +1,52 @@ #!/usr/bin/env bash -cd $(dirname $0) -echo -n "Checking packages for new versions in opam: " -DISAGREEMENTS=() -while read name prefix version url; do - package=$name - case "$package" in - findlib) package=ocamlfind;; - dune-local) package=dune;; - esac - latest=$(opam show $package -f all-versions | sed -e 's/ base//') - latest=${latest##* } - package_url=$(opam show $package.$latest -f url.src: | sed -e 's/"//g') - md5=$(sed -n -e "s/MD5$prefix$name *= *\(.*\)/\1/p" Makefile.sources) - package_md5=$(opam show $package.$latest -f url.checksum: | sed -n -e "/md5/s/.*md5=\([a-fA-F0-9]\{32\}\).*/\1/p") - if [[ -z $package_md5 ]] ; then - echo -e "\n$name: [\033[1;33mWARN\033[m] no md5 given in opam, downloading $package_url to check" - package_md5=$(curl -LSs $package_url | md5sum | cut -f1 -d' ') - fi - if [[ $package_url = $url ]] ; then - if [[ $package_md5 = $md5 ]] ; then - echo -ne "[\033[0;32m$name\033[m] " - if [[ $latest != $version ]] ; then - DISAGREEMENTS+=" $name ($version vs $latest in opam)" - fi - else - echo -e "\n$name: [\033[1;33mWARN\033[m] MD5 is wrong for (should be $package_md5 according to opam)" +function process +{ + while read name prefix version url; do + package=$name + case "$package" in + findlib) package=ocamlfind;; + dune-local) package=dune;; + esac + latest=$(opam show $package -f all-versions | sed -e 's/ base//') + latest=${latest##* } + package_url=$(opam show $package.$latest -f url.src: | sed -e 's/"//g') + md5=$(sed -n -e "s/MD5$prefix$name *= *\(.*\)/\1/p" "$1") + package_md5=$(opam show $package.$latest -f url.checksum: | sed -n -e "/md5/s/.*md5=\([a-fA-F0-9]\{32\}\).*/\1/p") + if [[ -z $package_md5 ]] ; then + echo -e "\n$name: [\033[1;33mWARN\033[m] no md5 given in opam, downloading $package_url to check" + package_md5=$(curl -LSs $package_url | md5sum | cut -f1 -d' ') fi - else - if [[ $package_md5 = $md5 ]] ; then - echo -e "\n$name: [\033[1;33mWARN\033[m] URL is wrong for $name (should be $package_url according to opam)" + if [[ $package_url = $url ]] ; then + if [[ $package_md5 = $md5 ]] ; then + echo -ne "[\033[0;32m$name\033[m] " + if [[ $latest != $version ]] ; then + DISAGREEMENTS+=" $name ($version vs $latest in opam)" + fi + else + echo -e "\n$name: [\033[1;33mWARN\033[m] MD5 is wrong for (should be $package_md5 according to opam)" + fi else - if [[ $latest = $version ]] ; then - echo -e "\n$name: [\033[1;33mWARN\033[m] URL and MD5 are wrong for $name (should be $package_url (md5=$package_md5) according to opam)" + if [[ $package_md5 = $md5 ]] ; then + echo -e "\n$name: [\033[1;33mWARN\033[m] URL is wrong for $name (should be $package_url according to opam)" else - echo -ne "[\033[0;31m$name\033[m: \033[1m$latest\033[m] " - sed -e "s/\(URL$prefix$name *= *\).*/\1${package_url////\\/}/" -e "s/\(MD5$prefix$name *= *\).*/\1$package_md5/" Makefile.sources > Makefile.sources.tmp - mv Makefile.sources.tmp Makefile.sources + if [[ $latest = $version ]] ; then + echo -e "\n$name: [\033[1;33mWARN\033[m] URL and MD5 are wrong for $name (should be $package_url (md5=$package_md5) according to opam)" + else + echo -ne "[\033[0;31m$name\033[m: \033[1m$latest\033[m] " + sed -e "s/\(URL$prefix$name *= *\).*/\1${package_url////\\/}/" -e "s/\(MD5$prefix$name *= *\).*/\1$package_md5/" "$1" > "$1.tmp" + mv "$1.tmp" "$1" + fi fi fi - fi -done < <(grep -F URL_ Makefile.sources | sed -e "s/URL\(_\(PKG_\)\?\)\([^ =]*\) *= *\(.*\/\(\([^0-9][^-]*\)*-\)\?v\?\)\([0-9.]\+\([-+.][^\/]*\)\?\)\(\.tbz\|\.tar\.gz\)/\3 \1 \7 \4\7\9/" | sort) + done < <(grep -F URL_ "$1" | sed -e "s/URL\(_\(PKG_\)\?\)\([^ =]*\) *= *\(.*\/\(\([^0-9][^-]*\)*-\)\?v\?\)\([0-9.]\+\([-+.][^\/]*\)\?\)\(\.tbz\|\.tar\.gz\)/\3 \1 \7 \4\7\9/" | sort) +} + +cd $(dirname $0) +echo -n "Checking packages for new versions in opam: " +DISAGREEMENTS=() +process Makefile.sources +process Makefile.dune echo -e "\nComplete." if [[ ${#DISAGREEMENTS[@]} -gt 0 ]] ; then echo "Disagreements over version:${DISAGREEMENTS[@]}" From 6d161df1a1c335f8a8f96e0c0e501115d6cad132 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 5 Mar 2024 15:23:46 +0000 Subject: [PATCH 5/8] Update src_ext dependencies --- src_ext/Makefile.sources | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src_ext/Makefile.sources b/src_ext/Makefile.sources index 75cf4cd32c6..7c343e325ef 100644 --- a/src_ext/Makefile.sources +++ b/src_ext/Makefile.sources @@ -13,8 +13,8 @@ MD5_base64 = bfdd16aa8c136412878109df8791fc01 $(call PKG_SAME,base64) -URL_re = https://github.com/ocaml/ocaml-re/releases/download/1.10.4/re-1.10.4.tbz -MD5_re = 68c427f8b55507f8b61c613ee6a5b3da +URL_re = https://github.com/ocaml/ocaml-re/releases/download/1.11.0/re-1.11.0.tbz +MD5_re = e0199e32947fd33fcc1b8e69de2308a1 $(call PKG_SAME,re) @@ -23,8 +23,8 @@ MD5_cmdliner = b860881cc90c68b703dca0f35bdd4cdb $(call PKG_SAME,cmdliner) -URL_ocamlgraph = https://github.com/backtracking/ocamlgraph/releases/download/2.0.0/ocamlgraph-2.0.0.tbz -MD5_ocamlgraph = 2d07fcf3501e1d4997c03fa94cea22f0 +URL_ocamlgraph = https://github.com/backtracking/ocamlgraph/releases/download/2.1.0/ocamlgraph-2.1.0.tbz +MD5_ocamlgraph = 4200d8f223aa7a32b4024e4553821c7c $(call PKG_SAME,ocamlgraph) @@ -53,8 +53,8 @@ MD5_0install-solver = 030edc9b1d3676c06d51397ffb5a737d $(call PKG_SAME,0install-solver) -URL_opam-file-format = https://github.com/ocaml/opam-file-format/archive/refs/tags/2.1.5.tar.gz -MD5_opam-file-format = 46dadff2565d8371cdc606d33d408fc4 +URL_opam-file-format = https://github.com/ocaml/opam-file-format/archive/refs/tags/2.1.6.tar.gz +MD5_opam-file-format = 706ce5fc3e77db746a4c8b11d79cefef $(call PKG_SAME,opam-file-format) From b65bd332147b9bfe08555b7bfbc03546df1fc1b7 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 5 Mar 2024 15:29:49 +0000 Subject: [PATCH 6/8] Missing .gitignore for swhid_core --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f6b6ed79d51..a7572e3fe90 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ src_ext/seq/ src_ext/sha/ src_ext/spdx_licenses/ src_ext/stdlib-shims/ +src_ext/swhid_core/ src_ext/topkg/ Opam.Runtime.*/ *.tar.bz2 From afa7fb214b669b0dea76fd0b7f981f28b727719a Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 5 Mar 2024 22:33:55 +0000 Subject: [PATCH 7/8] Fix recipes --- Makefile | 4 ++-- src_ext/Makefile | 6 +++--- src_ext/Makefile.packages | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index bd348316466..76fd1e18723 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ else endif ifeq ($(DUNE),) - DUNE_EXE = src_ext/dune-local/dune.exe + DUNE_EXE = src_ext/dune-local/_boot/dune.exe ifeq ($(shell command -v cygpath 2>/dev/null),) DUNE := $(DUNE_EXE) else @@ -48,7 +48,7 @@ else DUNE_PROFILE_ARG = --profile=$(DUNE_PROFILE) endif -src_ext/dune-local/dune.exe: src_ext/dune-local.stamp $(DUNE_SECONDARY) +src_ext/dune-local/_boot/dune.exe: src_ext/dune-local.stamp $(DUNE_SECONDARY) ifeq ($(DUNE_SECONDARY),) cd src_ext/dune-local && ocaml boot/bootstrap.ml else diff --git a/src_ext/Makefile b/src_ext/Makefile index bcb7ed1fbf6..9149517c4a7 100644 --- a/src_ext/Makefile +++ b/src_ext/Makefile @@ -102,7 +102,7 @@ reset-lib-pkg: @rm -rf ../bootstrap/ocaml/lib/ocaml/site-lib ../bootstrap/ocaml/etc *.pkgbuild ifeq ($(DUNE),) -DUNE_DEP=dune-local/_boot/install/default/bin/dune$(EXE) +DUNE_DEP=dune-local/_boot/dune$(EXE) DUNE_CLONE=dune-local.stamp ifeq ($(shell command -v cygpath 2>/dev/null),) DUNE:=$(DUNE_DEP) @@ -114,8 +114,8 @@ DUNE_DEP= DUNE_CLONE= endif -dune-local/_boot/install/default/bin/dune$(EXE): $(DUNE_CLONE) - cd dune-local && ocaml boot/bootstrap.ml && ./boot.exe --release +dune-local/_boot/dune$(EXE): $(DUNE_CLONE) + cd dune-local && ocaml boot/bootstrap.ml build-pkg: clone-pkg $(PKG_EXTS:=.pkgbuild) @ diff --git a/src_ext/Makefile.packages b/src_ext/Makefile.packages index 0ad553137bb..dac517e5c5f 100644 --- a/src_ext/Makefile.packages +++ b/src_ext/Makefile.packages @@ -116,7 +116,7 @@ dose3-pkg-build: dune-local-pkg-build: ocaml boot/bootstrap.ml - cp dune.exe $(OCAMLBIN)/dune$(EXT_EXE) + cp _boot/dune.exe $(OCAMLBIN)/dune$(EXT_EXE) mccs-pkg-build: stublibs dune build @install -p mccs From b2de4660965d4513849f06d7893a9612047e3658 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 5 Mar 2024 22:36:58 +0000 Subject: [PATCH 8/8] Test OCaml 5.1.1 --- .github/workflows/ci.ml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.ml b/.github/workflows/ci.ml index 27d6e738a37..c10a95b7864 100644 --- a/.github/workflows/ci.ml +++ b/.github/workflows/ci.ml @@ -15,7 +15,7 @@ open Lib 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.0"; "4.14.1"; + "4.08.1"; "4.09.1"; "4.10.2"; "4.11.2"; "4.12.1"; "4.13.1"; "5.0.0"; "5.1.1"; "4.14.1"; ] (* Entry point for the workflow. Workflows are specified as continuations where diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ceba48dba7..413f121d7c7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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.0, 4.14.1 ] + 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, 4.14.1 ] fail-fast: true steps: - name: Install bubblewrap