Repository navigation
chore(fork): sync with upstream main 736ffe4 - #92
Conversation
The global rayon pool was sized at max(4, 2 x available_parallelism), which reaches 64 threads on a 32-core box. Past 16 threads the extra workers only add kernel time during linking. The pool is now clamped to 4..=16 threads. A warm-install sweep of the main build (nuxt, next, nitro fixtures) on Linux runners with 2-32 vCPUs, Windows runners with 4-16 vCPUs, a 12-core macOS runner and a local 10-core M1 Max found no host where the old default beat 16 threads. The 32-vCPU Linux runner kept its wall time and halved its system time. The 16-vCPU Windows runner got 10% faster. The M1 Max was unchanged at 16 but 19% slower at 8, which rules out a lower uniform ceiling. Non-frozen installs in projects with a pnpm-workspace.yaml still build the pool at 1x cores on the repeat-install fast path, before it is configured. Fixing that ordering is tracked separately, because on an 8-vCPU runner it slowed non-frozen fresh installs. Closes pnpm/tasks#51
…npm#16317) The verify-deps-before-run gate spawned an install whenever no workspace state file existed, even for projects that give an install nothing to do. That install only wrote node_modules and pnpm-lock.yaml, which became visible in directories the workspace packages patterns leave out after pnpm#15125. The gate now returns up to date when no state file exists and no project the install would cover declares a dependency, a required peer that autoInstallPeers would fetch, or an install lifecycle script (preinstall through postprepare, or an implicit binding.gyp build) that ignoreScripts does not disable. pnpm:devPreinstall counts only in the workspace root, the only place an install runs it. Under a shared lockfile every workspace project is checked, and the projects are walked only when the root manifest itself has nothing to install. With separate lockfiles a non-recursive run checks only its own project. A non-recursive pnpm 11 command gets no allProjects, so the gate reads the workspace itself, as checkDepsStatus does. A readPackage hook can add dependencies, so any pnpmfile the install would load (looked up from the lockfile directory) keeps the install. A workspace that cannot be read, or a lockfileDir pinned away from the project, also keeps it. Projects with lifecycle scripts still install on the first run, so those scripts keep running on first use. Closes pnpm#16313 --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…es (pnpm#16335) A lockfile key's peer suffix is hashed once it exceeds `peersSuffixMaxLength`. The locked peer pins read an explicit suffix in full, recursing into each segment's provider, so they include the peers a descendant resolved. A hashed suffix recovered only the package's own declared peers from its snapshot edges. When `dedupe_peer_dependents` collapses two variants of equal size, the dep-path tie-break can pick either spelling. The next run then pinned a different set of peers depending on which spelling it read, which changed the size of one variant and the winner of the collapse, so the lockfile alternated between two states and `pnpm dedupe --check` never passed. A hashed suffix now also recovers the peers listed in the snapshot's `transitivePeerDependencies`, read from the descendants that declare them, and recurses into each peer provider's own snapshot like an explicit suffix does. A visited set bounds the walk. Closes pnpm#16331
…t is the filesystem root (pnpm#16334) For a workspace with a shared lockfile, the recursive installer filters the selected importers with is-subdir against the calculated repository root. is-subdir 2.0.0 appends a path separator to the parent directory, so when the repository root is the filesystem root ("/" on POSIX, a drive root such as "C:\" on Windows) the parent becomes "//" or "C:\\" and no importer matches. The command then reported success without installing anything. Take the fix from is-subdir 2.0.1, which no longer appends a second separator to a filesystem root, so the importer filter matches projects under "/" or a drive root as-is. Closes pnpm#16328 --------- Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Global update candidates start with the installed group's manifest. Resolving plain registry dependencies by bare name keeps the saved range during the lockfile-only comparison and can make an available update look unchanged. Resolve those dependencies through the latest dist-tag. Preserve the source of non-registry dependencies and keep downgrade pins. Cover the saved-range case with a mocked-registry regression test. Closes pnpm#16320 --------- Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…space link (pnpm#16346) A frozen install rejected a freshly generated lockfile when an injected workspace package declared a peer dependency that the consuming project provides from the workspace. The lockfile snapshot records that peer as `link:<dir>`, and the freshness check re-tested every resolved peer against the declared range, which never matches a `link:` ref. The same test also failed for an unmet peer, which pnpm only warns about. The resolved peers are the parent's choice, so they do not indicate a stale lockfile. The check now compares only the declared peer ranges and `peerDependenciesMeta` with the ones recorded in the lockfile, which still catches every edit to the injected package's peers. pnpm v11 is not affected. Closes pnpm#16332 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…d install (pnpm#16324) After a filtered install, verifyDepsBeforeRun reported the dependencies as outdated whenever pnpm-lock.yaml had a newer mtime than lastValidatedTimestamp, even with unchanged contents. With the default install action, pnpm run then reinstalled every workspace project with lifecycle scripts on. A newer lockfile makes both stacks assert that the wanted lockfile equals the current lockfile in the virtual store. A filtered install only materializes the projects it selected, so its current lockfile leaves out everything else and the equality can never hold. When the workspace state records a filtered install, compare the current lockfile against what that install materialized: - pacquet compares it with the materialization closure of the wanted lockfile rooted at the importers the current lockfile lists. - pnpm v11 keeps every importer in the current lockfile, so it requires everything but packages to be equal and every recorded package to equal its wanted entry. A lockfile change that reaches an installed project still fails the check. The install fast path already refuses a filtered state, so only the run gate is affected. After a filtered install the gate also requires the selected projects that declare dependencies to be recorded in the current lockfile. A modules directory alone no longer counts as installed. pacquet requires an importer entry; pnpm v11, which keeps every importer, requires a package entry for each direct dependency that is not a link. Closes pnpm#16322 --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore(release): 11.28.2, pacquet 12.8.1 * docs(release): curate the 11.28.2 and 12.8.1 release notes Add the lead paragraph the previous release pages carry, order the pacquet entries by impact (failing installs and damaged files first, then wrong lockfiles, speed, and command behavior), lead the exec-bit entry with what the reader sees, and use the same issue-link style in every entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…5869) * chore: update dependencies, Node.js, pnpm, and GitHub Actions * chore: keep `@yarnpkg/core` at 4.9.1 `@yarnpkg/core@4.9.2` was published with a Yarn-only `patch:got@npm%3A11.8.2#~/.yarn/patches/...` dependency. pnpm locked it as a dangling `link:`, so `got` was never installed and `tsgo` failed on `@yarnpkg/core/lib/httpUtils.d.ts` in TS CI / Compile & Lint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: drop registry mirror URLs from the lockfile The previous commit regenerated the lockfile with a local scoped registry override, which wrote non-npmjs tarball URLs for `@pnpm/` packages and failed the supply-chain check in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
In a project with a pnpm-workspace.yaml, which covers workspaces and single projects that keep their settings there, the repeat-install fast path discovers workspace projects with rayon before configure_rayon_pool ran. That built the global pool at rayon's default of one thread per core, and build_global then failed silently. So non-frozen installs there ignored both the 2x sizing and the 16-thread ceiling. Frozen installs skip the fast path and were sized as intended. The pool is now configured before the fast path. Shell completion is checked first, since it never uses rayon. Debug builds assert that configure_rayon_pool built the pool, so the CLI e2e suite catches the next rayon use that runs ahead of it. Early materialization, which links packages while resolution is still running, now uses its own pool at one thread per core. On the global pool at 2x it competed with the resolver: the integrated benchmark's non-frozen fresh install against a local registry was slower in 8 of 8 runs with the reordering alone, and faster in 4 of 4 with this pool. Windows now uses one thread per core, still clamped to 4..=16. Warm frozen installs were 4-5% faster at 1x on 4- and 8-vCPU runners, and a fresh install of the benchmark fixture took 3.9 s at 1x and 4.5 s at 2x on a 4-vCPU runner. It was even on an 8-vCPU runner. Closes pnpm/tasks#52 perf(cli): size the rayon pool before the install fast path In a project with a pnpm-workspace.yaml, which covers workspaces and single projects that keep their settings there, the repeat-install fast path discovers workspace projects with rayon before configure_rayon_pool ran. That built the global pool at rayon's default of one thread per core, and build_global then failed silently. So non-frozen installs there ignored both the 2x sizing and the 16-thread ceiling. Frozen installs skip the fast path and were sized as intended. The pool is now configured before the fast path. Shell completion is checked first, since it never uses rayon. Debug builds assert that configure_rayon_pool built the pool, so the CLI e2e suite catches the next rayon use that runs ahead of it. Windows now uses one thread per core, still clamped to 4..=16. A fresh-install sweep (1x vs capped 2x, 11 rounds, nuxt and the 1352-package benchmark fixture, --offline with a warm store) found: - Linux 4 and 8 vCPUs: even. - Windows 8 vCPUs: even. Windows 4 vCPUs: the benchmark fixture took 3.9 s at 1x and 4.5 s at 2x. Earlier warm frozen sweeps also favoured 1x on Windows at every core count. - macOS: a 10-core M1 Max was 16% faster at 16 threads than at 10, a 12-core macOS runner 3-6% slower. 2x is what frozen installs already used there. Refs pnpm/tasks#52 * perf(package-manager): give early materialization its own one-per-core rayon pool * docs: scope the rayon changesets to what users see; soften the Windows claim * perf(package-manager): cap the early-link pool at the global pool size The early-link pool took one thread per core with no ceiling, so a 32-core machine got 32 workers, and it ignored a caller's RAYON_NUM_THREADS. It now takes one thread per core but never more than the global pool has, which carries both the CLI's 16-thread ceiling and the caller's override. The pool's doc now states its current purpose, and the ordering changeset leads with its effect. * docs(package-manager): say where the early import runs without its pool
…pnpm#16359) A lockfile key is the package id plus a peer suffix that spells out the keys of the peers it resolved. dedupe_peer_dependents runs after those keys are built. When it collapses a variant into a larger compatible one, it rewrites the edges that pointed at the collapsed variant but kept every other node's key. A node whose suffix named the collapsed variant stayed keyed after a variant that no longer exists. When the collapse left two variants with identical edges, the dep-path tie-break could also keep the one whose key spelled the collapsed peer. pnpm v12 reads locked peer versions back from those keys, so the next resolution started from the stale names and produced a different graph. `pnpm dedupe` therefore needed a second run to settle, and `pnpm dedupe --check` failed right after `pnpm dedupe`. After the collapse, every surviving node is now renamed from the peers it resolves to. The name is rebuilt from the peer ids the final depPath pass recorded for it, so a hashed suffix is hashed again and a `name@version` peer that closes a cycle is left alone. Only the provisional depPaths the walk nests in a suffix to break a cycle are read back from their text; a graph node without recorded peer ids, such as one whose tarball-URL id ends in parentheses, is never renamed. Keys, child edges, and importer direct deps are rewritten through the renames. Nodes renamed to one key merge the way the peer resolution merges records that share a depPath. The rename runs only when something collapsed, and peer ids are recorded only when this pass will read them. pnpm v11 shares the collapse-without-rename code but does not read peer pins back from lockfile keys, and it is not affected by the reported repro, so it is unchanged. Closes pnpm#16356
…npm#16360) In a project that pins another pnpm, both CLIs rejected an option they did not know before they switched to the pinned version. The option could belong to the pinned pnpm, so the command failed although the pinned pnpm supports it. pnpm v11 checked unknown options right after parsing, ahead of switchCliVersion. pnpm v12 let clap exit on an unknown argument before the pre-command dispatch. `pnpm --version` went through the switch, so it reported the pinned version while `pnpm install --auto-dedupe` failed in the global pnpm 11. pnpm v11 now strips the unknown options from the config it reads, runs the package manager handling, and reports them only when no switch happened. The env lockfile sync, the `pnpm fetch` prefetch, and the runtime checks are skipped for a command that is about to be rejected. pnpm v12 retries the pin dispatch from argv when clap reports an unknown argument. The argv scan reads the path flags and the install-family pin flags (`--frozen-lockfile`, `--offline`, `--prefer-offline`, `--lockfile-dir`) on both sides of the command name, since clap never relocated them, and treats `ci` as frozen. It gives up when an option no command declares comes before the command name, because its value could be mistaken for the command. Only a switch plan is acted on, so a rejected command records nothing in the lockfile. The config commands switch only for `--location project`, as they do for a parsed command line. Closes pnpm#16353
…s merge (pnpm#16361) With injectWorkspacePackages, an injected workspace copy can resolve an optional peer (such as supports-color for debug) from its consumer that the target project's own dependencies were walked without. The injected dedupe pass ran before peer-dependent dedupe, so it compared the injected children against the project's peer-free variants, found no match, and kept a peer-suffixed file: copy in importers. pnpm 11 records link: for the same workspace. Run peer-dependent dedupe first. It merges the peer-free variants into the ones carrying the optional peer, after which the injected copy's children equal the project's direct deps and the edge becomes link:. Both fixtures from the issue now produce the pnpm 11 importers. Closes pnpm#16354 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(deps): update undici to 7.29.1 The audit job fails on every pull request since GHSA-3wwx-pv8p-q78v was published against undici >=7.28.0 <7.29.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update .changeset/undici-7-29-1.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * docs(changeset): lead the undici note with what users see Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
--------- Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…scan (pnpm#16362) The unparsed scan kept the command name as typed, so the `c` alias slipped past the config-command exclusion, and the `ic`, `clean-install` and `install-clean` aliases of `ci` were not treated as frozen. The scan now resolves an alias to the command's own name through the clap grammar. `-g` inside a short cluster such as `add -gE` was not read as global, so the fallback could switch a global command to the project's pinned pnpm. `--global`, `-g` in a short cluster, and `--location` are now read in the unparsed scan itself, which steps over the values of declared options. A scope flag right after an undeclared option may be that option's value, so the scan declines and the rejection stands.
`pnpm install --frozen-lockfile` returned an existing Cargo.lock as it was and never compared it with the workspace manifests. A lockfile that no longer satisfied a dependency requirement in Cargo.toml passed the install, and `cargo --locked` rejected the same pair afterwards. Check every registry and git dependency of the workspace members against each member's dependency edges in Cargo.lock, and require every edge to be claimed by a declared dependency, before a frozen install continues, and fail with ERR_PNPM_OUTDATED_LOCKFILE, naming the crate, its requirement, and the locked versions. Sources are not compared, because a [patch] legitimately locks a dependency from another source. The check reads the metadata that workspace discovery already fetched, so a frozen install runs no additional `cargo metadata`. Closes pnpm#16355 --------- Co-authored-by: arturict <arturict@users.noreply.github.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Zoltan Kochan <z@kochan.io>
…A certificates (pnpm#16367) rustls-platform-verifier only fails on an empty system trust store when it gets no extra roots. With NODE_EXTRA_CA_CERTS set, the extra CA kept the platform client buildable on a system without CA certificates, so the bundled-roots fallback never ran and the client trusted only that CA. Registry requests then failed with UnknownIssuer. Build the platform client without the extra roots first, and fall back to the bundled roots (with the extra roots added) when that fails. Closes pnpm#16365
…pm#16382) A git-hosted dependency that pinned a pnpm version was always prepared by that version, provisioned through `pnpm dlx --package pnpm@<pin>`, even when the install ran with `pmOnFail=ignore`. On NixOS the downloaded generic Linux binary cannot start, and `pmOnFail=ignore` is the way to keep the nixpkgs build, so such dependencies could not be installed. The install's `pmOnFail` now reaches the fetcher through a new `RunningPnpm` group in `PrepareScriptOptions`. That struct holds the running pnpm's path and the setting, because the options struct is at the field limit. When the setting is anything but `download`, a dependency that wants pnpm gets a shim that runs the running pnpm directly. The setting is also passed to the nested install as `pnpm_config_pm_on_fail`, since a CLI flag does not otherwise reach it, and that install would switch to the pin on its own. pnpm v11 does not provision package managers for git-hosted dependencies, so only v12 is affected. Closes pnpm#16376 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…npm#16381) With injectWorkspacePackages: true, pnpm deploy failed with ERR_PNPM_DEPLOY_AMBIGUOUS_PEER when a workspace package lists its peer as a dev dependency too and the deployed graph holds a second version of that peer. dedupeInjectedDeps turns an injected workspace dependency into a link when the injected resolution's children are a subset of the target project's importer, dev dependencies included. A package whose peer is also its dev dependency therefore gets linked. Deploy synthesizes the snapshot of a linked workspace package from its importer's prod and optional dependencies only, so the peer binding was lost, and the singleton-peer binder then saw every version of the peer in the deployed graph. In an injected workspace, deploy now binds such a peer to the package's own dev-dependency resolution, which dedupe guaranteed is the resolution the injected snapshot would have carried. The binding is used only when the deployed graph contains that resolution. Only the dev dependencies that are also peers are converted, and one the conversion rejects (a link outside the workspace) is skipped, since it can never name a deployed snapshot. Neither fails the deploy. Non-injected workspaces keep the existing behavior, which picks what injection would choose rather than the linked package's dev dependency. Fixed in both the TypeScript CLI and pacquet. Closes pnpm#16375
The cross 0.2.5 ppc64le image uses binutils 2.26.1. It mislinks calls to optional libc functions absent from its sysroot: the published binary tests the dynamically resolved gettid address, then branches to an unmapped address instead of calling it. Let GCC retain its sysroot and library selection, but route its linker invocation to the LLD bundled with the pinned Rust toolchain. This fixes the weak-symbol calls without raising the glibc baseline or adding another linker download. Scope the setting to ppc64le. Smoke-test the actual release binary against a newer libc, where gettid is present. Testing only against the build sysroot misses the bug because Rust takes its syscall fallback there. Closes pnpm#16380.
…npm#16371) `path_value` took the first key of the environment map that matched `PATH` case-insensitively, and the lifecycle and `pnpm run` spawns dropped every such key before setting `PATH`. Environment names are case-sensitive outside Windows, so a `Path` variable is a variable of its own. When the environment held both `PATH` and `Path`, the map's random order decided which one a script got. A script that got `Path` could not find `node` and failed with exit code 127. `is_path_key` now matches `PATH` exactly outside Windows and keeps the case-insensitive match on Windows. The lookup and both spawns use it, so `Path` neither supplies `PATH` nor gets dropped. `set_command_path`, used by `pnpm exec` and the other CLI spawn sites, removes `Path` only on Windows, so a POSIX `Path` reaches those children too. Fixes pnpm#16308 --------- Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Shims fall back to the filtered PATH when command -p finds no helper, as in a Nix build sandbox. A helper comes from PATH only when PATH has it, because the bash 3.2 that macOS ships as sh answers command -p -v from PATH. Closes pnpm#16377
* docs: move website documentation into the pnpm repository * docs: keep v11 and v12 documentation beside their implementations * docs(pnpr): keep registry documentation beside its implementation * ci: classify product documentation as documentation changes * test: cover product documentation in Rust CI exclusions * ci: isolate documentation publishing and support manual sync * test: make dependency status fixture timestamps deterministic
Gate documentation publication on creation of a generated commit. An unchanged import exits the commit step successfully, but must also skip credential lookup and pushing. Emit changed=true after a successful commit and use it as the condition for the push step.
…npm#16345) Profiling a 331-importer, 5,000-package workspace resolution (perf and heaptrack on the micro-benchmark's --full-workspace-resolution runner) put 35 percent of the CPU time in the allocator and 13 percent in memcmp. Almost all of it came from copying immutable identity strings: the dependency walk cloned the whole ancestor-id Vec<String> for every node it seeded (7.5 million of the run's 42 million allocations), copied the package id into every DirectDep, tree node and children-owner claim, and the peer walk re-rendered each package's name and version on every visit and pushed a fresh String onto its ancestor chain per node. Every holder of a pkgIdWithPatchHash now shares the package table's own Arc<str>: ancestor chains are Arc<Vec<Arc<str>>>, DirectDep::id, PendingNodeIdentity::id and the provider index carry the shared id, register_seeded_package and register_reused_package hand it back, and the tree, children and owner maps clone the pointer where they used to re-allocate. ResolvedPackage gains name and version, rendered once by ResolvedPackage::new, and the peer walk reads them instead of calling pkg_name_version per visit; its chains and caches are keyed by the same Arc<str>. Content-based hashing and ordering are unchanged, so lockfile output is identical. ResolvedPackage's result, name and version are private and read through result(), name() and version(), so nothing can replace the resolution and leave the rendered pair stale; ResolvedPackage::new takes a ResolvedPackageInput with named fields. Measured on the same machine, idle, three runs each: the plain shape of the full-size scenario (the dependency walk alone) drops from 0.88 s to 0.45 s, the peer-heavy and hoist-heavy shapes by 12 percent, and the CI group workspace_resolution/hoist_heavy from 596 ms to 549 ms. A representation study on the fixture lockfile's keys (String, Arc<str>, string_cache atoms, smol_str) showed that a global interner would cost 2 to 3 times more on construction, 2 to 3 times more under concurrent construction and 5 to 6 times more on borrowed-text lookups, for an equality speedup the resolver does not need once its comparisons hit Arc's pointer-equality fast path. No new dependency is introduced. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QYTBQo8HY7xD2iz6hjo1CW
Port applicable documentation contributions from the website PR backlog to pnpm/docs and pnpm11/docs now that documentation lives alongside the CLI. Reconcile overlapping fixes and outdated paths against the current code. Keep documentation for unmerged features with the implementation PRs. The PR description credits each original author and records all 99 dispositions.
…oup (pnpm#16372) Without a terminal each script runs in a process group of its own, and after a relayed signal pnpm waits until kill(-pgid, 0) reports the group empty, reaping its own children with waitpid(-pgid, WNOHANG). A member that another process adopted stays in the group as a zombie until that process reaps it. When pnpm is a container's PID 1 and a script runs pnpm again, the relayed SIGTERM ends both shells of the nested run, the inner pnpm and the script become children of the outer pnpm, and only the outer pnpm can reap the script, while it reaps only its own group and waits for the inner one. Neither pnpm exits until the runtime sends SIGKILL. On Linux the wait now reads /proc, as the v11 runner already does, and ends once two readings in a row show the same members of the group, all of them zombies, since a member can start a process and exit while the table is read. The stat line is read as bytes and split after the last `)`, since the command may hold `)` or a character cut in half. A member that reads as a zombie but lists other threads under its task directory still counts, since its main thread exited while the rest run. Where /proc cannot tell, the wait keeps to the kernel's count: when /proc cannot be listed to the end, its self is not pnpm, as with an empty directory or another pid namespace's /proc, or it shows no member of the group, as under hidepid=invisible, and for a member whose stat cannot be read, which counts while getpgid puts it in the group. Entries are read newest first, so a script that is still shutting down is found within a few reads. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Zoltan Kochan <z@kochan.io>
…npm#16400) The site is now built with the pnpm.website components, which expect the docs sidebar to be an array of items. The v12 sidebar still used the Docusaurus shorthand object (label -> items), so convert each entry to an explicit category object. In both versions, list the Introduction pages (motivation, feature-comparison, installation) at the top level instead of nesting them in a category, matching the change made on pnpm.io. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…npm#16370) Level siblings resolving the same wanted key concurrently both missed the completed cache: the fetch locker coalesced the network, but each caller still repeated the resolver chain's remaining work and the manifest hook pipeline (pnpmfile is a JS bridge). Admit one caller per wanted key through a per-key lock; waiters re-check the completed cache after the holder finishes, so the hooks run once. The lock is never held across the map's own lock, and a cancelled holder releases it on drop, so the next caller retries cleanly. Covered by a barrier-started fan-in test: with a yielding resolver, two level siblings ask for the same key while the first is still resolving; the counting pnpmfile hook runs once with the lock and twice without it.
…npm#16657) When the platform package is missing, `bin/pnpm.mjs` downloads the native binary on first run. It only read `COREPACK_NPM_REGISTRY` and otherwise always used registry.npmjs.org, even when npm or pnpm was configured for a mirror (Closes pnpm#16655). Without `COREPACK_NPM_REGISTRY`, the registry now comes from the `pnpm_config_registry`/`npm_config_registry` environment variables and from the `@pnpm:registry` or `registry` setting of the project and user `.npmrc`, with the credentials those files hold for that registry. The credentials are only sent over HTTPS or to the local machine, and the Corepack credentials stay on Corepack's registry. The project `.npmrc` is read from the workspace root, without expanding `${VAR}` placeholders in registry settings or credentials. It is read only while the download is checked against npm's signature, which pins the bytes. With `COREPACK_INTEGRITY_KEYS` turning the check off, a repository could otherwise choose the binary that is cached next to the wrapper and run in every later project (GHSA-j2hc-m6cf-6jm8). --------- Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…dencies (pnpm#16670) Verifying locked config dependencies against the registry enforces minimumReleaseAge, but resolving them did not. A config dependency range therefore resolved to a version that a later clean frozen install rejected. Keep the age gate on verification, since a config dependency's pnpmfile runs on every install, and apply the same cutoff and minimumReleaseAgeExclude when resolving config dependencies and their optional subdependencies, in both the Rust and TypeScript CLIs. A version+integrity pin resolves without the cutoff, as verification already skips pins. Config dependencies are resolved before any updateConfig hook runs, so only an exclude in pnpm-workspace.yaml can cover one. Closes pnpm#16660 --------- Signed-off-by: C. Spencer Beggs <spencer@beggs.codes> Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…m#16667) * docs: explain how optional peers are resolved from the workspace The autoInstallPeers docs said only non-optional peers are installed. Both CLIs also resolve a missing optional peer to a version that already exists anywhere in the workspace, including another project's devDependencies, and they do it when either autoInstallPeers or dedupePeerDependents is on. Document that and how to turn it off. Related to https://github.com/orgs/pnpm/discussions/16666 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: say when a missing optional peer is installed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
catalogPrune dropped catalog entries that the lockfile left on disk still records when a workspace project was missing from disk: on v11 for installs that skip resolution (frozen, CI, lockfile up to date) and for remove, and on v12 for remove. The next frozen install then failed with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH. The prune now keeps those entries, except when `lockfile` is false. Fixes pnpm#16679 --------- Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ly in peerDependenciesMeta (pnpm#16682) The resolver treats a peerDependenciesMeta entry with optional: true and no peerDependencies entry as an optional "*" peer. The versions overrider only iterated peerDependencies, so a removal override never reached such a peer and a sibling workspace project could still satisfy it. Both overriders now also match each peerDependenciesMeta name that peerDependencies does not declare against the overrides as "*", and drop the meta entry when the chosen override is "-". In pacquet the apply_to_arc fast path checks the same entries, so the manifest is cloned and rewritten. The workspace regression tests from pnpm#15199 now also run against @pnpm.e2e/abc-optional-peers-meta-only. Fixes pnpm#16681 --------- Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…edicated lockfiles (pnpm#16684) The split-lockfile sync added in pnpm#15685 patches each injected copy from its source project after all selected projects are installed. It read the source directory with every file, while the install builds the copy from the package files only (the files field and .npmignore) unless deployAllFiles is set. So when the injected project was part of the same run, the copy picked up files such as tsconfig.json and the project's own pnpm-lock.yaml. The sync now reads the source with includeOnlyPackageFiles set to !deployAllFiles, as the install's directory fetch does. The target is still read in full, so files that an earlier sync added are removed. The sync after a project's own scripts with a shared lockfile keeps reading every file. Fixes pnpm#16683 --------- Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…6685) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
) * fix(hoist): remove each parent of stale workspace links once pruneStaleWorkspaceHoists cleaned up the empty parents of every stale workspace link in parallel. Links under one scope share the scope directory, so it was removed by several concurrent rmdir calls. On Windows, a removal of a directory whose delete is still pending fails with EPERM, which failed the install. The hoisted linker unlinks every workspace hoist before relinking, so any install that did not take the up-to-date fast path hit this. The cleanup now runs once per parent directory. A workspace alias has at most a scope directory above it, so distinct parents never overlap. Closes pnpm#16690 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(hoist): type the stale workspace link fixture keys Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…me (pnpm#16692) The shared-lockfile deploy built the deployed package.json dependency groups by iterating the lockfile importer's HashMap, and serialized allowBuilds into the deployed pnpm-workspace.yaml from a HashMap, so both came out in a different order on every run. Sort both by name, which matches the lockfile importer order that v11 writes. Closes pnpm#16687
…m#16694) When `pnpm run` or `pnpm exec` prints a script's output under the project's name (--stream, --parallel, concurrent recursive runs, pipeline tasks), the child's stdout is piped, so most tools turned their colors off. pnpm now sets FORCE_COLOR=1 for these children when its own output is in color through the default or append-only reporter, keeping a FORCE_COLOR that is already set. Colored child output exposed rendering bugs in the v12 reporter, fixed here: - cut_line counted escape bytes as visible characters and could split a color code. It now uses console::truncate_str. - Lines are split only on \n, so a \r progress bar reached the in-place frame with embedded carriage returns. printable_script_line keeps the last non-empty \r frame. - Cursor movement, OSC links and other control characters from a child are dropped by a small ECMA-48 escape parser (the locked console 0.16.3 iterator misses OSC and private-marker CSI). Only SGR sequences whose parameters are digits, ';' or ':' count as colors, and they are kept only when pnpm renders in color. A line that keeps a color ends with a reset so it cannot bleed into the next line or prefix. run_stage wrote the [ELIFECYCLE] line with eprintln! while the default reporter redrew its frame in place, so the next redraw moved the cursor over the wrong rows. A streamed run now emits it as an error-level pnpm log, which the reporter adds to the frame. An inherited run still writes it to stderr. The v11 reporter had the same cursor-code problem (a TODO in reportLifecycleScripts.ts). It now keeps only SGR sequences, using node:util stripVTControlCharacters for the rest, and appends the same reset. v11 already splits \r into separate lines, and FORCE_COLOR is a v12-only feature.
Code blocks that hold only shell commands now use the `sh` language, and blocks showing a file's contents carry a `title` naming the file, across the pnpm v12, pnpm v11, and pnpr docs. Bold file-name labels above code blocks are folded into the titles. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…m#16686) Five sites where the fallback argument of an Option or Result combinator contained a branch of its own. In each, the branch becomes a sibling arm of a match, so the value is read before the fallback and the nesting goes away. Two of them also stop doing work that was never needed. map_or and unwrap_or evaluate their default unconditionally, so a branching default was computed even when the option was Some: - napi/native_reporter.rs built a two-way Duration default on every call. - cli/pre_command/pin.rs ran a five-arm match even when pm_on_fail was set. Its two arms that produced the same value are now one, and PmOnFail is Copy, so the configured value is returned by value rather than cloned. The other three removed nesting only: - cli/pre_command/input/reporter_flags.rs and cli/audit/render.rs each held an if or a match inside an unwrap_or_else closure. The audit one also stopped cloning an Option wrapper to return the String inside it. - pnpr/resolver/wire/tarball_router.rs nested map_or_else inside another map_or_else's closure, so the failure arm preceded the success arm twice. An early return keeps the package name from being parsed when the basename is already present. A single flat match over a tuple would have changed the work done, so the remaining laziness is deliberate. An earlier revision of this branch also converted every default-first map_or_else call found by matching on a newline between the call and its first closure. That selector keys on where rustfmt put a line break, not on anything the code does: those calls nest nothing, evaluate nothing early and invert no logic, so its 41 hits were a survey rather than a work list. Twelve files are back at their base state, on four conditions where any single one disqualifies a site: - The rewrite has to invent a name whose only job is to be matched one line later, which moves a level out of the expression into the enclosing block instead of removing it. - The first closure diverges, so there is no default value to put second. unwrap_or_else and expect already read as "this must be Some". - The call sits in a macro's value position, where a match block is not a value, so the field ends up lines away from what fills it. - It is test code, read only when it fails, where churn costs review and git blame and returns nothing. No file under tests/ is modified. The conversions in the files that remain were reviewed individually and kept for reading better than what they replaced, rather than because they fix a defect. Laziness is held wherever it existed and no public signature changes, so the observable behaviour is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RNxMkLRG8CRDPwe5vcd28n
…ient setup (pnpm#16700) Centralize `normalize_registry_url` and `escaped_package_name` in `pnpm_network` and reuse them across `pnpm-config`, `pnpm-publish`, `pnpm-auth-commands`, and CLI subcommands (`access`, `audit`, `bugs`, `deprecate`, `dist-tag`, `login`, `logout`, `owner`, `repo`, `search`, `self-update`, `team`, `view`, and `config_overrides`). Reuse `build_registry_client_with_guard` and `build_registry_client` across CLI commands rather than duplicating `ThrottledClient::for_installs` construction. Reuse `pnpm_network::read_limited_body` and `body_display_string` in `team` and `access` registry error handling.
…pnpm#16698) QEMU user-mode emulation intercepts opening /proc/self/exe and returns a stale descriptor number that may already belong to another open file. When that number was tokio's epoll descriptor, libc detection read from it, got EINVAL, and closed it. The I/O driver's next epoll_wait then failed and pnpm panicked with "unexpected error when polling the I/O driver". Resolve the path with std::env::current_exe(), which QEMU emulates correctly, and open that instead. Closes pnpm#16696.
… body reading (pnpm#16703) Centralize origin-based redirect guard construction as origins_redirect_guard in pnpm_network, replacing duplicate implementations in client_builder.rs, owner.rs, and team/registry.rs. Add resolve_registries_with_override and build_registry_client_with_otp_guard to CLI registry_client, unifying registry URL resolution across subcommands (access, bugs, deprecate, dist_tag, owner, repo, stage, team, and view). Add read_sanitized_error_body to CLI sanitize to consolidate reading and sanitizing HTTP error response bodies with a configurable limit across access, owner, stage, star, and team.
…lose (pnpm#16708) A TLS-intercepting proxy can send a packument with neither Content-Length nor chunked framing and end it by closing the TCP connection without a close_notify alert. rustls reports that close as an UnexpectedEof error, so `pnpm view` and the resolver failed with ERR_PNPM_RESOLVING_NPM_RESOLVER_BODY_READ_ERROR. Node.js treats the close as the end of the body, which is why pnpm v11 works behind the same proxy. reqwest exposes no hook to wrap the connection stream, so the fix sits at the body read: `read_self_delimiting_text` keeps the bytes received before an unclean TLS close when the response has neither Content-Length nor chunked Transfer-Encoding. A framed body cut short by the close still fails, as in Node.js. The gzip decoder also polls the connection after the last member, so a complete gzipped body hit the same error. Decompression drops Content-Length, so a cut-short gzipped body is left to the packument JSON parse, and the resolver retries decode failures. Closes pnpm#16704
An install that misses the repeat-install fast path, such as one under `recursiveInstall: false` or with a `file:` dependency, re-imported the side-effects overlay into every project-local slot of a patched or built package and reran builds whose cache had nothing to restore. Only the global virtual store checked whether a slot already carried the overlay. The isolated linker now scopes the build phase the way the hoisted linker does: the snapshots this install materialized, plus those the previous install recorded as unbuilt in `.modules.yaml`. A rebuild or an `allowBuilds` change still considers every candidate. pnpm v11 already builds only new nodes on this path, so it is not affected. The check for an entry recorded as unbuilt moved into a shared helper, which also matches an `ignoredBuilds` key that carries a patch hash. Closes pnpm#16705
Upstream source, workflows and reviewer configuration (AGENTS.md, the review guide, .coderabbit.yaml, .pr_agent.toml) now match pnpm/pnpm main. Fork-only work is kept: the garnet-* workflows and scripts, .garnet/ and .github/garnet-gate/. Removed fork-only reviewer stack: REVIEW.md, the root REVIEW_GUIDE.md, the garnet-runtime-review skill, .greptile/, .github/copilot-instructions.md, and the fork edits to AGENTS.md, .pr_agent.toml and ci.yml. Remaining divergence from upstream: one line in the review guide, a CodeRabbit path instruction for the mirrored runtime record plus a fork-only auto_review base branch, and the bare-mention hook.
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
WalkthroughWarning Review details and warnings were omitted to fit the comment limit. |
|
Execution Profiles recorded for 1 job, triggered by
|
Micro-Benchmark ResultsLinux |
PR Summary by QodoSync fork with upstream main while preserving Garnet review gates
AI Description
Diagram
High-Level Assessment
Files changed (22)
|
Code Review by Qodo
1. Conflict resolution can run a pull request's code
|
| # Helper: regenerate lockfile without running lifecycle scripts | ||
| regenerate_lockfile() { | ||
| echo "Regenerating pnpm-lock.yaml..." | ||
| pnpm install --lockfile-only --no-frozen-lockfile --ignore-scripts |
There was a problem hiding this comment.
1. Conflict resolution can run a pull request's code 🐞 Bug ⛨ Security
regenerate_lockfile runs pnpm install with --ignore-scripts but not --ignore-pnpmfile, so pnpm can load a project-controlled pnpmfile. When a maintainer resolves a lockfile conflict on a pull request branch, that file can execute through Node with the maintainer's local access.
Agent Prompt
## Issue description
Lockfile regeneration can execute a pnpmfile supplied by the pull request despite `--ignore-scripts`.
## Fix Focus Areas
- .agents/skills/pull-requests/scripts/resolve-pr-conflicts.sh[281-285]
## Recommended Fix
Add `--ignore-pnpmfile` to the lockfile-regeneration invocation and test conflict handling with a malicious project pnpmfile present.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if has_submodules(self.path()).map_err(Arc::new)? { | ||
| checkout_submodules_with( | ||
| git_bin.unwrap_or_else(|| Path::new("git")), | ||
| self.path(), | ||
| ) |
There was a problem hiding this comment.
2. Git submodules can reach guarded addresses 🐞 Bug ⛨ Security
CachedSource::ensure_submodules invokes checkout_submodules_with without the guarded Git configuration used for the repository checkout. A Git dependency with a .gitmodules entry can therefore make the install-phase Git process resolve a submodule host again or follow an HTTP redirect without the address pinning and redirect restriction applied during resolution.
Agent Prompt
## Issue description
Submodule fetching does not carry the Git connection guard applied to the top-level repository.
## Fix Focus Areas
- pnpm/crates/git-fetcher/src/source_cache.rs[24-35]
- pnpm/crates/git-fetcher/src/fetcher.rs[350-356]
- pnpm/crates/resolving-git-resolver/src/pinned_remote.rs[5-18]
## Recommended Fix
Validate each submodule URL and its resolved addresses against the connection policy, disable unchecked redirects, and apply the resulting guarded configuration to recursive submodule fetches. Add a test with a disallowed submodule destination.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
Fork-only sync. This is a merge commit with two parents: fork
main(7243d0e) and upstreammain(736ffe4). Fork history is kept, with no force-push or reset. After the merge, the fork's source, workflows and reviewer setup match upstream (AGENTS.md,.agents/skills/review-code/references/REVIEW_GUIDE.md,.coderabbit.yaml,.pr_agent.toml,ci.yml, which already runsgarnet-org/actionv2.3.0).Exact divergence from upstream after merge (
git diff upstream/main HEAD):garnet-*workflows and scripts (including the mirror-only version from the last fork PR),.github/scripts/__fixtures__/,.github/garnet-gate/, and.garnet/.REVIEW_GUIDE.mdgains one line: "For changes to network, registry, config or build-script gates, read the Garnet comment for the head commit and name any added program or host, tied to the diff. Missing or incomplete evidence is not a pass.".coderabbit.yamlkeeps all of upstream's settings and adds apath_instructionsentry for network, registry, config and build-gate paths, telling CodeRabbit to read the mirrored record in the description and refuse stale or missing evidence. It also adds a fork-onlyauto_review.base_branchesfor the routing experiment base..husky/reject-bare-mentions.mjskeeps the fork's hook fix.Removed from the fork's own reviewer stack:
REVIEW.md, the rootREVIEW_GUIDE.mdand its references, thegarnet-runtime-reviewskill,.greptile/,.github/copilot-instructions.md, and the fork edits toAGENTS.md,.pr_agent.tomlandci.yml.The tree equals the reviewed twin branch plus the mirror-only change that landed on
main.Squash Commit Body
Checklist
Link to Devin session: https://app.devin.ai/sessions/b554fb265c3347cfb2b92892896f618d
Open in Devin Desktop: https://app.devin.ai/desktop/session/b554fb265c3347cfb2b92892896f618d?variant=devin
Requested by: @jadoonf
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Runtime evidence (Garnet)
Kernel-recorded execution record for head
b97c998(1 job, recorded 2026-10-07 20:46:06 UTC), copied from the sticky Garnet Runtime Review comment on this PR so reviewers that read only the description ground in the same bytes. The comment is the source: it gains jobs as they finish and this block follows it. Facts only. Judgment stays with the reviewer.Execution record, copied from the comment (1 job, recorded 2026-10-07 20:46:06 UTC)
Execution Profiles recorded for 1 job, triggered by
b97c998TS CI/test↗ · 27 destinationsView this job's Execution Profile in Garnet →
💡 How to read this
Runner.Worker ← process on a path └─ npm └─ node ← process that acted └─ ○ npmjs[.]org ← observed actionfollow a path downward to see what ran and what it did — each path to an observed action is an execution chain
names on the path = processes · ○ = observed action · (…) = context
Note
Medium Risk
Large merge touching CI workflows, review automation, and hundreds of pending release intents; incorrect fork-only deltas in CodeRabbit or conflict scripts could break PR/review loops without affecting end-user installs directly.
Overview
Fork merge that brings upstream
main(736ffe4) into the fork while keeping fork-only Garnet workflows and mirror machinery; the PR body calls out three intentional fork deltas on top of upstream (extraREVIEW_GUIDEline, scoped CodeRabbit Garnetpath_instructions, experimentauto_review.base_branches).Upstream changes in this sync reshape agent workflows: the standalone
garnet-runtime-reviewskill, rootREVIEW.md, Copilot/Greptile review docs are dropped in favor of.agents/skills/*(implement-change,pull-requests,review-code+REVIEW_GUIDE,testing-changes,release-notes,review-and-fix-pr), with.claude/skillssymlinked to.agents/skills. The git worktree PR hook now points agents at those skills instead of an inline prompt and the oldshell/resolve-pr-conflicts.sh.PR conflict handling moves to
.agents/skills/pull-requests/scripts/resolve-pr-conflicts.sh(rebase, lockfile regen, fork-safe push validation,--continue/--no-push) plus a large stub-based test suite;AGENTS.mddocuments the new path.Review bot config shifts CodeRabbit/Qodo to
.agents/skills/review-code/references/REVIEW_GUIDE.md, narrows full-runtime-evidence instructions to network/registry/config/build paths, and updates product-fit wording (PHILOSOPHY, compatibility, changeset prose rules).CI and tooling: cargo-nextest smoke profile and guard scripts; composite actions
install-cratesandwasm-toolchain; rust-cache workspace roots and lockfile hashing; integrated-benchmark compare/confirm scripts; Windows static CRT PE import gate; docs artifact copy helper; issue-form “working on a fix” parser..cargo/config.tomladds pnpm-vendored crate sources and target-specificrustflags.Product surface (bulk of the diff): many new
.changeset/*entries and composed changelog sections for pacquet/pnpm/pnpr (Cargo/Python resolution, pnpr OCI/multi-ecosystem, loaded linker, trust policy, deprecation output, and numerous install/registry fixes), plus GitHub issue templates routing feature ideas to Discussions.Reviewed by Cursor Bugbot for commit b97c998. Bugbot is set up for automated code reviews on this repo. Configure here.