Repository navigation
[pull] main from pnpm:main - #481
Merged
Merged
Conversation
…13661) Split the 1899-line `optimistic_repeat_install.rs` into per-subject probe modules (`manifest_agreement`, `settings`, `deps_status`, `local_file_deps`, `timestamps`, `conflict_markers`), leaving the decision itself at 601 lines. Pure code motion; the crate's public surface is unchanged.
…#13658) Materialize linked snapshot dependencies inside pacquet's virtual-store slots so packages remain self-contained when those slots live outside the project. Model each resolved link target as a leaf in the TypeScript and Rust dependency graphs. This makes a changed link target affect the recursively computed slot hash of every ancestor while allowing projects that resolve to the same target to keep sharing a slot. Keep the graph extension limited to global-virtual-store hashing so side-effects-cache keys retain their existing behavior. Thread optional-dependency selection through pacquet's slot materialization and inspect warm slots before reuse. This removes stale optional links under --no-optional and restores them when optional dependencies are enabled again. Preserve transitive optional dependencies during partial installs, where a narrowed direct dependency-group selection does not express --no-optional intent. Pin the normalization contract with a fixture consumed by both stacks, covering empty targets, parent segments, and Windows drive-letter casing and asserting the final slot hash as well as each synthetic node. Treat missing, dangling, and non-directory expected optional children as a reuse mismatch, detect dangling unexpected entries too, and surface other metadata errors. Run optional-child scans only after the slot passes the cheaper existence and integrity checks.
Split the 1617-line `build_modules.rs` into `allow_build_policy` (build-script permission and dep-path key parsing), `build_one_snapshot` (a single package's build), and `slots` (virtual-store slot location and repair), leaving orchestration in the root at 590 lines. Pure code motion.
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…13495) pnpm keeps global packages and configuration in the invoking user's home directory, so 'sudo pnpm add -g', 'sudo pnpm setup', and 'sudo pnpm self-update' never do what the user wants: they target root's home and leave root-owned files behind. Other package managers settled on the same direction - npm 9 removed its SUDO_UID chown machinery (npm/cli#5710) and tells users not to use sudo, and Homebrew refuses root outright. Both stacks detect the same situation: effective uid 0, SUDO_USER naming a non-root user, and a command that mutates home-directory state - setup, self-update, or a global write (add, remove, update, runtime, approve-builds, bare link, config set/delete resolving to the global scope). They differ only in severity, because refusing these commands is a breaking change: pnpm v11 warns and names the v12 removal, so existing provisioning scripts keep working, while pacquet (v12) fails with ERR_PNPM_SUDO_NOT_SUPPORTED. Read-only global commands (bin, root, prefix, list, outdated, config get, ...) still work, and plain root sessions without SUDO_USER are unaffected. The TypeScript check lives in pnpm11/pnpm/src/checkSudo.ts and runs once the reporter is initialized, so the warning is not published to a bus nobody is subscribed to yet. The pacquet check lives in crates/cli/src/cli_args/sudo_guard.rs and runs before the pre-command package-manager switch, so pnpm never delegates to a downloaded CLI as root either. Related to #13096.
… it is linkable (#13536) `dirsAreEqual` compared the result of `path.relative()` with `'.'`, but Node returns `''` for equal paths, so both equality checks in `storePathRelativeToHome` were always false. The dead branch would have placed the store in the home directory whenever the project folder was the only linkable location. Executing that branch would be the wrong trade. It fires exactly when no ancestor of the project accepts a hard link — an agent sandbox that grants write access only to the project, or a container with just the project bind-mounted writable. There the home store is either read-only, so the install fails outright, or on another volume, so every package is copied instead of hard linked and nothing is ever reused. A store on the project's own volume is the better answer in both cases, so the branch is removed rather than repaired, and the surviving root guard drops the helper for a plain string comparison of two `path.join` results. pacquet implemented the intended-but-dead branch, so it inherited both failure modes; it now keeps the store in the project too. It places the store at `<project>/node_modules/.pnpm-store` instead of pnpm 11's `<project>/.pnpm-store`, which keeps it out of the working tree's VCS status. The install purge already skips hidden entries other than `.bin`, `.modules.yaml`, and the virtual store dir, so a layout change cannot wipe the store; `test_install_purges_node_modules_on_layout_mismatch` now pins that. Closes #13525
) `resolveDependency` derived `filter_metadata` from `full_metadata`, so a caller asking for full metadata got a manifest run through `clear_meta` — reduced to npm's abbreviated version fields. Registry-custom fields were dropped, which broke Bit's `componentId` lookups ("the package.json of version X has no componentId field"). The API this replaces, `createClient({ fullMetadata: true })`, leaves `filterMetadata` unset and keeps the document whole; only the install path pairs the two flags, where nothing outside the abbreviated set is read. Untangle them here.
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 : )