Skip to content

[pull] main from pnpm:main - #485

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

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

Conversation

@pull

@pull pull Bot commented Aug 6, 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 6, 2026 22:38
…#13686)

Stop retaining packument bodies in the install-scoped metadata cache
(Related to #13681).

Every consulted packument kept its entire JSON body resident for the
whole install: raw response fragments after a network fetch, or the
whole mirror-file buffer after a warm disk load. On the issue's
@teambit/bit repro that is 1.7 GB of JSON and the dominant share of the
3.18 GB resolution peak.

Version fragments now stay on disk behind the loaded mirror's held-open
file handle (FragmentSource::FileSpan) and are read on demand with a
positioned read; holding the handle pins the inode, so rename-based
mirror rewrites can never shift bytes under the recorded spans. Warm
loads parse only the header and index records. Cold fetches and
release-age upgrade persists return the just-persisted mirror in its
file-backed form so the response body drops at write time. The soft
RLIMIT_NOFILE is raised once toward the hard limit to cover the held
descriptors (one per consulted packument).

Every declared length in a mirror is treated as untrusted: the header,
index, and per-fragment spans are bounded and validated against the
real file size before any allocation. Held handles are counted against
a descriptor-budget cap sized from the post-raise soft limit; a load
past the cap buffers its fragments span by span (bounded by a
cumulative budget) and closes the file, so a full cache can never turn
File::open failures into cache misses elsewhere. An over-limit
fragment reads as an absent version on both the save and load sides,
keeping the persisted and served views agreeing.

Peak RSS on the repro: 3.18 GB -> 1.31 GB (warm offline resolve),
3.33 GB -> 1.86 GB (cold online resolve); a full cold install stays
under 2 GB, below the pnpm v10 baseline from the issue. Wall time is
unchanged (6-run A/B). The fixture's lockfile flips predate this change
(pre-existing arrival-order race, filed as #13685).
…13680)

Resolution never reads a patch. It appends the patch file's hash to an
already-resolved package id, so a `patchedDependencies` change leaves the
set of packages and versions untouched and moves only the affected keys.
Rewrite those keys and the references pointing at them instead of
re-resolving.

`packages:` is keyed without the patch hash, so only `snapshots:`, the
importers' resolved versions, and dependents' dependency references move.
The patched tarball is already in the store, so materialization applies
the patch with no network access, and the new depPath puts the package in
a fresh virtual-store slot so an install script reruns against the
patched sources.

Fall back to the resolver when the patched package is reachable as a peer
(its depPath is embedded in dependents' peer suffixes), when a peer suffix
was shortened into a hash and cannot be inspected, when the new
configuration would leave a patch unused while `allowUnusedPatches` is
off, and when a patch file cannot be read.

Implemented in both the TypeScript CLI and pacquet.

Related to #13474.
…not transport choices (#13684)

Hosted specs (github:/gitlab:/bitbucket: shortcuts and HTTPS/SSH URLs
of those hosts) now all resolve through the host's canonical HTTPS
URL. The lockfile records either the host archive tarball - only when
an anonymous HEAD of the exact archive URL succeeds, so a recorded
archive URL is fetchable by construction - or a git resolution over
the canonical HTTPS URL, which any machine with access to the repo can
fetch. SSH is never inferred: reaching a host over SSH is per-machine
git configuration (url.insteadOf), which pnpm honors by shelling out
to git.

This deletes the resolve-time transport probing (HTTP HEAD publicness
check plus https/ssh ls-remote reachability ladder) that could freeze
one machine's working transport into the lockfile and break every
environment configured differently - the #13276 bug class.
URLs of unknown hosts and URLs with embedded credentials keep their
exact URL and never resolve to a host archive.

parse_bare_specifier becomes fully synchronous and network-free; the
GitProbe seam shrinks to one method (anonymous_head_ok, with
transient-status retries) consumed by pick_resolution. Existing
lockfile entries are untouched - the new rules apply to fresh and
re-resolutions only, and both recorded shapes already exist in the
lockfile format.

Rust-only breaking change for the v12 lane; the TypeScript CLI stays
on the v11 probing behavior (fixed separately in #13290).

Related to #13276.
…t specs on CI (#13290)

Two flaws let a transient probe failure record an SSH URL for a spec
that never asked for SSH: the visibility HEAD probe ran once with
retries disabled and treated any failure as private, and the SSH
ls-remote probe ran before the anonymous HTTPS one. On a machine with
SSH keys, a throttled HEAD request resolved a public repo to
git@host:..., breaking later installs on keyless CI runners with
Permission denied (publickey).

The resolver now retries transient HEAD failures, probes anonymous
HTTPS git access before SSH for every representation except explicit
SSH URLs, falls back to HTTPS when every probe fails, and records the
host-archive tarball only for repos proven public - otherwise the
resolution stays type: git so ambient credentials apply.

TypeScript CLI only: pacquet resolves this bug class structurally via
the v12 identity redesign (#13684), which supersedes the
Rust-side commits this PR previously carried.

Closes #13276.

Co-authored-by: Zoltan Kochan <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
@pull pull Bot locked and limited conversation to collaborators Aug 6, 2026
@pull pull Bot added the ⤵️ pull label Aug 6, 2026
@pull
pull Bot merged commit 8ae2e28 into dwongdev:main Aug 6, 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.

2 participants