fix(release): keep the bundled bins packable (#14135)
`dist/node_modules` is built by a `pnpm deploy --config.node-linker=hoisted`,
and the hoisted linker turns `preferSymlinkedExecutables` on, so
`dist/node_modules/.bin` became a directory of symlinks. An npm tarball cannot
carry a symlink, so those bins were dropped from the packed `pnpm` and
`@pnpm/exe` tarballs and the release workflow's artifact verification failed:
tar: package/dist/node_modules/.bin/node-gyp: Not found in archive
Force the deploy to write shell shims, which pack fine, restoring the layout
every release before 11.24.0 shipped.
This commit is contained in:
1 parent
e3cb54258c
commit
cef4816dfb
1 file changed
+11
-1
@@ -98,7 +98,17 @@ function createDistNodeModules () {
|
||||
'deploy',
|
||||
DEPLOY_DIR
|
||||
].join(' ')
|
||||
execSync(pnpmDeploy, { cwd: WORKSPACE_DIR, stdio: 'inherit' })
|
||||
execSync(pnpmDeploy, {
|
||||
cwd: WORKSPACE_DIR,
|
||||
stdio: 'inherit',
|
||||
// The hoisted node linker turns preferSymlinkedExecutables on, which makes
|
||||
// node_modules/.bin a directory of symlinks — and a symlink cannot travel
|
||||
// inside an npm tarball, so every bin would silently disappear from the
|
||||
// published dist/node_modules/.bin. Shell shims survive packing. Passed
|
||||
// through the environment rather than as `--config.` because the release-
|
||||
// pinned pnpm ignores that flag for this setting.
|
||||
env: { ...process.env, pnpm_config_prefer_symlinked_executables: 'false' },
|
||||
})
|
||||
|
||||
cleanupNodeModules(DEPLOY_DIR)
|
||||
|
||||
|
||||
Reference in new issue
Block a user