From d0942a158dbd10ca84d26d26f02fce632899c3ce Mon Sep 17 00:00:00 2001 From: Samuel Hym Date: Wed, 5 Nov 2025 20:55:43 +0100 Subject: [PATCH 1/2] Teach `x-ci-accept-failures` to Windows CI tests Handle `"msys2"` and `"cygwin"` values in the `x-ci-accept-failures` field to ignore installation failures on Windows CI, similarly to what is done for other platforms --- .github/workflows/windows.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 76180041eae..0f9c020a061 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -106,6 +106,7 @@ jobs: - name: Install packages env: ALL_CHANGED_PACKAGES: ${{ steps.changed-packages.outputs.data }} + WINDOWSENV: ${{ matrix.windows_env }} if: github.event_name != 'push' run: | $pkgs = $env:ALL_CHANGED_PACKAGES | ConvertFrom-Json @@ -119,7 +120,23 @@ jobs: 0 { Write-Host "`e[1;32m$pkg installed successfully`e[0m."; Break } 5 { Write-Host "$pkg is not installable. `e[1;33mSkip`e[0m."; Break } # TODO: Remove when https://github.com/ocaml/opam/issues/6017 is fixed 20 { Write-Host "$pkg is not installable. `e[1;33mSkip`e[0m."; Break } - 31 { Write-Host "`e[1;31m$pkg failed to build`e[0m."; $failed = $true; Break } + 31 { + $unexpected = $true + Foreach ($failpkg in Get-ChildItem -Path $env:OPAMROOT\default\.opam-switch\build -Name) { + if (opam show -f x-ci-accept-failures: "$failpkg" | Select-String -Pattern """$env:WINDOWSENV""" -SimpleMatch) { + $unexpected = $false + Write-Host "$failpkg failed to build but that was expected:" + Write-Host "its 'x-ci-accept-failures' field contains ""$env:WINDOWSENV"". `e[1;33mSkip`e[0m." + } else { + Write-Host "`e[1;31m$failpkg failed to build`e[0m." + } + } + Remove-Item -Path $env:OPAMROOT\default\.opam-switch\build -Recurse -Force + if ($unexpected) { + $failed = $true + } + Break + } default { throw "Unexpected error $_" } } Write-Host From 2ced00a9546735a5c80b43af9f8a8b815fc37cae Mon Sep 17 00:00:00 2001 From: Samuel Hym Date: Thu, 6 Nov 2025 12:49:37 +0100 Subject: [PATCH 2/2] DROPME Modify some conf-* packages to test the new Windows CI --- .../conf-aarch64-linux-gnu-gcc/conf-aarch64-linux-gnu-gcc.1/opam | 1 + .../conf-x86_64-linux-gnu-gcc/conf-x86_64-linux-gnu-gcc.1/opam | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/conf-aarch64-linux-gnu-gcc/conf-aarch64-linux-gnu-gcc.1/opam b/packages/conf-aarch64-linux-gnu-gcc/conf-aarch64-linux-gnu-gcc.1/opam index 9148d193878..3d06d759342 100644 --- a/packages/conf-aarch64-linux-gnu-gcc/conf-aarch64-linux-gnu-gcc.1/opam +++ b/packages/conf-aarch64-linux-gnu-gcc/conf-aarch64-linux-gnu-gcc.1/opam @@ -20,3 +20,4 @@ Please install aarch64-linux-gnu-gcc manually, as there is no known package for it for your distribution.""" {failure} x-maintenance-intent: ["(latest)"] +x-ci-accept-failures: ["cygwin" "msys2"] diff --git a/packages/conf-x86_64-linux-gnu-gcc/conf-x86_64-linux-gnu-gcc.1/opam b/packages/conf-x86_64-linux-gnu-gcc/conf-x86_64-linux-gnu-gcc.1/opam index 9f1b350206a..24fd3e240cf 100644 --- a/packages/conf-x86_64-linux-gnu-gcc/conf-x86_64-linux-gnu-gcc.1/opam +++ b/packages/conf-x86_64-linux-gnu-gcc/conf-x86_64-linux-gnu-gcc.1/opam @@ -20,3 +20,4 @@ Please install x86_64-linux-gnu-gcc manually, as there is no known package for it for your distribution.""" {failure} x-maintenance-intent: ["(latest)"] +x-ci-accept-failures: ["cygwintypo" "msys2"]