Skip to content

Commit 96da7c5

Browse files
authored
fix: pack node-gyp's gyp entrypoints as executable (#12652)
gyp's make generator execs gyp/gyp_main.py and gyp/gyp directly through their shebangs when it regenerates the Makefile during a from-source native build. They were missing from publishConfig.executableFiles, so they got packed at 0644 and the build failed with "Permission denied" (make error 126). #11485 fixed the node-gyp bin shims but not these two. Add them to PUBLISH_EXECUTABLE_FILES so the pnpm and `@pnpm/exe` tarballs pack them at 0755. Closes #12455
1 parent a33eeec commit 96da7c5

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@pnpm/exe": patch
3+
"pnpm": patch
4+
---
5+
6+
node-gyp's `gyp_main.py` and `gyp` entrypoints are now packed with the executable bit in the `pnpm` and `@pnpm/exe` tarballs. Without it, building native addons from source could fail with a permission error.

‎.meta-updater/src/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const PUBLISH_EXECUTABLE_FILES = [
2929
'./dist/node-gyp-bin/node-gyp',
3030
'./dist/node-gyp-bin/node-gyp.cmd',
3131
'./dist/node_modules/node-gyp/bin/node-gyp.js',
32+
'./dist/node_modules/node-gyp/gyp/gyp_main.py',
33+
'./dist/node_modules/node-gyp/gyp/gyp',
3234
]
3335

3436
// Packages whose tests spawn the local pnpm CLI binary (pnpm/bin/pnpm.mjs)

‎pnpm11/pnpm/artifacts/exe/package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@
8585
"executableFiles": [
8686
"./dist/node-gyp-bin/node-gyp",
8787
"./dist/node-gyp-bin/node-gyp.cmd",
88-
"./dist/node_modules/node-gyp/bin/node-gyp.js"
88+
"./dist/node_modules/node-gyp/bin/node-gyp.js",
89+
"./dist/node_modules/node-gyp/gyp/gyp_main.py",
90+
"./dist/node_modules/node-gyp/gyp/gyp"
8991
]
9092
}
9193
}

‎pnpm11/pnpm/package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@
196196
"executableFiles": [
197197
"./dist/node-gyp-bin/node-gyp",
198198
"./dist/node-gyp-bin/node-gyp.cmd",
199-
"./dist/node_modules/node-gyp/bin/node-gyp.js"
199+
"./dist/node_modules/node-gyp/bin/node-gyp.js",
200+
"./dist/node_modules/node-gyp/gyp/gyp_main.py",
201+
"./dist/node_modules/node-gyp/gyp/gyp"
200202
]
201203
}
202204
}

0 commit comments

Comments
 (0)