Skip to content

fix(package-manager): honor scriptShell for lifecycle scripts - #13453

Merged
zkochan merged 2 commits into
mainfrom
script-shell-lifecycle
Jul 27, 2026
Merged

zkochan merged 2 commits into
mainfrom
script-shell-lifecycle

Conversation

@zkochan

@zkochan zkochan commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

Summary

scriptShell reached only pnpm run / pnpm exec (and pnpm version). Every lifecycle script the install spawns passed script_shell: None and so ran under the platform default — sh on POSIX, cmd on Windows — however the workspace had configured its shell. The TypeScript CLI threads scriptShell into the same runs through scriptsOpts, so a workspace whose scripts assume its configured shell worked there and silently did not here.

This threads config.script_shell to the three contexts that spawn scripts during an install:

context site
dependency build scripts build_modules.rs (via a new BuildModules::script_shell)
a project's own preinstall/install/postinstall/prepare install.rs run_projects_lifecycle_scripts
pnpm:devPreinstall install.rs run_dev_preinstall

Found while reviewing #13403, where a reviewer flagged the missing scriptShell on the new pnpm:devPreinstall call. It was not specific to that hook — every lifecycle call site had it — so it was left for its own change rather than fixed for one stage and not the rest.

Deliberately unchanged

Not every script_shell: None is a gap. These stay as they are because the TypeScript CLI does not pass scriptShell there either, and matching it is the whole point:

  • git-hosted dependency preparation (install_package_by_snapshot.rs, patch.rs) — the counterpart, exec/prepare-package, builds its RunLifecycleHookOptions with depPath / pkgRoot / rootModulesDir / unsafePerm / userAgent and no scriptShell.
  • pack and publish scripts — publish.ts binds runScriptsIfPresent with the same field set, likewise without it.

Changing those would be a unilateral divergence, not a fix.

Testing

The tests point scriptShell at a shell shim that appends every script it is handed to a log, then execs the real /bin/sh. A context that ignores the setting never appears in the log, so the test fails rather than silently passing on a default-shell fallback. I confirmed both tests fail with the three wirings reverted to None.

