From 02a1aec6cacf1385940faf2549157b3e1a968a5b Mon Sep 17 00:00:00 2001 From: Lev Nachmanson <5377127+levnach@users.noreply.github.com> Date: Tue, 7 Jul 2026 10:19:50 -0700 Subject: [PATCH] ci: fix macOS opam stale-cache patch error by removing manual ~/.opam cache The manual actions/cache step for ~/.opam was causing OpamSystem.Internal_patch_error on macOS when a restore-key hit returned a stale opam repo state incompatible with the current upstream. ocaml/setup-ocaml@v3 has built-in cache management that handles this correctly, so the manual step is removed. --- .github/workflows/ocaml.yaml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ocaml.yaml b/.github/workflows/ocaml.yaml index ce575ba646..243a342268 100644 --- a/.github/workflows/ocaml.yaml +++ b/.github/workflows/ocaml.yaml @@ -28,21 +28,13 @@ jobs: restore-keys: | ${{ runner.os }}-ccache- - # Cache opam (compiler + packages) - - name: Cache opam - uses: actions/cache@v6.1.0 - with: - path: ~/.opam - key: ${{ runner.os }}-opam-${{ matrix.ocaml-version }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-opam-${{ matrix.ocaml-version }}- - - # Setup OCaml via action + # Setup OCaml via action (handles opam caching internally) - uses: ocaml/setup-ocaml@v3 with: ocaml-compiler: ${{ matrix.ocaml-version }} opam-disable-sandboxing: true - + cache-prefix: v1 + # Platform-specific dependencies - name: Install system dependencies (Ubuntu) if: matrix.os == 'ubuntu-latest' @@ -123,4 +115,4 @@ jobs: - name: Run ml_example (native) run: | export DYLD_LIBRARY_PATH=$(pwd)/build - ./ml_example \ No newline at end of file + ./ml_example