Skip to content

[pull] main from pnpm:main - #490

Merged
pull[bot] merged 4 commits into
dwongdev:mainfrom
pnpm:main
Aug 9, 2026
Merged

pull[bot] merged 4 commits into
dwongdev:mainfrom
pnpm:main

Conversation

@pull

@pull pull Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

zkochan and others added 4 commits August 9, 2026 14:36
…tching (#13731)

Bins linked into the global bin dir (pnpm add -g, pnpm runtime set -g)
are written as context-aware shims that dispatch through a
protocol-versioned executable (.pnpm-shim-v1) installed next to them.
The dispatcher walks up from the invocation cwd; under the new
globalShims record's defaults ({ node: true, deno: true, bun: true },
merged key-wise across config layers with scalar false/true
shorthands), a stable Node.js pin in
devEngines.runtime / engines.runtime is resolved, authenticated with
the Node.js release-team signatures, materialized into the trusted
global virtual store (scripts and project dependency rewrites
disabled, package and executable required to canonicalize inside the
store), and executed — bare `node` follows the project's pin with no
shell hooks (closes #13735). Project node_modules/.bin is
never consulted for runtimes.

Entries for unsigned candidates — Deno, Bun, Node.js prereleases, and
any ordinary package the user enables (e.g. typescript: true) — are
gated by provider-name validation and a candidate-bound trust prompt
whose machine-local approvals are tied to the provider manifest,
canonical target, shim contents, and file identity. The record values
name the policy per package: "auto" (shorthand true) defers to
artifact authentication, "always" switches without ever asking,
"prompt" always asks even for authenticated candidates.
globalShims: false dispatches nothing; PNPM_SHIM_BYPASS=1 is a one-invocation
bypass and the dispatcher's recursion guard. The mode is read only from the env override, the
pnpm home's own pnpm-workspace.yaml, and the global config.yaml —
never a discovered ancestor — and takes effect without relinking.

The runtime materialization anchors its configuration in pnpm's state
dir (machine-local sources only, host-native artifacts only) so a
repository cannot redirect the store or mirrors feeding the dispatched
executable; musl hosts stay behind the trust prompt because their
assets are not publisher-signed. Manifest-controlled bin names are
escaped in every dispatch line, batch targets spawn through the
standard library's escaping, project-local lookup rejects .exe
candidates, and the test-only trust escape is debug-builds-only.

On Windows the global node.exe is the native dispatcher itself, with
the managed executable recorded as its direct fallback so shell-less
spawns of node.exe keep working. Fallback paths re-enter the
generated shim with the bypass set so the shell's own shebang
handling performs the direct execution, degrading to the embedded
target when the shim itself cannot be started.

Rust-only by design: this ships in pnpm v12's breaking-change
surface; the TypeScript CLI does not mirror it.
The managed runtime dispatcher read the entire pnpm executable to detect libc on every invocation. Since the bundled executable is tens of megabytes, this dominated otherwise warm runtime dispatch.

Detect libc by opening /proc/self/exe and seeking only to the bounded ELF header, program-header table, and PT_INTERP value. Preserve the existing filesystem and command fallbacks for malformed or unsupported ELF layouts.

Do not add persistent launcher state: every managed runtime invocation continues through the existing materialization path and reloads current trusted configuration. This brings warm runtime dispatch close to direct process startup without introducing cache invalidation or a new executable-path trust surface.

Related to #13731.
…ndalone executable (#13732)

`pnpm setup` writes a package.json next to a standalone executable whose
directory has none — the tarball that https://get.pnpm.io/install.sh
downloads — so the global install has a package to install. That
manifest omitted `"type": "module"`, so Node.js reparsed the ESM files
shipped beside the executable (`dist/worker.js`) as CommonJS first and
printed a MODULE_TYPELESS_PACKAGE_JSON warning on every spawn.

The published `@pnpm/exe` manifest already declares the module type, so
this only affected installs made through the standalone script.

Fixed in both stacks. The manifest construction moves into
`standaloneManifest` / `standalone_manifest`, so it can be asserted
without running the global install the surrounding function performs.
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators Aug 9, 2026
@pull pull Bot added the ⤵️ pull label Aug 9, 2026
@pull
pull Bot merged commit 8adb97e into dwongdev:main Aug 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant