From c0ab11ab265fd6b5d285a0eee70df5cb2fa59525 Mon Sep 17 00:00:00 2001 From: Gilson Urbano Date: Mon, 3 Aug 2026 22:57:14 +0200 Subject: [PATCH] Verify the MinGW node-gyp fix in CI and guard against regressions The pinned node-gyp devDependency (added so the MSVC jobs can detect VS2026) shadows the MSYS2-patched node-gyp under MinGW, which makes node-gyp build with MSBuild/MASM instead of `-f make` and fails on libffi's GNU-syntax win64.S. The MinGW job already drops that pin, but the push trigger ignored `.github/**`, so that fix never actually ran. - Stop ignoring `.github/**` on push and add workflow_dispatch, so workflow-only changes are validated instead of silently skipped. - Assert no local node-gyp survives `npm install` in the MinGW job, so a regression fails immediately rather than as hundreds of A2044 errors. - Document why the pin removal must precede `npm install` and why this job cannot use `npm ci`. --- .github/workflows/ci.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f4babf7..eaa0043f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,9 @@ name: CI on: - push: - branches: [main] - paths-ignore: - - '.github/**' - - 'README.md' pull_request: branches: [main] + workflow_dispatch: jobs: test: @@ -83,12 +79,23 @@ jobs: # node-gyp shim, which is the one that knows to build with `-f make` (GCC) # instead of MSBuild/MASM, so native builds break under MinGW. Drop it here so # this job keeps using the MSYS2 toolchain's own node-gyp. + # + # This has to happen before `npm install`, because the `install` lifecycle + # script (node-gyp-build) already builds the addon. It also leaves package.json + # out of sync with package-lock.json, so this job must stay on `npm install` + # rather than `npm ci`. run: npm pkg delete devDependencies.node-gyp - name: Install dependencies shell: msys2 {0} run: npm install + - name: Assert MSYS2 node-gyp is in use + shell: msys2 {0} + run: | + test ! -e node_modules/node-gyp || { echo "local node-gyp shadows the MSYS2 one"; exit 1; } + node-gyp --version + - name: Build native tests shell: msys2 {0} run: npm run build