Repository navigation
[pull] main from pnpm:main - #503
Merged
Merged
Conversation
Break dependency cycles canonically during peer resolution: each strongly connected component's members sort by package id and every intra-SCC edge whose target is not canonically later is cut, the same cut at every occurrence. The SCC becomes a DAG: no walk path revisits a package, every peer verdict is a plain (package, context) function, and the lockfile is identical however the walk is ordered (Closes #13846, Closes #13865). A cut back-edge is still a real dependency edge: it is realized against a shared record-only occurrence of its target, walked once at importer context by the drivers, with peer-issue emission suppressed (every real position reports its own state). Back-edge targets nothing reaches forward are queued from the realized-children skip so they stay in the graph. The shared occurrences persist across peer-hoist discovery rounds. The #13859 cycle-truncation verdict keys had nothing left to scope and are deleted, as is the interim hoisted-region rule this branch previously carried. Single-importer bit fixture: 0.66 s / 0.60 GB / 9.6k walks vs main's 1.61 s / 0.82 GB / ~27k; 5-importer: 0.73 s / 0.61 GB vs 2.57 s / 0.92 GB; lockfiles 23-37% smaller and byte-identical across runs and orderings.
`updateWorkspaceManifest` compared the field's current value against the
new one with `equals(undefined, null)`, which is `false`, so clearing a
field the manifest never had still counted as a change. The manifest was
then empty, which takes the remove-the-file path, and `rm` ran against a
file that never existed:
pnpm config delete virtualStoreDir
ENOENT: no such file or directory, lstat '<dir>/pnpm-workspace.yaml'
Skip the field instead when there is nothing to clear. That also stops
`pnpm config set` from writing a file when the value it would set is
already there.
pacquet is unaffected: `remove_top_level_field` reports no change for an
absent key, and its removal path already tolerates a missing file. A
regression test pins that.
Closes #13651
Process workspace importers in project-id order in resolve_workspace and resolve_peers_workspace. Children-owner claims rank by importer position, hoist rounds run sequentially in list order, and shared canonical back-edge occurrences bind whichever importer's walk realizes them first — so the caller's listing order leaked into ownership, the first-walk missing scope, auto-install decisions, deprecation attribution, and cycle back-edge bindings (Closes #13846). Per-importer options are still built in the caller's order first, so positional options callbacks line up. A reversed packages listing of the 5-importer bit fixture now produces a byte-identical lockfile, and both bit fixtures are byte-identical to the unsorted resolver's output at unchanged speed and memory. Regression tests pin both levels; two tests that pinned a non-root importer walking before the root are re-pinned with their scenarios preserved.
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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 : )