Skip to content

Commit

Permalink
fix: add support for Node.js v21 (#40)
Browse files Browse the repository at this point in the history
Requires a patch as outlined in nodejs/node#52475
  • Loading branch information
derevnjuk committed Apr 15, 2024
1 parent 02dc3c2 commit 50e025c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,22 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: build-artifacts
name: build-artifacts-${{ matrix.node_arch }}
path: prebuilds/
if-no-files-found: error

deploy:
merge:
runs-on: ubuntu-latest
needs: build
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: build-artifacts
pattern: build-artifacts-*

deploy:
needs: merge
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
},
"scripts": {
"semantic-release": "semantic-release",
"build:gyp": "prebuildify --strip --target 10.24.1 --target 12.22.12 --target 14.21.3 --target 16.20.2 --target 18.17.1 --target 19.9.0 --target 20.5.1",
"build:gyp-cross": "prebuildify-cross --strip --target 10.24.1 --target 12.22.12 --target 14.21.3 --target 16.20.2 --target 18.17.1 --target 19.9.0 --target 20.5.1",
"build:gyp": "prebuildify --strip --target 10.24.1 --target 12.22.12 --target 14.21.3 --target 16.20.2 --target 18.17.1 --target 19.9.0 --target 20.12.2 --target 21.7.3",
"build:gyp-cross": "prebuildify-cross --strip --target 10.24.1 --target 12.22.12 --target 14.21.3 --target 16.20.2 --target 18.17.1 --target 19.9.0 --target 20.12.2 --target 21.7.3",
"native_install": "node-gyp-build",
"install": "node scripts/install.js",
"prepare": "is-ci || husky install",
Expand Down
23 changes: 23 additions & 0 deletions patches/node-gyp-build+4.8.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/node_modules/node-gyp-build/bin.js b/node_modules/node-gyp-build/bin.js
index 3fbcdf0..5aacdf4 100755
--- a/node_modules/node-gyp-build/bin.js
+++ b/node_modules/node-gyp-build/bin.js
@@ -27,7 +27,7 @@ function build () {
]
} catch (_) {}

- proc.spawn(args[0], args.slice(1), { stdio: 'inherit' }).on('exit', function (code) {
+ proc.spawn(args[0], args.slice(1), { stdio: 'inherit', ...(os.platform() === 'win32' ? { shell: true, windowsVerbatimArguments: true } : {}) }).on('exit', function (code) {
if (code || !process.argv[3]) process.exit(code)
exec(process.argv[3]).on('exit', function (code) {
process.exit(code)
@@ -53,7 +53,8 @@ function exec (cmd) {

return proc.spawn(process.env.comspec || 'cmd.exe', ['/s', '/c', '"' + cmd + '"'], {
windowsVerbatimArguments: true,
- stdio: 'inherit'
+ stdio: 'inherit',
+ shell: true
})
}

4 changes: 2 additions & 2 deletions patches/prebuildify+6.0.0.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/prebuildify/index.js b/node_modules/prebuildify/index.js
index ca9829a..0ab2d39 100644
index ca9829a..ffbb682 100644
--- a/node_modules/prebuildify/index.js
+++ b/node_modules/prebuildify/index.js
@@ -230,7 +230,8 @@ function build (target, runtime, opts, cb) {
Expand All @@ -8,7 +8,7 @@ index ca9829a..0ab2d39 100644
env: opts.env,
- stdio: opts.quiet ? 'ignore' : 'inherit'
+ stdio: opts.quiet ? 'ignore' : 'inherit',
+ shell: opts.shell
+ shell: true
})

child.on('exit', function (code) {

0 comments on commit 50e025c

Please sign in to comment.