Repository navigation
[pull] main from pnpm:main - #514
Merged
Merged
Conversation
A resolve request carried the client's `minimumReleaseAge` and `trustPolicy` but not its `resolutionMode`, and `intern_config` never set `config.resolution_mode`, so every pnpr-delegated resolve ran on the server's `highest` default. A project configured for `time-based` or `lowest-direct` got a lockfile pinning the highest satisfying version of everything, with nothing to show that the setting had been dropped. The mode now travels with the request and reaches the interned config, which is what `PickPolicy::from_config` reads on the server side. It also joins both cache keys — the interned-config key and the resolution cache key — so two modes can neither share a config nor replay each other's resolution. `VerifyLockfileOptions` deliberately does not carry it: verification judges an existing lockfile against the client's policy and picks no version.
Both extraction inputs were materialized as contiguous in-memory buffers — the compressed body and the whole decompressed archive — and both were alive simultaneously during extraction, so a large package cost compressed + unpacked bytes of RAM per in-flight task (times the post-download concurrency of num_cpus * 2). Add a streaming extraction path and route to it after integrity verification when the compressed size is >= 16 MiB or the registry's dist.unpackedSize hint is >= 64 MiB (the untrusted hint only picks between two correct paths). The gzip decode (flate2, already a workspace dependency; zune-inflate has no streaming API) feeds the tar walk directly. Small entries batch up to 32 MiB and flush through the existing parallel CAS-write pool; entries above 4 MiB stream into the new StoreDir::write_cas_file_from_reader, which hashes incrementally into an exclusively-created temp file in <store>/files/ and atomically renames it to the content-addressed path. package.json is always buffered (bounded at 64 MiB) so the bundled manifest can be parsed. Batches flush before a streamed entry is written, preserving last-wins duplicate ordering, and decoder failures surface as ReadTarballEntries, which the retry classifier already treats as transient. Small tarballs keep the eager path unchanged: zune-inflate throughput, zero-copy payload slices, one parallel write phase. Supporting refactors: write_atomic's exclusive-temp open loop is now pnpm_fs::create_exclusive_temp_file; the shard-mkdir cache is shared via ensure_shard_dir; the eager extractor's path cleaning, manifest capture, parallel write phase, and output assembly are helpers shared with the streaming path. Rust-only: pure perf/memory change with no user-visible surface, so no TypeScript counterpart is required.
Reverts #13940, which flipped `enableGlobalVirtualStore` to `true` for pnpm 12. The shared virtual store goes back to being opt-in, matching the TypeScript CLI's default. The flip landed after `pacquet 12.0.0-rc.6`, so no release ever carried it. Its changeset is deleted rather than reworded — there is no user-facing change to describe. Most of the diff is the test-hermeticity tail #13940 grew: with the shared store on by default, every unit test that asserts a project-local layout had to pin the setting off, hence `crate::tests::project_local_config()` in `pnpm-package-manager`. With the default back to `false` the helper has no reason to exist and the pins go away with it. The e2e case asserting the shared store is the default in every environment is removed; the ones that exercise the shared store still opt in explicitly. Two pieces of #13940 are kept on purpose, because they stand on their own: - `Config::default()`'s `global_virtual_store_dir` still falls back to `<store-dir>/links` rather than `<cwd>/node_modules/.pnpm`. A `Config` that never went through `Config::current` pointing the *global* store at the working directory is wrong regardless of what the default is. - The `gvs-linker.fresh-restore.hot-cache.hot-store` benchmark scenario added in a6e8159 stays in CI. It now measures the opt-in layout instead of the default one, which is still worth a continuous gate. The doc comments are rewritten rather than restored: the pre-13940 text claimed pacquet has no `--global` flow, which stopped being true when global installs landed. No TypeScript-side change is needed. `@pnpm/config.reader` already defaults the setting off; its `true` assignment is scoped to `pnpm install --global`.
…3945) Adds `virtualStoreType: global | project`, the canonical spelling of `enableGlobalVirtualStore`. The boolean keeps working; when a source carries both, the canonical key wins. `enableGlobalVirtualStore` does not follow the convention that a setting sorts under what it modifies — it belongs with `virtualStoreDir`, `virtualStoreDirMaxLength`, and `virtualStoreOnly`, not under "enable". It also reads as a switch on one feature when what it selects is which of two stores an install materializes into: one per machine, keyed by dependency-graph hash, or one per project, keyed by the flat `<name>@<version>` form. Naming the axis leaves room for a third value later, which a boolean does not. It stays separate from `nodeLinker` rather than becoming a value of it: the two compose. `pnp` installs into either store type (pacquet has a test for pnp + the shared store), and `hoisted` writes no virtual store at all, so the setting is inert there rather than invalid. Superseding is silent, following the `cleanupUnusedCatalogs` -> `catalogPrune` rename rather than the `update` / `updateConfig` pair that warns: spelling a setting two ways is not itself a mistake. It also keeps the stacks observably identical, since pacquet's config layer has no user-visible warning channel. Both names are accepted from `pnpm-workspace.yaml`, the global config file, and the environment, and `pnpm config get` answers either one with the value the install will use — the spelling a source leaves out is derived from the one it sets. The default is untouched on both sides: the shared store stays opt-in. `VirtualStoreType` deliberately has no `Default` impl — nothing constructs it that way, and an unused default is free to drift from `default_enable_global_virtual_store` the next time that moves.
An install that had to re-hash store files to verify them now reports
it, in both stacks. Past a second of hashing it owns the time:
The integrity of 1234 files was checked in 2.5s.
Below that, past a thousand files, it drops the claim that the install
was held up — a thousand files is ~75 ms of hashing — and names the
cause instead:
The integrity of 1001 files was checked, because their timestamps
changed since the store recorded them. A backup tool, an antivirus
scan, or a copied store can cause this.
pnpm gated a single message on the file count alone
(`global.verifiedFileIntegrity > 1000`), and pacquet had no such
message at all.
The pnpm side had never actually run. All CAFS verification happens in
worker threads, so the counter was incremented in each worker's own
realm while the report read the main thread's copy, which never left
zero. Each worker now hands its share back with the response it is
answering, and the main thread sums them.
Measuring is free where it matters. Only a file whose mtime moved past
its recorded `checkedAt` is ever hashed, and that path already opens,
reads and SHA-512s the whole file; the clock reads and the tally sit
inside it, after the algorithm and open guards, so nothing is
attributed to hashing that did not hash.
The figures are per install: both stacks keep a process-wide tally and
each install snapshots it at the start and diffs at the end, which is
exact for one install at a time. A recursive command with dedicated
lockfiles runs its per-project loop at workspaceConcurrency, and
overlapping projects there can pick up each other's hashing; scoping
the tally with AsyncLocalStorage would fix that but costs the whole
process about five times on promise-heavy work under Node's
pre-AsyncContextFrame implementation, which pnpm's supported Node 22
and 23 still use.
The tally covers store verification only. pnpm's CAFS writer also
re-verifies a file it finds already present, but pacquet's writer
byte-compares against the buffer it already holds rather than hashing,
so counting it would make the two stacks report different numbers for
the same install.
) Canceling any of the prompts of `pnpm change` let the ExitPromptError that @inquirer/prompts throws reach the top-level error handler, which printed it as a failure with a stack trace. Every other interactive command catches that error name at its prompt. Handle it the way `update` does: report the cancellation and exit with a success status. The catch wraps recordChange, so it covers the package picker, both bump pickers and the summary input; `change status` does not prompt and stays outside it. The Rust port is unaffected: dialoguer reads keys through console's read_key, which re-raises SIGINT on Ctrl-c. Closes #13814.
Pass core.quotePath=false when patch-commit asks Git to diff the extracted and edited package directories. Otherwise Git C-quotes non-ASCII arguments in diff headers, preventing pnpm from normalizing and parsing its own generated patch. Mirror the option and regression coverage in the TypeScript CLI and the Rust pnpm port. Closes #13801.
…ncy (#13738) A bare-name/wildcard rule now consistently evaluates as matching every version regardless of ordering relative to version-pinned rules, resolving an inconsistency between the evaluator and the normalizer. This prevents unexpected behavior and silent widening of version policy exemptions when pnpm rewrites the workspace manifest. Fixes #13725
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )