Skip to content

fix(pacquet-cli): install exe wrapper for with downgrades - #12820

Merged
zkochan merged 5 commits into
mainfrom
pq-with
Jul 6, 2026
Merged

zkochan merged 5 commits into
mainfrom
pq-with

Conversation

@zkochan

@zkochan zkochan commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes the Rust pacquet with downgrade path so it selects the right package layout for the resolved pnpm version:

  • JS-only pnpm for versions before @pnpm/exe existed.
  • Native @pnpm/exe for 6.17.1 through v11, using the legacy platform artifact names like @pnpm/macos-arm64.
  • Native unscoped pnpm for v12+, using the @pnpm/exe.<platform> artifact names.

The install path also relinks the host native binary on cache hits, so a partially linked global-virtual-store slot is repaired instead of reused broken.

Related to #11633.

Squash Commit Body

Pacquet previously installed the unscoped pnpm package for every `pn with <version>` target. That works for v12+, where pnpm itself carries the native engine layout, but pnpm versions from 6.17.1 through v11 need the scoped `@pnpm/exe` wrapper package. Installing the unscoped package for those versions leaves the wrapper without the host native binary and fails at runtime with "no @pnpm/exe.<platform> native binary was found for this host".

Select the engine package from the resolved target version. Versions before `@pnpm/exe` was published use the JS `pnpm` package and skip native relinking. Versions from 6.17.1 through v11 use `@pnpm/exe` and link legacy platform artifacts such as `@pnpm/macos-arm64`. v12 and newer use unscoped `pnpm` and link the newer `@pnpm/exe.<platform>` artifacts.

Share that selection between self-update and `with`, use it when computing and resolving global-virtual-store slots, and derive scoped package slots by walking the full package path. Relink native platform binaries on cache hits as well as fresh installs so a previously incomplete slot is repaired before it is reused.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pacquet/ port, or the description notes what still needs porting.
  • Added or updated tests.

Written by an agent (Codex, GPT-5).

Summary by CodeRabbit

  • New Features
    • Added global CLI options --color and --yes / -y, and updated with current handling and option parsing to preserve these flags.
  • Bug Fixes
    • Improved self-update and pnpm installation to select the correct pnpm engine wrapper based on the requested version and correctly link native binaries.
    • Refined global linking/cache/slot derivation for the versioned engine layout and added protections against unsafe wrapper/native symlinks.
    • Enhanced env lockfile package-manager integrity resolution/verification for pnpm setups with and without @pnpm/exe.
  • Tests
    • Expanded unit and CLI coverage for pnpm engine mapping, binary linking, slot derivation, lockfile scenarios, and broader with command behavior.

Copilot AI review requested due to automatic review settings July 6, 2026 09:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Fix pn with downgrades by installing @pnpm/exe for pnpm <12

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Select the correct engine wrapper package based on target pnpm major version.
• Fix cache-hit behavior by relinking the host native binary before reuse.
• Add tests for scoped/unscoped wrapper paths and GVS slot resolution.
Diagram

graph TD
  A["self-update handler"] --> B["install_pnpm"] --> C["select wrapper pkg"] --> D["run_install"] --> E["link native binary"] --> F["link global bins"]
  G["with: install_pnpm_to_store"] --> C --> D --> H[("Global Virtual Store slot")] --> E
  G --> I["compute/resolve slot"] --> H
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Always install both `pnpm` and `@pnpm/exe` for `pn with` targets
  • ➕ Avoids version-based branching logic
  • ➕ Makes wrapper selection a pure runtime choice
  • ➖ Extra downloads/storage for v12+ (where pnpm is sufficient)
  • ➖ More complex slot hygiene (two wrappers per version)
2. Detect wrapper layout by inspecting installed package contents
  • ➕ More robust if future versions change the major/layout contract
  • ➕ Could handle non-semver inputs without defaulting
  • ➖ Requires installing/downloading before deciding (hurts cache-hit short-circuiting)
  • ➖ More I/O and failure modes compared to a simple semver-major check

Recommendation: The PR’s approach (semver-major-based wrapper selection shared across self-update and with, plus relinking on cache hits) is the best tradeoff: it matches known pnpm layout boundaries (pre-v12 requires @pnpm/exe), keeps installs minimal, and directly fixes the broken-cache reuse scenario.

Files changed (5) +129 / -39

Bug fix (3) +77 / -37
self_update.rsPass installed wrapper package name into global bin linking +7/-3

Pass installed wrapper package name into global bin linking

• Updates 'self-update' to thread the selected wrapper package name into 'link_into_global_bin'. The global cache key aliases now reflect the actual installed wrapper ('pnpm' vs '@pnpm/exe') rather than always assuming 'pnpm'.

pacquet/crates/cli/src/cli_args/self_update.rs

install_pnpm.rsSelect wrapper package by pnpm major and relink native binary on cache hits +40/-18

Select wrapper package by pnpm major and relink native binary on cache hits

• Introduces 'pnpm_package_name_to_install()' to choose '@pnpm/exe' for pnpm <12 and 'pnpm' for v12+. Propagates 'package_name' through install, version detection, and bin/native linking, and ensures 'link_exe_platform_binary()' runs even when an existing install is reused. Adds 'package_dir()' helper to correctly handle scoped package paths.

pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs

install_pnpm_to_store.rsInstall correct wrapper for 'pn with' downgrades and repair cached slots +30/-16

Install correct wrapper for 'pn with' downgrades and repair cached slots

• Switches 'pn with' engine installation to use the wrapper package chosen from the target version, and uses 'package_dir()' for scoped/unscoped layouts. On cache hits, re-links the host native binary before reusing a slot, and generalizes slot computation/resolution to derive the GVS slot from either wrapper layout via 'slot_from_package_dir()'.

pacquet/crates/cli/src/cli_args/with/install_pnpm_to_store.rs

Tests (2) +52 / -2
tests.rsAdd coverage for wrapper selection and scoped wrapper native binary linking +35/-2

Add coverage for wrapper selection and scoped wrapper native binary linking

• Adds tests verifying wrapper selection across v11/v12 and invalid semver inputs. Extends fake engine layout helpers to support both unscoped 'pnpm' and scoped '@pnpm/exe' wrappers, and validates native binary linking into the scoped wrapper path.

pacquet/crates/cli/src/cli_args/self_update/install_pnpm/tests.rs

tests.rsTest GVS slot derivation for scoped and unscoped wrapper package dirs +17/-0

Test GVS slot derivation for scoped and unscoped wrapper package dirs

• Adds unit tests ensuring 'slot_from_package_dir()' correctly finds the global-virtual-store slot when the wrapper is installed as either 'pnpm' or '@pnpm/exe'. This guards the generalized slot resolution logic used by 'pn with'.

pacquet/crates/cli/src/cli_args/with/tests.rs

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The pnpm self-update, store-install, env-integrity, and CLI flows now derive package-manager identity from the requested version and use that identity through install, linking, slot resolution, and lockfile verification.

Changes

Package-name-aware pnpm install, linking, and verification

Layer / File(s) Summary
Package name selection and install helpers
pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs
Adds the executable package constant, package-selection metadata, result package name field, and the package_dir helper used by install and linking code.
Self-update install and global bin linking
pacquet/crates/cli/src/cli_args/self_update.rs, pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs
install_pnpm resolves the package name from the pnpm version, uses it for existing-install detection and native binary linking, and returns it to the caller; self_update.rs forwards that package name into global-bin linking, which now builds aliases from the provided name.
Self-update package-name layout tests
pacquet/crates/cli/src/cli_args/self_update/install_pnpm/tests.rs
Tests cover version-to-package selection, wrapper layout creation in the fixture, linking the platform binary into the scoped executable wrapper, and rejection of wrapper symlinks that escape the install directory.
Store install slot resolution by package name
pacquet/crates/cli/src/cli_args/with/install_pnpm_to_store.rs, pacquet/crates/cli/src/cli_args/with/tests.rs
install_pnpm_to_store derives package_name from the pnpm version, uses it for cache-hit handling and post-install linking, replaces fixed slot computation with package-name-aware engine slot selection, and resolves installed slots through slot_from_package_dir, which is covered by tests for scoped and unscoped layouts.
Env package-manager dependency selection
pacquet/crates/cli/src/config_deps.rs, pacquet/crates/env-installer/src/resolve_package_manager_integrities.rs, pacquet/crates/env-installer/src/tests.rs
resolve_package_manager_integrities and is_package_manager_resolved now choose between pnpm-only and pnpm-plus-exe dependency sets from the requested pnpm version, and tests cover resolution before and after @pnpm/exe is introduced.
Global boolean CLI flags
pacquet/crates/cli/src/cli_args/cli_command.rs, pacquet/crates/cli/src/cli_args/dispatch.rs, pacquet/crates/cli/src/with_current.rs, pacquet/crates/cli/src/with_current/tests.rs, pacquet/crates/cli/tests/with.rs
Adds --color and --yes, threads them through CLI destructuring and with current parsing, and expands the CLI test coverage for flag rewriting and command execution.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • pnpm/pnpm#12670: Both PRs select pnpm engine wrapper identity by version and thread it through install and linking paths.
  • pnpm/pnpm#12693: Both PRs touch the self-update install flow and the package-name propagation used by bin linking and cache-key behavior.
  • pnpm/pnpm#12696: Both PRs modify the pnpm engine install/link path and the global-virtual-store install path together.

Suggested labels: product: pacquet

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pq-with

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
tarball/download_dependency    1.01      6.8±0.33ms   636.5 KB/sec    1.00      6.8±0.34ms   640.5 KB/sec

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Untrusted native src path ✓ Resolved 🐞 Bug ⛨ Security
Description
link_exe_platform_binary() hard-links the first existing native binary candidate into the wrapper
without validating that the source path is a regular file under the install slot (it may be a
symlink or resolve outside). Since pnpm-workspace.yaml can set storeDir and pnpm with relinks
on cache hits (skipping signature verification), a repo-influenced store slot can cause an
unexpected executable to be linked and run.
Code

pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[R319-325]

    .ok_or_else(|| {
        miette::miette!("no @pnpm/exe.{platform}-{arch} native binary was found for this host")
    })?;
-    let dest = wrapper_dir.join(executable);
+    let dest = wrapper_real_dir.join(executable);
force_link(&src, &dest)
    .into_diagnostic()
    .wrap_err("link the native pnpm binary into the wrapper")?;
Evidence
The code validates wrapper_real_dir is inside install_real_dir but then chooses src via an
exists() check and hard-links it without canonicalization/symlink/type checks. pnpm with uses
config.store_dir (repo-configurable via workspace yaml) and on cache hits it calls
link_exe_platform_binary after only checking package.json exists, while explicitly skipping
signature verification in that branch.

pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[272-339]
pacquet/crates/cli/src/cli_args/with/install_pnpm_to_store.rs[61-78]
pacquet/crates/config/src/workspace_yaml.rs[37-90]
pacquet/crates/store-dir/src/store_dir.rs[22-29]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`link_exe_platform_binary()` validates that the wrapper directory resolves inside `install_dir`, but it does not apply similar validation to the *source* native binary path (`src`) before hard-linking it into the wrapper. If `src` is a symlink (or is under a symlinked `@pnpm` directory) it can resolve outside the intended slot and link an unexpected executable into the wrapper.
### Issue Context
- `pnpm-workspace.yaml` supports `storeDir`, so a repository can influence where the store/links tree lives.
- `pnpm with` has a cache-hit fast path that skips signature verification and now triggers relinking from the slot.
### Fix Focus Areas
- pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[272-339]
- pacquet/crates/cli/src/cli_args/with/install_pnpm_to_store.rs[61-78]
### What to change
1. After selecting the candidate `src`, validate it before `force_link`:
- Use `symlink_metadata(&src)` to reject symlinks (or, at minimum, reject symlinks for the final `.../pnpm[.exe]` entry).
- Canonicalize `src` to `src_real` and require `src_real.starts_with(&install_real_dir)`.
- Ensure `src_real` is a regular file.
2. Consider canonicalizing `scope_dir` (when it exists) and rejecting it if it resolves outside `install_real_dir`, to block `node_modules/@pnpm -> /outside` style indirection.
3. Keep error messages explicit (this is an engine critical path).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Symlink escape on relink ✓ Resolved 🐞 Bug ⛨ Security
Description
On cache hits, install_pnpm_to_store now calls link_exe_platform_binary, which removes and
hard-links wrapper_dir/ using paths that can traverse symlinks; a malicious symlink under the
store slot can redirect this write outside the intended install tree and clobber arbitrary files
when run with sufficient privileges.
Code

pacquet/crates/cli/src/cli_args/with/install_pnpm_to_store.rs[R66-73]

+    if let Some(slot) = compute_engine_slot(config, &env, package_name, version) {
+        let pkg_dir = package_dir(&slot, package_name);
let bin_dir = slot.join("bin");
if pkg_dir.join("package.json").exists() {
+            link_exe_platform_binary(&slot, package_name)?;
 if !bin_dir.exists() {
     link_bins(&pkg_dir, &bin_dir)?;
 }
Evidence
The cache-hit path now writes into the engine wrapper directory by calling
link_exe_platform_binary before returning, and that function performs remove_file/hard_link to
dest derived from wrapper_dir without validating the directory is not a symlink or that its
canonical location is within install_dir, enabling symlink-based path escape.

pacquet/crates/cli/src/cli_args/with/install_pnpm_to_store.rs[60-75]
pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[52-70]
pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[245-326]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`link_exe_platform_binary()` canonicalizes `wrapper_dir` but writes to `dest` built from the *non-canonical* `wrapper_dir` path. With the new cache-hit relink call sites, this introduces a symlink-escape write primitive: if `node_modules/<pkg>` (or any ancestor in that path) is a symlink, `remove_file(dest)` and `hard_link(src, dest)` can operate outside the intended install directory.
### Issue Context
This became reachable on cache hits (no reinstall) via `install_pnpm_to_store()` and also via `install_pnpm()`’s existing-install fast path.
### Fix Focus Areas
- Ensure wrapper path stays inside install dir:
- pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[245-326]
- Cache-hit relink call site:
- pacquet/crates/cli/src/cli_args/with/install_pnpm_to_store.rs[60-75]
- Existing-install fast path:
- pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[52-70]
### Suggested fix
1) In `link_exe_platform_binary`, compute `install_real_dir = canonicalize(install_dir)` and `wrapper_real_dir = canonicalize(wrapper_dir)`.
2) Fail if `!wrapper_real_dir.starts_with(&install_real_dir)`.
3) Build `dest` from `wrapper_real_dir.join(executable)` (not `wrapper_dir`), so writes happen in the resolved directory.
4) Optionally add explicit `symlink_metadata` checks to reject `wrapper_dir` (and/or `install_dir/node_modules`, scope dir) when they are symlinks, for defense-in-depth.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Symlinked GVS root breaks relink 🐞 Bug ☼ Reliability
Description
link_exe_platform_binary() only broadens the trusted root to the global-virtual-store root when
the canonicalized slot path’s root directory name is literally links; if .../links is a symlink,
canonicalization drops that path component and the code falls back to trusting only the wrapper slot
directory. Because the native platform package can resolve (via symlinks) to a sibling slot,
validate_native_binary_source() will then reject a legitimate native binary as “resolves outside
…”, breaking pnpm with/self-update on such store layouts.
Code

pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[R344-372]

+fn native_source_trust_root(install_real_dir: &Path, wrapper_pkg_name: &str) -> PathBuf {
+    // In the global virtual store, the wrapper and platform binary live
+    // in sibling slots under `links`; self-update installs keep both
+    // under the one install dir.
+    global_virtual_store_root_from_slot(install_real_dir, wrapper_pkg_name)
+        .unwrap_or_else(|| install_real_dir.to_path_buf())
+}
+
+fn global_virtual_store_root_from_slot(slot_dir: &Path, package_name: &str) -> Option<PathBuf> {
+    let mut cursor = slot_dir.parent()?;
+    let version = cursor.file_name()?.to_str()?;
+    node_semver::Version::parse(version).ok()?;
+
+    cursor = cursor.parent()?;
+    let mut package_segments = package_name.split('/').rev();
+    let name = package_segments.next()?;
+    if cursor.file_name()?.to_str()? != name {
+        return None;
+    }
+    for segment in package_segments {
+        cursor = cursor.parent()?;
+        if cursor.file_name()?.to_str()? != segment {
+            return None;
+        }
+    }
+
+    let root = cursor.parent()?;
+    (root.file_name()?.to_str()? == "links").then(|| root.to_path_buf())
+}
Evidence
The trust-root widening is gated on a literal links directory name after canonicalization; when
that fails, the source root becomes the wrapper slot directory even though the code comments and GVS
layout indicate the platform binary may resolve to a sibling slot. The subsequent
starts_with(source_root) check then rejects legitimate binaries outside the wrapper slot.

pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[286-324]
pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[344-372]
pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[374-390]
pacquet/crates/package-manager/src/virtual_store_layout.rs[4-7]
pacquet/crates/store-dir/src/store_dir.rs[164-173]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`global_virtual_store_root_from_slot()` only returns a trust root when the computed root directory’s final path component equals the literal string `"links"`. But `link_exe_platform_binary()` canonicalizes `install_dir` first, so if `<store>/links` is itself a symlink, the canonicalized path no longer contains a `links` component and the function returns `None`.
That makes `native_source_trust_root()` fall back to `install_real_dir` (the wrapper slot), which is too narrow in the global virtual store because the platform binary package can live in a sibling slot. `validate_native_binary_source()` then rejects the resolved native binary path as “outside”.
## Issue Context
- The code explicitly documents that in the GVS, wrapper and platform binary can be in sibling slots; the trust root must therefore include the whole GVS root, not just the wrapper slot.
## Fix Focus Areas
- pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[344-372]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Prerelease cutoff misclassified 🐞 Bug ≡ Correctness
Description
The @pnpm/exe cutoff check ignores prerelease identifiers, so versions like 6.17.1-alpha.1 are
treated as >= 6.17.1 and routed to the @pnpm/exe wrapper/dependency path. This can make
self-update/pnpm with fail to resolve or install prerelease targets near the cutoff because it
attempts to use @pnpm/exe when the correct prerelease semantics would not cross the threshold yet.
Code

pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[R132-134]

+fn version_gte(version: &node_semver::Version, minimum: (u64, u64, u64)) -> bool {
+    (version.major, version.minor, version.patch) >= minimum
+}
Evidence
Both wrapper selection and env dependency selection use tuple comparison, which ignores
node_semver::Version prerelease fields; elsewhere in the same module the code explicitly handles
prereleases, indicating prerelease semantics are expected to matter.

pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[118-134]
pacquet/crates/env-installer/src/resolve_package_manager_integrities.rs[127-140]
pacquet/crates/cli/src/cli_args/self_update.rs[461-477]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The cutoff comparison for deciding whether `@pnpm/exe` exists is implemented as `(major, minor, patch) >= (6,17,1)`, which ignores SemVer prerelease precedence (e.g., `6.17.1-alpha.1` should be *less than* `6.17.1`). This causes prerelease versions at the boundary to be misclassified and can select the wrong wrapper/dependency set.
## Issue Context
This logic is duplicated in both the CLI engine-wrapper selection and env-lockfile package-manager dependency selection.
## Fix Focus Areas
- pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[118-134]
- pacquet/crates/env-installer/src/resolve_package_manager_integrities.rs[127-140]
## Proposed fix
- Parse the minimum as a full `node_semver::Version` (e.g. `Version::parse("6.17.1")`) and compare using `Version` ordering (`version >= minimum_version`), which correctly treats prereleases as less than the corresponding release.
- Apply the same prerelease-aware comparison in both places (or share a small helper) so the wrapper-selection and env-lockfile dependency list stay consistent.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Cache-hit relink not idempotent 🐞 Bug ☼ Reliability
Description
On cache hits, install_pnpm now calls link_exe_platform_binary, which always deletes and
re-hardlinks the wrapper executable via force_link, even if it’s already correct. This adds
unnecessary I/O on every warm reuse and can fail when the destination cannot be replaced (e.g., file
locking on Windows), converting a cache hit into an error.
Code

pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[R59-69]

+    if let Some(existing) = find_global_package(&global_pkg_dir, package_name)
.into_diagnostic()
.wrap_err("scan global packages")?
-        && installed_version(&existing.install_dir).as_deref() == Some(version)
+        && installed_version(&existing.install_dir, package_name).as_deref() == Some(version)
{
-        return Ok(InstallPnpmResult { install_dir: existing.install_dir, already_existed: true });
+        link_exe_platform_binary(&existing.install_dir, package_name)?;
+        return Ok(InstallPnpmResult {
+            install_dir: existing.install_dir,
+            package_name,
+            already_existed: true,
+        });
Evidence
The PR adds a cache-hit relink in install_pnpm, and the relink path is implemented via
force_link which unconditionally removes the destination before hardlinking. The repo already
contains a pattern (cmd-shim’s Windows hardlinking) that avoids this churn by checking whether the
destination already matches the source and returning early.

pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[59-69]
pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[311-325]
pacquet/crates/cli/src/cli_args/with/install_pnpm_to_store.rs[60-75]
pacquet/crates/cmd-shim/src/link_bins.rs[553-566]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Cache-hit paths now re-run `link_exe_platform_binary`, but the underlying `force_link` always does `remove_file(dest)` then `hard_link(src, dest)`. This is non-idempotent and introduces unnecessary churn; it can also fail when `dest` cannot be removed/replaced.
## Issue Context
A similar Windows hardlink path in `cmd-shim` explicitly avoids remove+relink churn when the destination already matches the source, indicating the desired behavior for warm paths is to be idempotent.
## Fix Focus Areas
- pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[59-69]
- pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs[311-325]
- pacquet/crates/cli/src/cli_args/with/install_pnpm_to_store.rs[60-75]
- pacquet/crates/cmd-shim/src/link_bins.rs[553-566]
## Suggested fix approach
- Make `force_link` (or `link_exe_platform_binary`) skip the relink when `dest` already refers to the intended `src` (hardlink equality / same-file identity; on Windows you can reuse the `same_file::Handle` approach like `cmd-shim` does).
- Alternatively (or additionally), in the cache-hit callers only invoke `link_exe_platform_binary` when the expected destination (`wrapper_dir/pnpm` or `wrapper_dir/pnpm.exe`) is missing.
- Keep the existing “repair broken slot” intent by relinking only when needed, not unconditionally.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 6, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 6fc02b4

@codecov-commenter

codecov-commenter commented Jul 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.52809% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.88%. Comparing base (3685987) to head (a71d5fc).

Files with missing lines Patch % Lines
...rates/cli/src/cli_args/self_update/install_pnpm.rs 74.77% 28 Missing ⚠️
pacquet/crates/cli/src/cli_args/self_update.rs 0.00% 7 Missing ⚠️
...tes/cli/src/cli_args/with/install_pnpm_to_store.rs 86.20% 4 Missing ⚠️
...staller/src/resolve_package_manager_integrities.rs 96.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12820      +/-   ##
==========================================
+ Coverage   85.19%   85.88%   +0.68%     
==========================================
  Files         416      416              
  Lines       65920    66064     +144     
==========================================
+ Hits        56160    56736     +576     
+ Misses       9760     9328     -432     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 9fcde87

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
pacquet/crates/cli/src/cli_args/self_update/install_pnpm/tests.rs (1)

40-47: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Missing coverage for the non-semver fallback's links_native_binary flag.

The sibling test (line 37) covers the fallback's .name, but this test never asserts pnpm_package_to_install("not-semver").links_native_binary (which the contract returns as true per install_pnpm.rs). This branch is part of the version-selection logic Codecov flagged with low patch coverage.

✅ Suggested addition
 fn native_binary_linking_matches_pnpm_engine_layout() {
     assert!(pnpm_package_to_install("12.0.0-alpha.1").links_native_binary);
     assert!(pnpm_package_to_install("11.10.0").links_native_binary);
     assert!(pnpm_package_to_install("6.17.1").links_native_binary);
     assert!(!pnpm_package_to_install("6.16.0").links_native_binary);
     assert!(!pnpm_package_to_install("5.18.10").links_native_binary);
+    assert!(pnpm_package_to_install("not-semver").links_native_binary);
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pacquet/crates/cli/src/cli_args/self_update/install_pnpm/tests.rs` around
lines 40 - 47, The native binary linking test for pnpm version selection is
missing coverage for the non-semver fallback branch. Update the
`native_binary_linking_matches_pnpm_engine_layout` test in
`install_pnpm/tests.rs` to also assert that
`pnpm_package_to_install("not-semver").links_native_binary` is true, matching
the fallback behavior implemented by `pnpm_package_to_install` in
`install_pnpm.rs`.
pacquet/crates/env-installer/src/resolve_package_manager_integrities.rs (2)

29-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Redundant package_manager_deps computation.

resolve_package_manager_integrities computes package_manager_deps at Line 29, but is_package_manager_resolved (called right after, Line 30) independently recomputes the same slice internally via its own call to package_manager_deps(pnpm_version) (Line 116). The Line 29 binding isn't used until Line 41, after the early-return check. Consider passing the already-computed slice into is_package_manager_resolved to avoid the duplicate semver parse/dispatch.

♻️ Proposed refactor
-    let package_manager_deps = package_manager_deps(pnpm_version);
-    if is_package_manager_resolved(&env_lockfile, wanted_specifier, pnpm_version) {
+    let package_manager_deps = package_manager_deps(pnpm_version);
+    if is_package_manager_resolved_with_deps(&env_lockfile, wanted_specifier, pnpm_version, package_manager_deps) {
         return Ok(());
     }

Also applies to: 116-118

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pacquet/crates/env-installer/src/resolve_package_manager_integrities.rs`
around lines 29 - 30, resolve_package_manager_integrities is computing
package_manager_deps before the early return, but is_package_manager_resolved
recomputes the same data internally. Update resolve_package_manager_integrities
and is_package_manager_resolved so the already-built package_manager_deps slice
is passed through and reused instead of calling
package_manager_deps(pnpm_version) twice. Keep the fix anchored around the
resolve_package_manager_integrities function and the is_package_manager_resolved
helper.

135-140: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Silent fallback to true on unparseable version.

If pnpm_version fails to parse, pnpm_exe_package_exists defaults to true, assuming the exe package exists. This is a reasonable defensive default given resolve_dep would likely fail anyway on a bad specifier, but it's worth confirming this matches the intended behavior of the TS pnpm counterpart rather than silently guessing.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pacquet/crates/env-installer/src/resolve_package_manager_integrities.rs`
around lines 135 - 140, The pnpm_exe_package_exists helper currently returns
true when node_semver::Version::parse fails, which silently assumes the exe
package exists; verify this matches the intended behavior of the TypeScript pnpm
counterpart used by resolve_package_manager_integrities, and either align the
fallback explicitly there or make the failure path conservative/handled in the
same way the rest of the package-manager resolution logic expects.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pacquet/crates/env-installer/src/resolve_package_manager_integrities.rs`:
- Around line 16-18: The PNPM executable cutoff is outdated and causes integrity
resolution to look for `@pnpm/exe` before it exists. Update the
PNPM_EXE_INTRODUCED constant in resolve_package_manager_integrities to the
correct first-published pnpm version, and ensure the logic that uses this symbol
only treats versions at or above that threshold as having the exe-based
dependency.

---

Nitpick comments:
In `@pacquet/crates/cli/src/cli_args/self_update/install_pnpm/tests.rs`:
- Around line 40-47: The native binary linking test for pnpm version selection
is missing coverage for the non-semver fallback branch. Update the
`native_binary_linking_matches_pnpm_engine_layout` test in
`install_pnpm/tests.rs` to also assert that
`pnpm_package_to_install("not-semver").links_native_binary` is true, matching
the fallback behavior implemented by `pnpm_package_to_install` in
`install_pnpm.rs`.

In `@pacquet/crates/env-installer/src/resolve_package_manager_integrities.rs`:
- Around line 29-30: resolve_package_manager_integrities is computing
package_manager_deps before the early return, but is_package_manager_resolved
recomputes the same data internally. Update resolve_package_manager_integrities
and is_package_manager_resolved so the already-built package_manager_deps slice
is passed through and reused instead of calling
package_manager_deps(pnpm_version) twice. Keep the fix anchored around the
resolve_package_manager_integrities function and the is_package_manager_resolved
helper.
- Around line 135-140: The pnpm_exe_package_exists helper currently returns true
when node_semver::Version::parse fails, which silently assumes the exe package
exists; verify this matches the intended behavior of the TypeScript pnpm
counterpart used by resolve_package_manager_integrities, and either align the
fallback explicitly there or make the failure path conservative/handled in the
same way the rest of the package-manager resolution logic expects.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 84cc3e1f-ec68-481f-929a-43c991aa274e

📥 Commits

Reviewing files that changed from the base of the PR and between 6fc02b4 and 9fcde87.

📒 Files selected for processing (7)
  • pacquet/crates/cli/src/cli_args/self_update.rs
  • pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs
  • pacquet/crates/cli/src/cli_args/self_update/install_pnpm/tests.rs
  • pacquet/crates/cli/src/cli_args/with/install_pnpm_to_store.rs
  • pacquet/crates/cli/src/config_deps.rs
  • pacquet/crates/env-installer/src/resolve_package_manager_integrities.rs
  • pacquet/crates/env-installer/src/tests.rs
✅ Files skipped from review due to trivial changes (1)
  • pacquet/crates/cli/src/config_deps.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • pacquet/crates/cli/src/cli_args/self_update.rs
  • pacquet/crates/cli/src/cli_args/with/install_pnpm_to_store.rs
  • pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 9fcde87

Copilot AI review requested due to automatic review settings July 6, 2026 09:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 876c186

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 876c186

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

New Review Started

This review has been superseded by a new analysis

Grey Divider

Qodo Logo

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
pacquet/crates/cli/src/with_current.rs (1)

21-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Hardcoded boolean-options list risks drift from CliArgs.

BOOLEAN_LONG_OPTIONS must be manually kept in sync with every bool field added to CliArgs; if a future global boolean flag is added without updating this list, long_option_consumes_value will wrongly treat it as value-consuming during the with current rewrite. with_boolean_negations (in boolean_negations.rs) already solves the identical problem by scanning the built Command for ArgAction::SetTrue args dynamically — consider deriving this list the same way instead of a separate hardcoded array.

♻️ Sketch of a derived approach
-const BOOLEAN_LONG_OPTIONS: &[&str] = &["color", "recursive", "yes"];
+fn boolean_long_options() -> Vec<String> {
+    CliArgs::command()
+        .get_arguments()
+        .filter(|arg| matches!(arg.get_action(), clap::ArgAction::SetTrue))
+        .filter_map(|arg| arg.get_long().map(String::from))
+        .collect()
+}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pacquet/crates/cli/src/with_current.rs` at line 21, The hardcoded
BOOLEAN_LONG_OPTIONS array in with_current.rs can drift from CliArgs as new bool
flags are added. Replace the manual list with a derived lookup built from the
Command/Arg metadata, similar to how with_boolean_negations in
boolean_negations.rs scans for ArgAction::SetTrue, and update
long_option_consumes_value to use that dynamic source so every current and
future boolean option stays in sync automatically.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pacquet/crates/cli/src/with_current.rs`:
- Line 21: The hardcoded BOOLEAN_LONG_OPTIONS array in with_current.rs can drift
from CliArgs as new bool flags are added. Replace the manual list with a derived
lookup built from the Command/Arg metadata, similar to how
with_boolean_negations in boolean_negations.rs scans for ArgAction::SetTrue, and
update long_option_consumes_value to use that dynamic source so every current
and future boolean option stays in sync automatically.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f87e0823-26eb-4826-a687-1d7a41a44ec7

📥 Commits

Reviewing files that changed from the base of the PR and between 876c186 and 9193ac8.

📒 Files selected for processing (5)
  • pacquet/crates/cli/src/cli_args/cli_command.rs
  • pacquet/crates/cli/src/cli_args/dispatch.rs
  • pacquet/crates/cli/src/with_current.rs
  • pacquet/crates/cli/src/with_current/tests.rs
  • pacquet/crates/cli/tests/with.rs
✅ Files skipped from review due to trivial changes (1)
  • pacquet/crates/cli/src/cli_args/dispatch.rs

Copilot AI review requested due to automatic review settings July 6, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

New Review Started

This review has been superseded by a new analysis

Grey Divider

Qodo Logo

1 similar comment
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

New Review Started

This review has been superseded by a new analysis

Grey Divider

Qodo Logo

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
pacquet/crates/cli/src/cli_args/self_update/install_pnpm/tests.rs (2)

138-138: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use PNPM_PACKAGE_NAME constant instead of hardcoded "pnpm" literal.

Both new tests hardcode "pnpm" for the wrapper package name argument, even though PNPM_PACKAGE_NAME is imported into this module. Using the constant keeps tests aligned if the constant value ever changes and matches the intent of the import.

♻️ Proposed fix
-    let err =
-        link_exe_platform_binary(temp.path(), "pnpm").expect_err("escaped native source rejected");
+    let err = link_exe_platform_binary(temp.path(), PNPM_PACKAGE_NAME)
+        .expect_err("escaped native source rejected");
     assert!(err.to_string().contains("is a symlink"), "unexpected error: {err:?}");
-    assert!(!package_dir(temp.path(), "pnpm").join("pnpm").exists());
+    assert!(!package_dir(temp.path(), PNPM_PACKAGE_NAME).join("pnpm").exists());

Also applies to: 140-140, 159-159, 162-162

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pacquet/crates/cli/src/cli_args/self_update/install_pnpm/tests.rs` at line
138, The pnpm self-update tests are hardcoding the wrapper package name instead
of using the imported PNPM_PACKAGE_NAME constant. Update the affected calls in
install_pnpm/tests.rs that reference link_exe_platform_binary and related test
helpers to pass PNPM_PACKAGE_NAME so the tests stay aligned with the shared
symbol if the package name changes.

140-140: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add diagnostic logging before plain assert! calls.

Per the pacquet Rust test conventions, non-assert_eq! assertions should have dbg!/eprintln! (or a failure message) logging before them so a failure clearly shows the actual state. These two assert! calls have no message and no preceding logging, unlike the sibling assertions at Lines 139/161 which include {err:?} in the message.

As per path instructions, "Follow logging/test guidance: add logging (eprintln!/dbg!) before non-assert_eq! assertions, but avoid unnecessary logging for simple scalar assert_eq!."

🧪 Proposed fix
-    assert!(!package_dir(temp.path(), "pnpm").join("pnpm").exists());
+    let linked_path = package_dir(temp.path(), "pnpm").join("pnpm");
+    dbg!(&linked_path);
+    assert!(!linked_path.exists());

Also applies to: 162-162

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pacquet/crates/cli/src/cli_args/self_update/install_pnpm/tests.rs` at line
140, Add diagnostic output before the plain assert! checks in install_pnpm tests
so failures show the actual filesystem state. Update the test cases around the
pnpm package_dir assertions in install_pnpm/tests.rs by adding dbg!/eprintln! or
a failure message before the non-assert_eq! assertions, similar in spirit to the
neighboring error assertions that already include context. Keep the existing
assertion behavior, but ensure the relevant state is logged in the test before
each plain assert!.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pacquet/crates/cli/src/cli_args/self_update/install_pnpm/tests.rs`:
- Line 138: The pnpm self-update tests are hardcoding the wrapper package name
instead of using the imported PNPM_PACKAGE_NAME constant. Update the affected
calls in install_pnpm/tests.rs that reference link_exe_platform_binary and
related test helpers to pass PNPM_PACKAGE_NAME so the tests stay aligned with
the shared symbol if the package name changes.
- Line 140: Add diagnostic output before the plain assert! checks in
install_pnpm tests so failures show the actual filesystem state. Update the test
cases around the pnpm package_dir assertions in install_pnpm/tests.rs by adding
dbg!/eprintln! or a failure message before the non-assert_eq! assertions,
similar in spirit to the neighboring error assertions that already include
context. Keep the existing assertion behavior, but ensure the relevant state is
logged in the test before each plain assert!.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8ac8d659-0a5a-4292-bea3-20add80d005f

📥 Commits

Reviewing files that changed from the base of the PR and between 9193ac8 and a71d5fc.

📒 Files selected for processing (2)
  • pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs
  • pacquet/crates/cli/src/cli_args/self_update/install_pnpm/tests.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • pacquet/crates/cli/src/cli_args/self_update/install_pnpm.rs

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit a71d5fc

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: a71d5fc02152

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.950 ± 0.136 3.792 4.210 1.88 ± 0.10
pacquet@main 3.847 ± 0.174 3.638 4.118 1.83 ± 0.11
pnpr@HEAD 2.131 ± 0.119 2.000 2.386 1.01 ± 0.07
pnpr@main 2.107 ± 0.091 2.002 2.257 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.95019289512,
      "stddev": 0.13606845688219413,
      "median": 3.9313200986199996,
      "user": 3.8138605400000003,
      "system": 3.3594620199999996,
      "min": 3.79164638212,
      "max": 4.20960078012,
      "times": [
        4.20960078012,
        3.98817060312,
        3.79212708612,
        3.86419772512,
        3.79164638212,
        3.87446959412,
        4.00671726412,
        4.06782536212,
        3.85980424112,
        4.04736991312
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.84667181282,
      "stddev": 0.17440276577026356,
      "median": 3.79455024462,
      "user": 3.7088530399999997,
      "system": 3.32935572,
      "min": 3.63822622212,
      "max": 4.11765180312,
      "times": [
        3.71057697012,
        4.06652248412,
        3.83963239812,
        3.63822622212,
        4.11765180312,
        3.69354050812,
        3.7013951451200002,
        4.01420962212,
        3.93549488412,
        3.74946809112
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.13060555742,
      "stddev": 0.11879173158167224,
      "median": 2.0903777556199996,
      "user": 2.7449343400000004,
      "system": 2.94782682,
      "min": 1.99967828612,
      "max": 2.38601749212,
      "times": [
        2.38601749212,
        2.17731853312,
        2.08280929412,
        2.0931025821199998,
        2.03359407612,
        2.26432288612,
        2.14754392912,
        2.08765292912,
        2.03401556612,
        1.99967828612
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.1065291464199998,
      "stddev": 0.09147827301753643,
      "median": 2.07168254912,
      "user": 2.74221714,
      "system": 2.92829152,
      "min": 2.00181536112,
      "max": 2.25707365112,
      "times": [
        2.25707365112,
        2.23616361212,
        2.06112945812,
        2.03013614412,
        2.00181536112,
        2.08837840512,
        2.04254882012,
        2.06017544312,
        2.20563492912,
        2.08223564012
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 649.6 ± 14.0 632.9 677.3 1.00 ± 0.03
pacquet@main 648.5 ± 12.3 633.0 670.8 1.00
pnpr@HEAD 697.2 ± 20.9 669.2 738.5 1.08 ± 0.04
pnpr@main 707.1 ± 33.2 679.3 787.1 1.09 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6495749654599999,
      "stddev": 0.014002462596671414,
      "median": 0.6475839853600001,
      "user": 0.38214693999999994,
      "system": 1.3293238200000002,
      "min": 0.63286635836,
      "max": 0.67727288136,
      "times": [
        0.65520863136,
        0.63862152436,
        0.6332276463600001,
        0.64705904636,
        0.66318545036,
        0.65734675836,
        0.64285243336,
        0.67727288136,
        0.64810892436,
        0.63286635836
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.64847363346,
      "stddev": 0.012345780201065118,
      "median": 0.64611461036,
      "user": 0.38675573999999996,
      "system": 1.31832182,
      "min": 0.63297309536,
      "max": 0.67080140136,
      "times": [
        0.63984246436,
        0.63864062736,
        0.63297309536,
        0.65338782736,
        0.65584122436,
        0.63840740436,
        0.64015766836,
        0.65207155236,
        0.67080140136,
        0.66261306936
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6971509581600001,
      "stddev": 0.020945432355763138,
      "median": 0.7012472563600001,
      "user": 0.39026054,
      "system": 1.3610845200000001,
      "min": 0.66920304136,
      "max": 0.73848696836,
      "times": [
        0.66920304136,
        0.7018708193600001,
        0.67548064136,
        0.67235434536,
        0.70712609936,
        0.69279754936,
        0.70255115636,
        0.71101526736,
        0.73848696836,
        0.70062369336
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.70711011196,
      "stddev": 0.03317130036880055,
      "median": 0.69554388036,
      "user": 0.39203634000000004,
      "system": 1.35182512,
      "min": 0.67933768536,
      "max": 0.78708534836,
      "times": [
        0.7151599723600001,
        0.73396894236,
        0.68291086636,
        0.71292744736,
        0.69326854336,
        0.68180458336,
        0.78708534836,
        0.69781921736,
        0.68681851336,
        0.67933768536
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.277 ± 0.062 4.196 4.399 2.00 ± 0.12
pacquet@main 4.287 ± 0.061 4.208 4.416 2.00 ± 0.12
pnpr@HEAD 2.249 ± 0.122 2.057 2.365 1.05 ± 0.09
pnpr@main 2.139 ± 0.129 1.955 2.339 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.277124262839999,
      "stddev": 0.06208672630217506,
      "median": 4.259755032539999,
      "user": 3.82293984,
      "system": 3.31906054,
      "min": 4.1956134685399995,
      "max": 4.39890963954,
      "times": [
        4.23466575954,
        4.30481512554,
        4.23875073454,
        4.28075933054,
        4.3246939725399995,
        4.39890963954,
        4.1956134685399995,
        4.32961509254,
        4.22864406054,
        4.23477544454
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.2869197865399995,
      "stddev": 0.061340819509049876,
      "median": 4.2809373835399995,
      "user": 3.83373664,
      "system": 3.2979099400000003,
      "min": 4.20788092054,
      "max": 4.41616773254,
      "times": [
        4.27550285454,
        4.41616773254,
        4.29538173754,
        4.28637191254,
        4.22183473054,
        4.27157733254,
        4.23686316054,
        4.3182411065399995,
        4.33937637754,
        4.20788092054
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.24877423794,
      "stddev": 0.12195890053651752,
      "median": 2.2908120955399998,
      "user": 2.5585652400000005,
      "system": 2.81703274,
      "min": 2.05731145754,
      "max": 2.36450725954,
      "times": [
        2.26089221754,
        2.35900289454,
        2.35407049254,
        2.08879943554,
        2.36450725954,
        2.05731145754,
        2.32073197354,
        2.35529970154,
        2.20709422454,
        2.12003272254
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.13891452494,
      "stddev": 0.12853088903097248,
      "median": 2.11277224254,
      "user": 2.58267864,
      "system": 2.7940587399999997,
      "min": 1.9549102295399998,
      "max": 2.33942371954,
      "times": [
        2.30583668054,
        2.12939613054,
        1.9549102295399998,
        2.11340205754,
        2.2826389155399998,
        2.11214242754,
        2.02404579354,
        2.07159126954,
        2.05575802554,
        2.33942371954
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.386 ± 0.023 1.355 1.425 2.07 ± 0.05
pacquet@main 1.419 ± 0.025 1.383 1.457 2.12 ± 0.05
pnpr@HEAD 0.671 ± 0.011 0.655 0.691 1.00 ± 0.02
pnpr@main 0.668 ± 0.010 0.652 0.686 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.3863098115999999,
      "stddev": 0.02347008344932778,
      "median": 1.3844994475,
      "user": 1.33810422,
      "system": 1.71235438,
      "min": 1.3553820699999999,
      "max": 1.42516504,
      "times": [
        1.3553820699999999,
        1.3625834099999998,
        1.419456875,
        1.37505098,
        1.383105013,
        1.3640324529999999,
        1.385893882,
        1.396210491,
        1.3962179019999998,
        1.42516504
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.4189273257,
      "stddev": 0.025169316037040403,
      "median": 1.4240316845,
      "user": 1.35966912,
      "system": 1.7314932799999998,
      "min": 1.383381262,
      "max": 1.456642426,
      "times": [
        1.383381262,
        1.426823835,
        1.421239534,
        1.433210296,
        1.441422656,
        1.437997971,
        1.391279268,
        1.3866727049999998,
        1.456642426,
        1.410603304
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6706312990000002,
      "stddev": 0.011234716279980836,
      "median": 0.6716799420000001,
      "user": 0.3507404199999999,
      "system": 1.2865236799999997,
      "min": 0.6553752890000001,
      "max": 0.6914275830000001,
      "times": [
        0.6611036570000001,
        0.6691581540000001,
        0.6553752890000001,
        0.6792286620000001,
        0.6914275830000001,
        0.675981232,
        0.6568835670000001,
        0.67747984,
        0.6654732760000001,
        0.67420173
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6683482643000002,
      "stddev": 0.010220000912684483,
      "median": 0.6684590330000001,
      "user": 0.34656832,
      "system": 1.2811620799999999,
      "min": 0.6522535850000001,
      "max": 0.6855681130000001,
      "times": [
        0.6679258290000001,
        0.6689922370000001,
        0.6522535850000001,
        0.6587303440000001,
        0.6596517890000001,
        0.6716539650000001,
        0.6855681130000001,
        0.679014117,
        0.6764255100000001,
        0.663267154
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.176 ± 0.033 3.136 3.244 4.70 ± 0.08
pacquet@main 3.217 ± 0.060 3.121 3.341 4.76 ± 0.11
pnpr@HEAD 0.676 ± 0.009 0.658 0.687 1.00
pnpr@main 0.693 ± 0.015 0.672 0.724 1.03 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.1756688128600006,
      "stddev": 0.033192215876327764,
      "median": 3.17076772386,
      "user": 1.8706671199999998,
      "system": 2.00891194,
      "min": 3.13611608286,
      "max": 3.24432820686,
      "times": [
        3.14597193486,
        3.14809397186,
        3.17977243786,
        3.13611608286,
        3.1687082808600002,
        3.15954908486,
        3.17282716686,
        3.1863021168600003,
        3.24432820686,
        3.21501884486
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.21694034736,
      "stddev": 0.05963139262341903,
      "median": 3.22383118186,
      "user": 1.8849185199999998,
      "system": 2.07030564,
      "min": 3.1214665578600003,
      "max": 3.34104102386,
      "times": [
        3.16222519486,
        3.22694597686,
        3.21541101186,
        3.22071638686,
        3.16481144086,
        3.24569571986,
        3.22718206386,
        3.34104102386,
        3.1214665578600003,
        3.2439080968600003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6763930579599999,
      "stddev": 0.008742124523521893,
      "median": 0.67699867136,
      "user": 0.35479772000000004,
      "system": 1.3095887399999997,
      "min": 0.65761768586,
      "max": 0.68660322986,
      "times": [
        0.65761768586,
        0.66730259586,
        0.67464353386,
        0.68616349086,
        0.68326059386,
        0.67654985186,
        0.67710555286,
        0.67689178986,
        0.68660322986,
        0.6777922548599999
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.69339797606,
      "stddev": 0.014768561237435805,
      "median": 0.69562648186,
      "user": 0.34689081999999993,
      "system": 1.3185278399999998,
      "min": 0.67154028886,
      "max": 0.72391687786,
      "times": [
        0.69861303086,
        0.68957328186,
        0.67154028886,
        0.69587024086,
        0.69840386586,
        0.68058549686,
        0.72391687786,
        0.69538272286,
        0.67799960386,
        0.70209435086
      ]
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 665.4 ± 9.9 652.1 681.8 6.02 ± 0.16
pacquet@main 660.9 ± 6.8 649.0 672.3 5.98 ± 0.14
pnpr@HEAD 110.5 ± 2.4 106.8 113.4 1.00
pnpr@main 111.4 ± 1.7 107.0 113.8 1.01 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.66543341046,
      "stddev": 0.009878638920033144,
      "median": 0.66522747776,
      "user": 0.62485592,
      "system": 0.15440366,
      "min": 0.6521353777600001,
      "max": 0.6817981907600001,
      "times": [
        0.6817981907600001,
        0.6774633967600001,
        0.6738943087600001,
        0.66704623776,
        0.6588301207600001,
        0.66699173176,
        0.6634632237600001,
        0.6564403077600001,
        0.6562712087600001,
        0.6521353777600001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.66094899746,
      "stddev": 0.006808080683455631,
      "median": 0.6607395747600001,
      "user": 0.61484542,
      "system": 0.15759396000000003,
      "min": 0.6489848627600001,
      "max": 0.6723384777600001,
      "times": [
        0.6598124647600001,
        0.6723384777600001,
        0.6662471117600001,
        0.6568367997600001,
        0.6635556207600001,
        0.6489848627600001,
        0.6670327937600001,
        0.6538390157600001,
        0.6591761427600001,
        0.6616666847600001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.11054256417666668,
      "stddev": 0.002400747871017802,
      "median": 0.11142786676000002,
      "user": 0.027502244999999998,
      "system": 0.021234701666666665,
      "min": 0.10680943176000002,
      "max": 0.11343460276000002,
      "times": [
        0.11129887276000001,
        0.10724343976000002,
        0.10716747676000002,
        0.10766563976000001,
        0.10695840076000002,
        0.10761638676000002,
        0.11291072176000001,
        0.11116384376000002,
        0.11343460276000002,
        0.11238516876000001,
        0.11105299076000001,
        0.11220848376000002,
        0.11211445176000001,
        0.11274283476000001,
        0.11155686076000002,
        0.11255138276000001,
        0.11163756976000001,
        0.10680943176000002,
        0.10743062476000001,
        0.10783644176000001,
        0.11220357176000001,
        0.11288433276000001,
        0.11112837176000001,
        0.11301963776000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.11136130850999998,
      "stddev": 0.0016581998428693242,
      "median": 0.11174993576,
      "user": 0.02636337,
      "system": 0.02248216,
      "min": 0.10698405876000001,
      "max": 0.11381790776000002,
      "times": [
        0.11231239176000002,
        0.11144467576000001,
        0.11270076376000002,
        0.11177660476000001,
        0.11167712876000001,
        0.11240363576000001,
        0.11318827976000001,
        0.11036268476000001,
        0.11172326676000001,
        0.11140151376000001,
        0.10698405876000001,
        0.10816628776000001,
        0.11143646676000002,
        0.10826484276000001,
        0.11125823276000002,
        0.11209835976000002,
        0.11231564876000001,
        0.11381790776000002,
        0.11132011476000002,
        0.11243195976000002,
        0.11234665376000001,
        0.10909819776000002,
        0.11206187576000001,
        0.11207985176000002
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 6.634 ± 0.144 6.318 6.815 1.35 ± 0.03
pacquet@main 6.644 ± 0.077 6.520 6.765 1.35 ± 0.02
pnpr@HEAD 5.022 ± 0.156 4.760 5.256 1.02 ± 0.03
pnpr@main 4.921 ± 0.064 4.859 5.075 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 6.633626769280001,
      "stddev": 0.14364348201362137,
      "median": 6.641406784080001,
      "user": 3.9044494999999997,
      "system": 3.6050001199999997,
      "min": 6.31829613208,
      "max": 6.815242292080001,
      "times": [
        6.31829613208,
        6.589680474080001,
        6.627658830080001,
        6.58186529808,
        6.81417218108,
        6.815242292080001,
        6.68540672608,
        6.54462834308,
        6.65515473808,
        6.70416267808
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 6.643748917980001,
      "stddev": 0.07706075063456015,
      "median": 6.6475315020800005,
      "user": 4.011939099999999,
      "system": 3.6384599200000003,
      "min": 6.520192688080001,
      "max": 6.764572104080001,
      "times": [
        6.708135434080001,
        6.5797812570800005,
        6.520192688080001,
        6.67891082708,
        6.629560141080001,
        6.66550286308,
        6.58691326808,
        6.72290853408,
        6.58101206308,
        6.764572104080001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 5.021738192580001,
      "stddev": 0.15637431716814337,
      "median": 5.01291983558,
      "user": 2.8914638999999993,
      "system": 3.17934572,
      "min": 4.759964189080001,
      "max": 5.256393544080001,
      "times": [
        4.820613042080001,
        4.980066762080001,
        5.18902054708,
        4.94295766208,
        5.11293742408,
        5.011284771080001,
        5.256393544080001,
        5.01455490008,
        5.12958908408,
        4.759964189080001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 4.921327098280001,
      "stddev": 0.06363459318877744,
      "median": 4.8995584370800005,
      "user": 2.8826956999999993,
      "system": 3.15194962,
      "min": 4.859091242080001,
      "max": 5.0747441040800005,
      "times": [
        4.884491690080001,
        4.876669549080001,
        4.877268624080001,
        4.958354449080001,
        4.91462518408,
        5.0747441040800005,
        4.884479561080001,
        4.859091242080001,
        4.94990057708,
        4.933646002080001
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12820
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
4,277.12 ms
(+1.09%)Baseline: 4,230.96 ms
5,077.15 ms
(84.24%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
3,175.67 ms
(+5.41%)Baseline: 3,012.56 ms
3,615.07 ms
(87.85%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
1,386.31 ms
(+3.89%)Baseline: 1,334.40 ms
1,601.27 ms
(86.58%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
665.43 ms
(+6.15%)Baseline: 626.85 ms
752.22 ms
(88.46%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
3,950.19 ms
(-1.88%)Baseline: 4,026.03 ms
4,831.23 ms
(81.76%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
6,633.63 ms
(-3.30%)Baseline: 6,860.23 ms
8,232.28 ms
(80.58%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
649.57 ms
(+2.29%)Baseline: 635.05 ms
762.06 ms
(85.24%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12820
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,248.77 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
676.39 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
670.63 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
110.54 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,130.61 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
5,021.74 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
697.15 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit dba2255 into main Jul 6, 2026
34 checks passed
@zkochan
zkochan deleted the pq-with branch July 6, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants