From 3a76006fbfb3ff31e53a6732764f5f7135cbb62f Mon Sep 17 00:00:00 2001 From: Gilson Urbano Date: Fri, 30 Oct 2026 10:29:21 +0000 Subject: [PATCH 1/5] Add darwin-arm64 prebuild --- .github/workflows/ci.yml | 20 +++++++++++++++++++- .github/workflows/release.yml | 2 +- binding.gyp | 3 +-- package-lock.json | 3 +++ test/binding.gyp | 2 +- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eaa0043f..0578c7e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,19 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel] + os: [ubuntu-latest, windows-latest, macos-15-intel] node-version: [20.x, 22.x, 24.x] arch: [x64] include: + - os: macos-latest + node-version: 20.x + arch: arm64 + - os: macos-latest + node-version: 22.x + arch: arm64 + - os: macos-latest + node-version: 24.x + arch: arm64 - os: windows-latest node-version: 20.x arch: x86 @@ -48,6 +57,15 @@ jobs: shell: bash run: npm run prebuild + # Consumers resolve node-addon-api from our semver range, not our lockfile, + # so also build against the newest release to catch header changes early. + - name: Build and test against latest node-addon-api + shell: bash + run: | + npm install --no-save node-addon-api@latest + npm run build + npm run test + test-mingw: name: Test MinGW (MSYS2 MINGW64) on Windows runs-on: windows-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce135909..034f324f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: - os: windows-latest arch: x86 - os: macos-latest - arch: x64 + arch: arm64 - os: macos-15-intel arch: x64 diff --git a/binding.gyp b/binding.gyp index d3fe2dbb..4f3c33dd 100644 --- a/binding.gyp +++ b/binding.gyp @@ -20,8 +20,7 @@ 'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', 'CLANG_CXX_LIBRARY': 'libc++', - 'MACOSX_DEPLOYMENT_TARGET': '10.7', - 'OTHER_CPLUSPLUSFLAGS' : [ '-std=c++11', '-stdlib=libc++' ], + 'MACOSX_DEPLOYMENT_TARGET': '10.15', }, 'msvs_settings': { 'VCCLCompilerTool': { 'ExceptionHandling': 1 }, diff --git a/package-lock.json b/package-lock.json index 7c6c557a..041a61c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,6 +60,7 @@ "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", @@ -708,6 +709,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.19", "caniuse-lite": "^1.0.30001751", @@ -3285,6 +3287,7 @@ "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, diff --git a/test/binding.gyp b/test/binding.gyp index 910c63a5..b19b7daa 100644 --- a/test/binding.gyp +++ b/test/binding.gyp @@ -16,7 +16,7 @@ 'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', 'CLANG_CXX_LIBRARY': 'libc++', - 'MACOSX_DEPLOYMENT_TARGET': '10.7', + 'MACOSX_DEPLOYMENT_TARGET': '10.15', }, 'msvs_settings': { 'VCCLCompilerTool': { 'ExceptionHandling': 1 }, From 419af3909311c00feacd81b088ea33d264ac5cbf Mon Sep 17 00:00:00 2001 From: Gilson Urbano Date: Fri, 30 Oct 2026 10:43:21 +0000 Subject: [PATCH 2/5] MSYS2 with UCRT64 --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0578c7e3..7cfb5424 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,22 +67,24 @@ jobs: npm run test test-mingw: - name: Test MinGW (MSYS2 MINGW64) on Windows + name: Test MinGW (MSYS2 UCRT64) on Windows runs-on: windows-latest steps: - name: Checkout code uses: actions/checkout@v6 - - name: Set up MSYS2 with MINGW64 + # MSYS2 no longer builds nodejs for the MINGW64 (msvcrt) environment; + # UCRT64 is its replacement and uses the same GCC/MinGW-w64 toolchain. + - name: Set up MSYS2 with UCRT64 uses: msys2/setup-msys2@v2 with: - msystem: MINGW64 + msystem: UCRT64 update: true install: >- - mingw-w64-x86_64-nodejs - mingw-w64-x86_64-python - mingw-w64-x86_64-gcc + mingw-w64-ucrt-x86_64-nodejs + mingw-w64-ucrt-x86_64-python + mingw-w64-ucrt-x86_64-gcc make - name: Verify MinGW Node.js is active From c37b5ccbf7568b9af5062b826ba2217500f17e22 Mon Sep 17 00:00:00 2001 From: Gilson Urbano Date: Fri, 30 Oct 2026 10:51:22 +0000 Subject: [PATCH 3/5] Fix node-gyp on UCRT64 --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cfb5424..08456380 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,7 +114,9 @@ jobs: shell: msys2 {0} run: | test ! -e node_modules/node-gyp || { echo "local node-gyp shadows the MSYS2 one"; exit 1; } - node-gyp --version + # The UCRT64 package only ships node-gyp.cmd in bin/, which bash can't run. + # Call the shim npm puts on PATH for lifecycle scripts instead. + "$MINGW_PREFIX/lib/node_modules/npm/bin/node-gyp-bin/node-gyp" --version - name: Build native tests shell: msys2 {0} From db7a2e8b78c6b758d299289b96fe61b41e5f6248 Mon Sep 17 00:00:00 2001 From: Gilson Urbano Date: Fri, 30 Oct 2026 10:56:02 +0000 Subject: [PATCH 4/5] Fix --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08456380..0c0905ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,9 +114,10 @@ jobs: shell: msys2 {0} run: | test ! -e node_modules/node-gyp || { echo "local node-gyp shadows the MSYS2 one"; exit 1; } - # The UCRT64 package only ships node-gyp.cmd in bin/, which bash can't run. - # Call the shim npm puts on PATH for lifecycle scripts instead. - "$MINGW_PREFIX/lib/node_modules/npm/bin/node-gyp-bin/node-gyp" --version + # The UCRT64 package only ships node-gyp.cmd in bin/, which bash can't run, and + # npm's node-gyp-bin shim only resolves correctly when npm sets + # $npm_config_node_gyp for a lifecycle script. Call npm's node-gyp directly. + node "$MINGW_PREFIX/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" --version - name: Build native tests shell: msys2 {0} From 60a46e09b31034f9f5e421674c2b300af3bb1765 Mon Sep 17 00:00:00 2001 From: Gilson Urbano Date: Fri, 30 Oct 2026 14:19:00 +0000 Subject: [PATCH 5/5] Bump version to 4.0.8 [skip ci] --- package-lock.json | 15 ++++++--------- package.json | 4 ++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 041a61c0..14fec916 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "@napi-ffi/ffi-napi", - "version": "4.0.7", + "version": "4.0.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@napi-ffi/ffi-napi", - "version": "4.0.7", + "version": "4.0.8", "hasInstallScript": true, "license": "MIT", "dependencies": { "@napi-ffi/get-uv-event-loop-napi-h": "^1.0.6", - "@napi-ffi/ref-napi": "^3.0.9", + "@napi-ffi/ref-napi": "^3.0.10", "@napi-ffi/ref-struct-di": "^1.1.1", "debug": "^4.3.7", "node-addon-api": "^8.2.1", @@ -60,7 +60,6 @@ "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", @@ -460,9 +459,9 @@ } }, "node_modules/@napi-ffi/ref-napi": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@napi-ffi/ref-napi/-/ref-napi-3.0.9.tgz", - "integrity": "sha512-6h5emFwa2DW6Jzah34CTeUvDQe+H9PCpxR/K27eaMIpr1Ye4ts8/KWWOzQHzRbykBnUCBavUGfhLmN1cELNjIw==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@napi-ffi/ref-napi/-/ref-napi-3.0.10.tgz", + "integrity": "sha512-4yjPiL7aPV5pyJhUKmVN8H7+bwcaOkYYN7DRqAmURfvn81k8TM35Z6gyvnxzGMaiMMO+nPa2t06EMnWWP0+VeA==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -709,7 +708,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.19", "caniuse-lite": "^1.0.30001751", @@ -3287,7 +3285,6 @@ "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, diff --git a/package.json b/package.json index d6bc91fc..ac5f4e0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@napi-ffi/ffi-napi", - "version": "4.0.7", + "version": "4.0.8", "license": "MIT", "author": "Anna Henningsen ", "contributors": [ @@ -33,7 +33,7 @@ "@napi-ffi/get-uv-event-loop-napi-h": "^1.0.6", "node-addon-api": "^8.2.1", "node-gyp-build": "^4.8.2", - "@napi-ffi/ref-napi": "^3.0.9", + "@napi-ffi/ref-napi": "^3.0.10", "@napi-ffi/ref-struct-di": "^1.1.1" }, "devDependencies": {