Unix-only (#[cfg(unix)]): the probe is a shell script, and select_shell already rejects .cmd / .bat shims on Windows.

Related to #12042, whose checklist marks scriptShell as done — accurate for pnpm run, which is presumably what was verified, but not for lifecycle scripts.

Squash Commit Body

`scriptShell` reached only `pnpm run` / `pnpm exec` (and `pnpm version`).
Every lifecycle script the install spawns passed `script_shell: None` and
so ran under the platform default, `sh` or `cmd`, however the workspace
had configured its shell. The TypeScript CLI threads `scriptShell` into
the same runs through `scriptsOpts`, so a workspace whose scripts assume
its configured shell worked there and not here.

Thread `config.script_shell` to the three contexts that spawn scripts
during an install: dependency build scripts, a project's own lifecycle
scripts, and `pnpm:devPreinstall`.

Deliberately unchanged, because the TypeScript CLI does not pass
`scriptShell` there either and matching it is the point:

- git-hosted dependency preparation (`install_package_by_snapshot`,
  `patch`), whose counterpart `exec/prepare-package` builds its
  `RunLifecycleHookOptions` without the field.
- `pack` and `publish` lifecycle scripts, likewise.

The tests spawn through a shell shim that records each script it is
handed, so a context that ignores the setting fails rather than silently
falling back to the default shell. Unix-only: the probe is a shell
script, and `select_shell` rejects `.cmd` / `.bat` shims on Windows.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • Updated the documentation if needed.

Written by an agent (Claude Code, claude-opus-5).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes

    • Honored configured scriptShell when running dependency build scripts and project lifecycle scripts during installation.
    • Lifecycle hooks (preinstall, install, postinstall, prepare, and pnpm:devPreinstall) now consistently use the selected shell.
  • Tests

    • Added Unix-only regression tests to verify scriptShell is applied beyond pnpm run, including for dependency build and lifecycle markers.

`scriptShell` reached only `pnpm run` / `pnpm exec` (and `pnpm version`).
Every lifecycle script the install spawns passed `script_shell: None` and
so ran under the platform default, `sh` or `cmd`, however the workspace
had configured its shell. The TypeScript CLI threads `scriptShell` into
the same runs through `scriptsOpts`, so a workspace whose scripts assume
its configured shell worked there and not here.

Thread `config.script_shell` to the three contexts that spawn scripts
during an install: dependency build scripts, a project's own lifecycle
scripts, and `pnpm:devPreinstall`.

Deliberately unchanged, because the TypeScript CLI does not pass
`scriptShell` there either and matching it is the point:

- git-hosted dependency preparation (`install_package_by_snapshot`,
  `patch`), whose counterpart `exec/prepare-package` builds its
  `RunLifecycleHookOptions` without the field.
- `pack` and `publish` lifecycle scripts, likewise.

The tests spawn through a shell shim that records each script it is
handed, so a context that ignores the setting fails rather than silently
falling back to the default shell. Unix-only: the probe is a shell
script, and `select_shell` rejects `.cmd` / `.bat` shims on Windows.
Copilot AI review requested due to automatic review settings July 27, 2026 23:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 694888fe-805b-41b3-8507-44abc29e25a3

📥 Commits

Reviewing files that changed from the base of the PR and between a698091 and 3a1ce34.

📒 Files selected for processing (1)
  • pnpm/crates/cli/tests/lifecycle_scripts.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm/crates/cli/tests/lifecycle_scripts.rs

📝 Walkthrough

Walkthrough

scriptShell is propagated to project lifecycle hooks and dependency build scripts during install. BuildModules carries the setting into postinstall execution, while Unix integration tests verify root and dependency script invocations.

Changes

Lifecycle script shell selection

Layer / File(s) Summary
Dependency build shell propagation
pnpm/crates/package-manager/src/build_modules.rs, pnpm/crates/package-manager/src/install_frozen_lockfile.rs, pnpm/crates/package-manager/src/build_modules/tests.rs
BuildModules accepts and forwards config.script_shell to dependency lifecycle execution, with existing struct literals updated to specify None.
Project lifecycle shell propagation
pnpm/crates/package-manager/src/install.rs
Root pnpm:devPreinstall and workspace lifecycle hooks receive the configured shell.
Shell selection regression coverage
pnpm/crates/cli/tests/lifecycle_scripts.rs, .changeset/script-shell-for-lifecycle-scripts.md
Unix tests verify configured-shell invocations for project and dependency scripts, and the changeset documents the expanded behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant WorkspaceConfig
  participant Install
  participant BuildModules
  participant RunPostinstallHooks
  participant LifecycleScripts
  WorkspaceConfig->>Install: configure scriptShell
  Install->>RunPostinstallHooks: pass configured shell for project hooks
  Install->>BuildModules: pass configured shell
  BuildModules->>RunPostinstallHooks: pass configured shell for dependency hooks
  RunPostinstallHooks->>LifecycleScripts: spawn lifecycle scripts with selected shell
Loading

Possibly related PRs

  • pnpm/pnpm#13403: Changes dispatch timing for the root pnpm:devPreinstall hook while this PR changes its shell selection.

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch script-shell-lifecycle

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Honor scriptShell for install-time lifecycle scripts

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Thread workspace scriptShell into install-time lifecycle script spawns.
• Apply scriptShell to dependency builds, project hooks, and pnpm:devPreinstall.
• Add Unix-only probe-shell tests to ensure all spawns honor configured shell.
Diagram

graph TD
  C[("scriptShell config")] --> I["Install flow"] --> H["RunPostinstallHooks"] --> S["select_shell()"] --> Sh["Lifecycle scripts"]
  C --> B["BuildModules"] --> H
  T["Unix probe tests"] --> I
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Centralize RunPostinstallHooks option construction
  • ➕ Reduces risk of future option fields (like scriptShell) being missed at new call sites
  • ➕ Makes install-time lifecycle spawning more uniform and easier to audit
  • ➖ More refactor churn in already-stable call paths
  • ➖ May complicate cases that intentionally diverge from TypeScript CLI behavior (e.g., pack/publish)

Recommendation: Current approach is correct and appropriately scoped: it fixes the install-time lifecycle gap without changing contexts where the upstream TypeScript CLI also omits scriptShell. For future-proofing, consider a follow-up refactor to centralize RunPostinstallHooks construction so new spawn sites can’t accidentally drop options like script_shell.

Files changed (6) +153 / -3

Bug fix (3) +12 / -3
build_modules.rsThread script_shell into dependency build lifecycle hook execution +9/-1

Thread script_shell into dependency build lifecycle hook execution

• Extends 'BuildModules' with a 'script_shell' field and passes it through to 'RunPostinstallHooks', ensuring dependency build lifecycle scripts respect workspace 'scriptShell' instead of always using the platform default shell.

pnpm/crates/package-manager/src/build_modules.rs

install.rsHonor scriptShell for project lifecycle scripts and pnpm:devPreinstall +2/-2

Honor scriptShell for project lifecycle scripts and pnpm:devPreinstall

• Sets 'script_shell' on 'RunPostinstallHooks' when running the root 'pnpm:devPreinstall' and when running workspace projects’ lifecycle scripts, aligning install-time script execution with 'pnpm run'/'pnpm exec' behavior.

pnpm/crates/package-manager/src/install.rs

install_frozen_lockfile.rsPass scriptShell into frozen-lockfile build phase +1/-0

Pass scriptShell into frozen-lockfile build phase

• Threads 'config.script_shell' into 'BuildModules' during the build phase so installs using the frozen-lockfile path still respect the configured shell for dependency build scripts.

pnpm/crates/package-manager/src/install_frozen_lockfile.rs

Tests (2) +136 / -0
lifecycle_scripts.rsAdd Unix-only regression tests ensuring scriptShell is honored during install +97/-0

Add Unix-only regression tests ensuring scriptShell is honored during install

• Adds a '#[cfg(unix)]' test module that installs a probe shell shim, sets 'scriptShell' in workspace YAML, and asserts that project lifecycle scripts, 'pnpm:devPreinstall', and dependency build scripts are invoked through the configured shell.

pnpm/crates/cli/tests/lifecycle_scripts.rs

tests.rsUpdate BuildModules test fixtures for new script_shell field +39/-0

Update BuildModules test fixtures for new script_shell field

• Adjusts 'BuildModules' struct initializations across tests to include 'script_shell: None', keeping existing unit tests compiling and behaviorally unchanged.

pnpm/crates/package-manager/src/build_modules/tests.rs

Documentation (1) +5 / -0
script-shell-for-lifecycle-scripts.mdAdd changeset documenting scriptShell behavior for lifecycle scripts +5/-0

Add changeset documenting scriptShell behavior for lifecycle scripts

• Introduces a patch changeset clarifying that 'scriptShell' now applies to install-spawned lifecycle scripts (dependency builds, project hooks, and 'pnpm:devPreinstall').

.changeset/script-shell-for-lifecycle-scripts.md

@greptile-apps

greptile-apps Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "test(cli): derive the probe shell's log ..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pnpm/crates/cli/tests/lifecycle_scripts.rs`:
- Line 2280: Update the generated shell script in the lifecycle script test to
stop interpolating the Rust-formatted log path into its contents. In the script
template around the `format!` call, derive the log destination at runtime from
the shim location (such as via `$0` and its parent directory), preserving
invocation logging without allowing temporary path contents to be interpreted as
shell syntax.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 15248099-16f6-4d6e-9367-c28f74a8c503

📥 Commits

Reviewing files that changed from the base of the PR and between 5534ee4 and a698091.

📒 Files selected for processing (6)
  • .changeset/script-shell-for-lifecycle-scripts.md
  • pnpm/crates/cli/tests/lifecycle_scripts.rs
  • pnpm/crates/package-manager/src/build_modules.rs
  • pnpm/crates/package-manager/src/build_modules/tests.rs
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/crates/package-manager/src/install_frozen_lockfile.rs

@qodo-code-review

qodo-code-review Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Remediation recommended

1. scriptShell PATH shadowing 🐞 Bug ⛨ Security
Description
With this PR, install-time lifecycle hooks now receive config.script_shell; if scriptShell is
configured as a bare name (no path separator), the executor spawns it after setting PATH to
prioritize <wd>/node_modules/.bin, so a same-named binary from dependencies can be selected as the
shell for lifecycle scripts during install (notably on Unix/POSIX). This can change which executable
interprets lifecycle scripts, enabling dependency influence over script execution beyond what users
expect from a “system shell” setting.
Code

pnpm/crates/package-manager/src/build_modules.rs[R1204-1208]

            unsafe_perm,
            node_gyp_bin: None,
            scripts_prepend_node_path,
-            script_shell: None,
+            script_shell,
            optional,
Relevance

⭐⭐ Medium

Team fixes config parity, but has some PATH-hijack concerns; may want extra validation for bare-name
shells.

PR-#13287
PR-#13403

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR wires config.script_shell into lifecycle hook options (previously None), and the executor
builds a PATH that explicitly prioritizes <wd>/node_modules/.bin before spawning the shell
program; spawning a bare-name shell therefore consults this dependency-influenced PATH.

pnpm/crates/package-manager/src/build_modules.rs[1189-1209]
pnpm/crates/package-manager/src/install.rs[3799-3814]
pnpm/crates/executor/src/lifecycle.rs[301-350]
pnpm/crates/executor/src/extend_path.rs[27-82]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Install-time lifecycle scripts now honor `scriptShell`, but if `scriptShell` is configured as a bare executable name (e.g. `bash`), the executor may resolve it via a PATH that has been extended to put `node_modules/.bin` first. This allows dependency-provided binaries to shadow the intended shell.

### Issue Context
`RunPostinstallHooks::script_shell` is now set from `config.script_shell` in install paths (build scripts, project lifecycle scripts, devPreinstall). In the executor, PATH is computed to prioritize `<wd>/node_modules/.bin` and then the shell is spawned via `Command::new(&shell.program)`.

### Fix Focus Areas
- pnpm/crates/package-manager/src/build_modules.rs[1192-1209]
- pnpm/crates/package-manager/src/install.rs[3799-3814]
- pnpm/crates/executor/src/lifecycle.rs[301-350]
- pnpm/crates/executor/src/extend_path.rs[27-82]

### Suggested fix
In `executor/src/lifecycle.rs`, when `opts.script_shell` is `Some` and the selected `shell.program` is not absolute / contains no path separators:
1. Resolve it against the *original/system PATH* (`original_path` captured before `extend_path`), not the extended PATH.
2. Use the resolved absolute path as `shell.program` (or return a clear error if it cannot be resolved).

This preserves `node_modules/.bin` for the script’s runtime PATH, while ensuring the shell executable itself isn’t chosen from dependency-controlled `.bin` directories unless the user explicitly sets a path (e.g. `./node_modules/.bin/custom-shell`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit 3a1ce34 ⚖️ Balanced

Results up to commit a698091 ⚖️ Balanced


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. scriptShell PATH shadowing 🐞 Bug ⛨ Security
Description
With this PR, install-time lifecycle hooks now receive config.script_shell; if scriptShell is
configured as a bare name (no path separator), the executor spawns it after setting PATH to
prioritize <wd>/node_modules/.bin, so a same-named binary from dependencies can be selected as the
shell for lifecycle scripts during install (notably on Unix/POSIX). This can change which executable
interprets lifecycle scripts, enabling dependency influence over script execution beyond what users
expect from a “system shell” setting.
Code

pnpm/crates/package-manager/src/build_modules.rs[R1204-1208]

            unsafe_perm,
            node_gyp_bin: None,
            scripts_prepend_node_path,
-            script_shell: None,
+            script_shell,
            optional,
Relevance

⭐⭐ Medium

Team fixes config parity, but has some PATH-hijack concerns; may want extra validation for bare-name
shells.

PR-#13287
PR-#13403

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR wires config.script_shell into lifecycle hook options (previously None), and the executor
builds a PATH that explicitly prioritizes <wd>/node_modules/.bin before spawning the shell
program; spawning a bare-name shell therefore consults this dependency-influenced PATH.

pnpm/crates/package-manager/src/build_modules.rs[1189-1209]
pnpm/crates/package-manager/src/install.rs[3799-3814]
pnpm/crates/executor/src/lifecycle.rs[301-350]
pnpm/crates/executor/src/extend_path.rs[27-82]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Install-time lifecycle scripts now honor `scriptShell`, but if `scriptShell` is configured as a bare executable name (e.g. `bash`), the executor may resolve it via a PATH that has been extended to put `node_modules/.bin` first. This allows dependency-provided binaries to shadow the intended shell.

### Issue Context
`RunPostinstallHooks::script_shell` is now set from `config.script_shell` in install paths (build scripts, project lifecycle scripts, devPreinstall). In the executor, PATH is computed to prioritize `<wd>/node_modules/.bin` and then the shell is spawned via `Command::new(&shell.program)`.

### Fix Focus Areas
- pnpm/crates/package-manager/src/build_modules.rs[1192-1209]
- pnpm/crates/package-manager/src/install.rs[3799-3814]
- pnpm/crates/executor/src/lifecycle.rs[301-350]
- pnpm/crates/executor/src/extend_path.rs[27-82]

### Suggested fix
In `executor/src/lifecycle.rs`, when `opts.script_shell` is `Some` and the selected `shell.program` is not absolute / contains no path separators:
1. Resolve it against the *original/system PATH* (`original_path` captured before `extend_path`), not the extended PATH.
2. Use the resolved absolute path as `shell.program` (or return a clear error if it cannot be resolved).

This preserves `node_modules/.bin` for the script’s runtime PATH, while ensuring the shell executable itself isn’t chosen from dependency-controlled `.bin` directories unless the user explicitly sets a path (e.g. `./node_modules/.bin/custom-shell`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@github-actions

github-actions Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.09     12.4±0.85ms    30.2 MB/sec    1.00     11.3±1.07ms    33.0 MB/sec
packument/parse                                  1.04     41.9±4.40µs  1583.9 MB/sec    1.00     40.4±1.53µs  1640.8 MB/sec
tarball/download_dependency                      1.36      3.8±0.65ms  1126.9 KB/sec    1.00      2.8±0.15ms  1537.2 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00   217.8±25.53ms 73.4 KElem/sec  

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@codecov-commenter

codecov-commenter commented Jul 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.65%. Comparing base (7a8b4d1) to head (3a1ce34).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13453      +/-   ##
==========================================
+ Coverage   87.60%   87.65%   +0.04%     
==========================================
  Files         545      545              
  Lines       93698    94124     +426     
==========================================
+ Hits        82085    82505     +420     
- Misses      11613    11619       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The shim had the log path interpolated into its body, so the temp
directory's name became `/bin/sh` source. Nothing generates a path with
shell metacharacters here — the name comes from `tempfile` — but a test
shim that parses part of its own path as code is a bad shape to leave
around.

Derive the path from `$0` instead, so the shim's body is a constant.
Copilot AI review requested due to automatic review settings July 27, 2026 23:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@zkochan

zkochan commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

On the scriptShell PATH-shadowing finding

Not changing this, because it is upstream pnpm's behavior and this PR is what makes pacquet match it.

@pnpm/npm-lifecycle, which the TypeScript CLI runs every lifecycle script through, does exactly the same thing:

let sh = 'sh'
let shFlag = '-c'

const customShell = opts.scriptShell

if (customShell) {
  sh = customShell
} else if (process.platform === 'win32') {
  sh = process.env.comspec || 'cmd'
  ...
}

It then spawns with the same env whose PATH leads with <wd>/node_modules/.bin. So a configured bare name is passed through verbatim there too.

Two things follow:

  1. This PR does not introduce the property. The default is already a bare name — sh on POSIX, cmd on Windows — resolved against that same PATH, in both stacks, today. A dependency able to shadow a bare-name scriptShell can already shadow the default sh. Blocking bare names for the configured shell only would close the narrower half of the hole while leaving the wider one open.

  2. Adding validation here would be a unilateral divergence. Rejecting or absolutizing a bare-name scriptShell in pacquet but not in the TypeScript CLI would break the behavioral-identity rule the two stacks are held to — a workspace whose scriptShell: bash works under pnpm 11 would fail under pnpm 12.

If pnpm does want to harden this — resolving scriptShell to an absolute path against the parent PATH before spawning looks like the right shape — it should be its own change landing in both stacks, and it should cover the default shell too, not just the configured one. Happy to open an issue for that if it's wanted.


Written by an agent (Claude Code, claude-opus-5).

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 27, 2026
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 3a1ce34

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants