Skip to content

feat(pacquet): add recursive rebuild selection - #13206

Merged
zkochan merged 1 commit into
mainfrom
recursive-rebuild
Jul 22, 2026
Merged

zkochan merged 1 commit into
mainfrom
recursive-rebuild

Conversation

@zkochan

@zkochan zkochan commented Jul 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Related to #13201.

Adds recursive project selection to pacquet's rebuild command so pnpm -r rebuild and filter-promoted rebuilds match the existing TypeScript implementation.

  • Rebuilds only selected importers when the workspace uses a shared lockfile.
  • Rebuilds dedicated-lockfile projects in topological chunks while honoring workspace concurrency and --no-bail.
  • Adds focused coverage for shared lockfiles, dedicated lockfiles, filtering, and continued execution after a project failure.

The TypeScript CLI already has this behavior, so no TypeScript change is needed.

Squash Commit Body

Route recursive rebuilds through workspace project selection instead of rebuilding an unselected state. Shared-lockfile workspaces rebuild the selected importers together, while dedicated-lockfile workspaces rebuild each selected project in topological chunks with workspace concurrency and bail behavior preserved.

Related to pnpm/pnpm#13201.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

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


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features

    • Recursive rebuild now honors workspace filters and rebuild scope, targeting only the selected workspace projects.
    • Recursive rebuild behavior now works consistently with both shared and dedicated lockfile setups.
  • Bug Fixes

    • Script execution during rebuild --recursive is correctly limited to the selected projects.
    • --no-bail handling is improved for recursive rebuilds, including continuation after upstream failures.
  • Tests

    • Added integration coverage for recursive rebuild filtering and failure/continuation scenarios.

Copilot AI review requested due to automatic review settings July 21, 2026 23:20

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.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 98fafb5b-3203-4857-92b7-b818c3bc7d15

📥 Commits

Reviewing files that changed from the base of the PR and between af1be12 and 728503c.

📒 Files selected for processing (9)
  • .changeset/recursive-rebuild.md
  • pnpm/crates/cli/src/cli_args/cli_command.rs
  • pnpm/crates/cli/src/cli_args/dispatch_install.rs
  • pnpm/crates/cli/src/cli_args/global.rs
  • pnpm/crates/cli/src/cli_args/pipelines.rs
  • pnpm/crates/cli/src/cli_args/rebuild.rs
  • pnpm/crates/cli/src/cli_args/tests.rs
  • pnpm/crates/cli/tests/rebuild_recursive.rs
  • pnpm/crates/package-manager/src/install.rs
🚧 Files skipped from review as they are similar to previous changes (9)
  • .changeset/recursive-rebuild.md
  • pnpm/crates/cli/src/cli_args/cli_command.rs
  • pnpm/crates/cli/tests/rebuild_recursive.rs
  • pnpm/crates/cli/src/cli_args/dispatch_install.rs
  • pnpm/crates/cli/src/cli_args/global.rs
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/crates/cli/src/cli_args/pipelines.rs
  • pnpm/crates/cli/src/cli_args/tests.rs
  • pnpm/crates/cli/src/cli_args/rebuild.rs

📝 Walkthrough

Walkthrough

Recursive rebuild now supports workspace-scoped selection for shared and dedicated lockfiles, batches project rebuilds with --no-bail handling, and routes selected projects through the package manager. CLI validation and integration tests are updated.

Changes

Recursive rebuild workspace flow

Layer / File(s) Summary
Workspace selection and selected rebuild API
pnpm/crates/cli/src/cli_args/pipelines.rs, pnpm/crates/package-manager/src/install.rs
Workspace selection is separated from validation, and Install gains a selected rebuild entry point.
Workspace-scoped rebuild execution
pnpm/crates/cli/src/cli_args/rebuild.rs, pnpm/crates/cli/src/cli_args/dispatch_install.rs
Rebuilds compute workspace selections, execute ordered batches, honor --no-bail, and route selected projects through run_selected_rebuild.
Flag validation and rebuild call-site wiring
pnpm/crates/cli/src/cli_args/cli_command.rs, pnpm/crates/cli/src/cli_args/dispatch_install.rs, pnpm/crates/cli/src/cli_args/global.rs
--no-bail is accepted for rebuild, and existing rebuild callers pass the new workspace-selection argument.
Compatibility tests and release metadata
pnpm/crates/cli/src/cli_args/tests.rs, pnpm/crates/cli/tests/rebuild_recursive.rs, .changeset/recursive-rebuild.md
Tests cover filtered rebuilds, lockfile modes, dependency ordering, and no-bail continuation; a minor release changeset is added.

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

Sequence Diagram(s)

sequenceDiagram
  participant CLI as Rebuild CLI
  participant Args as RebuildArgs
  participant Install as Install
  CLI->>Args: run_from_cli(...)
  Args->>Args: select and batch workspace projects
  Args->>Install: run_selected_rebuild(selection, options)
  Install-->>Args: rebuild result
  Args-->>CLI: success or first error
Loading

Possibly related issues

Possibly related PRs

  • pnpm/pnpm#13030 — Shares workspace install-filter selection and selected execution plumbing.
  • pnpm/pnpm#13150 — Modifies the same rebuild selection and dispatch paths.
  • pnpm/pnpm#13151 — Modifies run_rebuild wiring in the same CLI path.

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ 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 recursive-rebuild

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Honor workspace filters for recursive pacquet rebuild (shared + dedicated lockfiles)

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Route recursive rebuild through workspace project selection to honor --filter.
• Handle shared vs dedicated lockfiles; preserve concurrency and --no-bail behavior.
• Add tests and a changeset covering filtering and failure-tolerant recursive rebuilds.
Diagram

graph TD
A["pacquet rebuild (CLI)"] --> B["select_workspace_projects()"] --> C{"Shared lockfile?"}
C -->|"yes"| D["State::init(root)"] --> E["Install.run_selected_rebuild()"]
C -->|"no"| F["Topo groups + concurrency"] --> G["Per-project State::init()"] --> H["Install.run_rebuild()"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Push dedicated-lockfile selection into package-manager install
  • ➕ Keeps CLI thinner by centralizing topological batching and --no-bail handling in one layer
  • ➕ Potentially enables reuse by other commands needing “selected + dedicated lockfiles” execution
  • ➖ Requires more intrusive changes in Install/selection plumbing to support per-project config anchoring
  • ➖ Harder to keep behavior aligned with existing recursive/workspace semantics without duplicating config resolution
2. Reuse existing recursive script runner semantics for rebuild execution
  • ➕ Would naturally inherit established concurrency, ordering, and --no-bail behavior
  • ➕ Avoids bespoke join_all batching logic in the rebuild command
  • ➖ Rebuild is install-pipeline driven (frozen install + rebuild options), not a plain script command
  • ➖ Mapping rebuild selection to script-runner abstractions may be leaky and add indirection

Recommendation: The PR’s approach is a good fit: shared-lockfile rebuilds go through a single selected install run, while dedicated-lockfile rebuilds correctly re-anchor config/state per project and preserve workspace concurrency and --no-bail. The alternatives either require deeper package-manager refactors (higher risk) or force rebuild into a script-runner model that doesn’t naturally represent the install/rebuild pipeline.

Files changed (9) +304 / -23

Enhancement (3) +155 / -17
dispatch_install.rsDispatch rebuild via new CLI-aware rebuild runner +43/-9

Dispatch rebuild via new CLI-aware rebuild runner

• Updates the rebuild dispatcher to call 'RebuildArgs::run_from_cli' with config/paths and recursive flags, enabling workspace project selection and dedicated-lockfile execution behavior.

pnpm/crates/cli/src/cli_args/dispatch_install.rs

rebuild.rsImplement recursive rebuild project selection and dedicated-lockfile batching +97/-8

Implement recursive rebuild project selection and dedicated-lockfile batching

• Adds workspace-aware rebuild execution: compute selected projects, no-op on empty selection, run selected rebuilds in shared-lockfile mode, and run per-project rebuilds in topological/concurrent batches for dedicated lockfiles with '--no-bail' support.

pnpm/crates/cli/src/cli_args/rebuild.rs

install.rsAdd 'Install::run_selected_rebuild' entrypoint +15/-0

Add 'Install::run_selected_rebuild' entrypoint

• Adds a dedicated install pipeline method to run rebuilds constrained to a workspace importer selection, asserting frozen-lockfile mode and threading selection into the inner install run.

pnpm/crates/package-manager/src/install.rs

Bug fix (1) +8 / -1
cli_command.rsAllow '--no-bail' as a global flag for 'rebuild' +8/-1

Allow '--no-bail' as a global flag for 'rebuild'

• Refines global option validation so '--no-bail' is accepted for 'CliCommand::Rebuild' while remaining restricted to script-scoped commands elsewhere.

pnpm/crates/cli/src/cli_args/cli_command.rs

Refactor (2) +15 / -5
global.rsUpdate global approve-builds rebuild call signature +1/-1

Update global approve-builds rebuild call signature

• Adjusts 'run_rebuild' invocation to pass the new optional workspace selection parameter when rebuilding as part of global approve-builds.

pnpm/crates/cli/src/cli_args/global.rs

pipelines.rsExtract reusable workspace project selection helper +14/-4

Extract reusable workspace project selection helper

• Refactors selection logic into 'select_workspace_projects', and reuses it from install-family selection while preserving the shared-lockfile restriction for recursive filtered install-family commands.

pnpm/crates/cli/src/cli_args/pipelines.rs

Tests (2) +121 / -0
tests.rsExtend CLI arg tests for rebuild/no-bail validation +2/-0

Extend CLI arg tests for rebuild/no-bail validation

• Adds coverage ensuring '-r --no-bail rebuild' is accepted and that unrelated flags (e.g., '--resume-from') are rejected for rebuild.

pnpm/crates/cli/src/cli_args/tests.rs

rebuild_recursive.rsAdd integration tests for filtered and no-bail recursive rebuilds +119/-0

Add integration tests for filtered and no-bail recursive rebuilds

• Introduces workspace-level tests validating filtered rebuilds only run selected importers for both shared and dedicated lockfiles, and that dedicated recursive rebuild continues after a failure when '--no-bail' is set.

pnpm/crates/cli/tests/rebuild_recursive.rs

Documentation (1) +5 / -0
recursive-rebuild.mdAdd changeset for recursive rebuild filter behavior +5/-0

Add changeset for recursive rebuild filter behavior

• Introduces a minor-version changeset for 'pacquet' documenting that recursive 'pnpm rebuild' now honors workspace filters across shared and dedicated lockfile modes.

.changeset/recursive-rebuild.md

@greptile-apps

greptile-apps Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Reviews (2): Last reviewed commit: "feat(pacquet): add recursive rebuild sel..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.00     11.0±0.26ms    34.2 MB/sec    1.04     11.4±0.09ms    32.7 MB/sec
packument/parse                1.00     37.3±0.34µs  1779.6 MB/sec    1.00     37.2±0.30µs  1781.9 MB/sec
tarball/download_dependency    1.00      2.3±0.09ms  1920.3 KB/sec    1.02      2.3±0.07ms  1883.7 KB/sec

@qodo-code-review

qodo-code-review Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Unbounded rebuild concurrency 🐞 Bug ⛨ Security ⭐ New
Description
In RebuildArgs::run_from_cli, dedicated-lockfile recursive rebuild uses
cfg.workspace_concurrency to size batches and then runs each batch via join_all, so a
repo-controlled workspaceConcurrency can cause extremely high parallel rebuild/script execution
and exhaust memory/FDs/process limits on large workspaces. This becomes newly reachable because
workspace_concurrency is read from pnpm-workspace.yaml and is not locally capped before being
used to schedule rebuild work.
Code

pnpm/crates/cli/src/cli_args/rebuild.rs[R64-94]

+            let base_config = cfg.clone();
+            let concurrency =
+                usize::try_from(cfg.workspace_concurrency).unwrap_or(usize::MAX).max(1);
+            let mut first_error = None;
+            for group in workspace_selection.ordered_groups {
+                for batch in group.chunks(concurrency) {
+                    let rebuilds = batch.iter().cloned().map(|project_dir| {
+                        let args = self.clone();
+                        let mut project_config = base_config.clone();
+                        anchor_dedicated_project_config(&mut project_config, &project_dir);
+                        async move {
+                            let project_config = Config::leak(project_config);
+                            let state =
+                                State::init(project_dir.join("package.json"), project_config, true)
+                                    .wrap_err_with(|| {
+                                        format!(
+                                            "initialize the rebuild state for {}",
+                                            project_dir.display(),
+                                        )
+                                    })?;
+                            Box::pin(args.run::<Reporter>(state, None)).await
+                        }
+                    });
+                    for result in futures_util::future::join_all(rebuilds).await {
+                        if let Err(error) = result {
+                            if !no_bail {
+                                return Err(error);
+                            }
+                            first_error.get_or_insert(error);
+                        }
+                    }
Evidence
The dedicated-lockfile recursive rebuild path derives concurrency from config and uses it to
create chunks(concurrency) batches which are executed concurrently via join_all.
workspace_concurrency is populated from repo-controlled pnpm-workspace.yaml, and the resolver
keeps positive values unchanged (no clamp), enabling arbitrarily large configured concurrency to
directly affect rebuild scheduling.

pnpm/crates/cli/src/cli_args/rebuild.rs[55-100]
pnpm/crates/config/src/workspace_yaml.rs[1045-1050]
pnpm/crates/config/src/defaults.rs[317-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
`RebuildArgs::run_from_cli` uses `cfg.workspace_concurrency` directly to determine batch size and then executes batches with `futures_util::future::join_all`. Because `workspace_concurrency` is repo-controlled via `pnpm-workspace.yaml` and positive values are not clamped, a malicious or misconfigured workspace can drive very high parallelism (state init + lifecycle rebuilds), leading to resource exhaustion.

### Issue Context
- `workspaceConcurrency` is applied from workspace YAML into `Config::workspace_concurrency`.
- `resolve_child_concurrency` does not clamp positive values.
- The new dedicated-lockfile recursive rebuild path uses this value to schedule concurrent rebuilds.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/rebuild.rs[55-100]

### Suggested fix
- Introduce a practical upper bound before using `workspace_concurrency` for scheduling, e.g. clamp to `available_parallelism()` (or a small multiple) and always to `group.len()`.
- Replace `join_all(rebuilds)` with a bounded-concurrency stream (`futures_util::stream::iter(...).buffer_unordered(concurrency)`) so memory doesn’t scale with batch size and scheduling remains bounded.
- Keep behavior consistent with pnpm where required, but ensure repo-controlled values cannot trigger pathological parallelism.

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


2. Config::leak per project ✓ Resolved 📘 Rule violation ➹ Performance
Description
The dedicated-lockfile recursive rebuild path leaks a new Config instance for every selected
project via Config::leak, retaining each allocation until process exit and potentially driving
high/unbounded memory growth in very large workspaces. This violates performance guidance to avoid
repeated allocations inside common CLI loops, and the retention behavior introduced by the new
rebuild path is currently undocumented despite being implied by State’s &'static Config design.
Code

pnpm/crates/cli/src/cli_args/rebuild.rs[75]

+                            let project_config = Config::leak(project_config);
Evidence
PR Compliance ID 14 calls out avoiding repeated/inefficient work in loops, and the new
dedicated-lockfile recursive rebuild implementation performs Config::leak(project_config) once per
project while iterating workspace projects, creating a permanent allocation each time.
Config::leak is documented as persisting until program termination, and because State stores a
&'static Config, the code explains why the leak exists; however, this still means peak memory
scales with selected project count and the new rebuild path adds another per-project leak site
without documenting the tradeoff that other dedicated-lockfile paths already acknowledge.

CLAUDE.md: Prefer async/await and parallelize independent work; hoist invariants out of loops
pnpm/crates/cli/src/cli_args/rebuild.rs[61-101]
pnpm/crates/cli/src/cli_args/rebuild.rs[64-86]
pnpm/crates/config/src/lib.rs[2526-2529]
pnpm/crates/cli/src/state.rs[16-33]
pnpm/crates/cli/src/state.rs[65-69]
pnpm/crates/cli/src/cli_args/pipelines.rs[470-483]

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 dedicated-lockfile recursive `rebuild` path calls `Config::leak(project_config)` inside the per-project loop/async closure, causing one `Config` allocation per selected project to be retained for the lifetime of the CLI process.

## Issue Context
This code runs across potentially large workspaces, so leaking per project can materially increase peak memory usage (bounded by project count but still problematic at scale). The leak is currently required because `State` stores a `&'static Config`, but the new rebuild path should at minimum document this retention behavior (consistent with other dedicated-lockfile paths such as workspace install), and ideally be positioned for a future refactor that removes the need to leak configs in per-project loops.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/rebuild.rs[61-101]
- pnpm/crates/cli/src/state.rs[16-33]
- pnpm/crates/config/src/lib.rs[2526-2529]
- pnpm/crates/cli/src/cli_args/pipelines.rs[470-483]

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


3. run_selected_rebuild uses assert! 📘 Rule violation ☼ Reliability
Description
Install::run_selected_rebuild() panics with assert! if called without frozen_lockfile,
crashing the process instead of returning a typed error with context. This weakens user-facing error
handling and can turn misuse/edge cases into hard failures.
Code

pnpm/crates/package-manager/src/install.rs[705]

+        assert!(self.frozen_lockfile, "run_selected_rebuild requires frozen_lockfile = true");
Evidence
PR Compliance ID 10 requires explicit, contextual error handling for user-reachable errors and
avoiding uncontrolled failure modes. The new method run_selected_rebuild() introduces a process
panic via assert! on a runtime precondition rather than returning a handled error.

CLAUDE.md: Use PnpmError for user-reachable errors and handle errors explicitly with context
pnpm/crates/package-manager/src/install.rs[699-712]

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

## Issue description
`run_selected_rebuild()` uses `assert!(self.frozen_lockfile, ...)`, which panics and aborts the command instead of returning an `InstallError` with context.

## Issue Context
Compliance guidance requires explicit, contextual error handling for user-reachable paths; panics are not stable error UX.

## Fix Focus Areas
- pnpm/crates/package-manager/src/install.rs[699-712]

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


View more (1)
4. Bail waits batch completion 🐞 Bug ➹ Performance
Description
In dedicated-lockfile recursive rebuilds, join_all(rebuilds).await completes the entire
concurrency batch before any error is acted on, so fail-fast mode (--no-bail not set) still runs
and waits for every project in the batch after a failure. This slows failure exits and wastes work
by continuing lifecycle-script rebuilds that could be skipped once the rebuild is already failing.
Code

pnpm/crates/cli/src/cli_args/rebuild.rs[R87-94]

+                    for result in futures_util::future::join_all(rebuilds).await {
+                        if let Err(error) = result {
+                            if !no_bail {
+                                return Err(error);
+                            }
+                            first_error.get_or_insert(error);
+                        }
+                    }
Evidence
The code awaits join_all(rebuilds) and only afterward checks result for errors; therefore it
cannot return early on the first failure within a batch when no_bail is false.

pnpm/crates/cli/src/cli_args/rebuild.rs[61-95]

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

### Issue description
Dedicated-lockfile recursive rebuild uses `futures_util::future::join_all(rebuilds).await` and only then inspects errors. This means `--no-bail` *off* does not behave as a true fail-fast within a batch: the command still waits for all concurrently-started rebuilds in the batch to finish and potentially runs more scripts than necessary.

### Issue Context
This affects the new dedicated-lockfile path in `RebuildArgs::run_from_cli`, where projects are rebuilt in topological groups and then chunked by `workspace_concurrency`.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/rebuild.rs[61-95]

Possible implementation direction:
- When `no_bail == false`, use a fail-fast combinator (`try_join_all`) or a `FuturesUnordered` loop that returns on the first `Err`, dropping the remaining futures.
- Keep the current collect-first-error behavior only when `no_bail == true`.
- Ensure the chosen approach is cancellation-safe for the underlying rebuild work (dropping futures should not leave child processes running unexpectedly).

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



Informational

5. No-bail ignores recursive mode 🐞 Bug ≡ Correctness ⭐ New
Description
validate_no_bail_global_option accepts --no-bail for rebuild unconditionally, even though the
flag is documented as “Recursive only,” so pacquet rebuild --no-bail is accepted but has no effect
when not running recursively (and may be inert in some rebuild modes). This can mislead
automation/users into believing fail/continue semantics are being applied when they aren’t.
Code

pnpm/crates/cli/src/cli_args/cli_command.rs[R297-302]

+    fn validate_no_bail_global_option(&self) -> Result<(), clap::Error> {
+        if matches!(self.command, CliCommand::Rebuild(_)) {
+            return Ok(());
+        }
+        self.validate_run_scoped_global_option("--no-bail")
+    }
Evidence
The flag is explicitly documented as recursive-only, but validation bypasses checks for rebuild
and does not consult the recursive flag, allowing non-recursive invocations to pass validation
despite the flag having no effect in that mode.

pnpm/crates/cli/src/cli_args/cli_command.rs[189-203]
pnpm/crates/cli/src/cli_args/cli_command.rs[297-302]
pnpm/crates/cli/src/cli_args/rebuild.rs[47-106]

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

### Issue description
`--no-bail` is documented as “Recursive only,” but validation now allows it for `rebuild` regardless of whether `-r/--recursive` is set. In non-recursive rebuild, the flag is silently ignored.

### Issue Context
- `no_bail` is documented as recursive-only.
- Validation special-cases `Rebuild` without checking `self.recursive`.
- Rebuild’s `no_bail` behavior is only wired into the dedicated-lockfile recursive loop.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/cli_command.rs[297-302]

### Suggested fix
- Require `self.recursive` when `self.command` is `CliCommand::Rebuild(_)` (otherwise return `unexpected_argument_error("--no-bail")`).
- Alternatively, update parsing/UX to make `--no-bail` a rebuild subcommand flag (or document explicitly when it is inert).

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


Grey Divider

Previous review results

Review updated until commit 728503c

Results up to commit af1be12 ⚖️ Balanced


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


Remediation recommended
1. Config::leak per project 📘 Rule violation ➹ Performance
Description
The dedicated-lockfile recursive rebuild path leaks a new Config instance for every selected
project via Config::leak, retaining each allocation until process exit and potentially driving
high/unbounded memory growth in very large workspaces. This violates performance guidance to avoid
repeated allocations inside common CLI loops, and the retention behavior introduced by the new
rebuild path is currently undocumented despite being implied by State’s &'static Config design.
Code

pnpm/crates/cli/src/cli_args/rebuild.rs[75]

+                            let project_config = Config::leak(project_config);
Evidence
PR Compliance ID 14 calls out avoiding repeated/inefficient work in loops, and the new
dedicated-lockfile recursive rebuild implementation performs Config::leak(project_config) once per
project while iterating workspace projects, creating a permanent allocation each time.
Config::leak is documented as persisting until program termination, and because State stores a
&'static Config, the code explains why the leak exists; however, this still means peak memory
scales with selected project count and the new rebuild path adds another per-project leak site
without documenting the tradeoff that other dedicated-lockfile paths already acknowledge.

CLAUDE.md: Prefer async/await and parallelize independent work; hoist invariants out of loops
pnpm/crates/cli/src/cli_args/rebuild.rs[61-101]
pnpm/crates/cli/src/cli_args/rebuild.rs[64-86]
pnpm/crates/config/src/lib.rs[2526-2529]
pnpm/crates/cli/src/state.rs[16-33]
pnpm/crates/cli/src/state.rs[65-69]
pnpm/crates/cli/src/cli_args/pipelines.rs[470-483]

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 dedicated-lockfile recursive `rebuild` path calls `Config::leak(project_config)` inside the per-project loop/async closure, causing one `Config` allocation per selected project to be retained for the lifetime of the CLI process.

## Issue Context
This code runs across potentially large workspaces, so leaking per project can materially increase peak memory usage (bounded by project count but still problematic at scale). The leak is currently required because `State` stores a `&'static Config`, but the new rebuild path should at minimum document this retention behavior (consistent with other dedicated-lockfile paths such as workspace install), and ideally be positioned for a future refactor that removes the need to leak configs in per-project loops.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/rebuild.rs[61-101]
- pnpm/crates/cli/src/state.rs[16-33]
- pnpm/crates/config/src/lib.rs[2526-2529]
- pnpm/crates/cli/src/cli_args/pipelines.rs[470-483]

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


2. run_selected_rebuild uses assert! 📘 Rule violation ☼ Reliability
Description
Install::run_selected_rebuild() panics with assert! if called without frozen_lockfile,
crashing the process instead of returning a typed error with context. This weakens user-facing error
handling and can turn misuse/edge cases into hard failures.
Code

pnpm/crates/package-manager/src/install.rs[705]

+        assert!(self.frozen_lockfile, "run_selected_rebuild requires frozen_lockfile = true");
Evidence
PR Compliance ID 10 requires explicit, contextual error handling for user-reachable errors and
avoiding uncontrolled failure modes. The new method run_selected_rebuild() introduces a process
panic via assert! on a runtime precondition rather than returning a handled error.

CLAUDE.md: Use PnpmError for user-reachable errors and handle errors explicitly with context
pnpm/crates/package-manager/src/install.rs[699-712]

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

## Issue description
`run_selected_rebuild()` uses `assert!(self.frozen_lockfile, ...)`, which panics and aborts the command instead of returning an `InstallError` with context.

## Issue Context
Compliance guidance requires explicit, contextual error handling for user-reachable paths; panics are not stable error UX.

## Fix Focus Areas
- pnpm/crates/package-manager/src/install.rs[699-712]

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


3. Bail waits batch completion 🐞 Bug ➹ Performance
Description
In dedicated-lockfile recursive rebuilds, join_all(rebuilds).await completes the entire
concurrency batch before any error is acted on, so fail-fast mode (--no-bail not set) still runs
and waits for every project in the batch after a failure. This slows failure exits and wastes work
by continuing lifecycle-script rebuilds that could be skipped once the rebuild is already failing.
Code

pnpm/crates/cli/src/cli_args/rebuild.rs[R87-94]

+                    for result in futures_util::future::join_all(rebuilds).await {
+                        if let Err(error) = result {
+                            if !no_bail {
+                                return Err(error);
+                            }
+                            first_error.get_or_insert(error);
+                        }
+                    }
Evidence
The code awaits join_all(rebuilds) and only afterward checks result for errors; therefore it
cannot return early on the first failure within a batch when no_bail is false.

pnpm/crates/cli/src/cli_args/rebuild.rs[61-95]

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

### Issue description
Dedicated-lockfile recursive rebuild uses `futures_util::future::join_all(rebuilds).await` and only then inspects errors. This means `--no-bail` *off* does not behave as a true fail-fast within a batch: the command still waits for all concurrently-started rebuilds in the batch to finish and potentially runs more scripts than necessary.

### Issue Context
This affects the new dedicated-lockfile path in `RebuildArgs::run_from_cli`, where projects are rebuilt in topological groups and then chunked by `workspace_concurrency`.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/rebuild.rs[61-95]

Possible implementation direction:
- When `no_bail == false`, use a fail-fast combinator (`try_join_all`) or a `FuturesUnordered` loop that returns on the first `Err`, dropping the remaining futures.
- Keep the current collect-first-error behavior only when `no_bail == true`.
- Ensure the chosen approach is cancellation-safe for the underlying rebuild work (dropping futures should not leave child processes running unexpectedly).

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


Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 21, 2026
@codecov-commenter

codecov-commenter commented Jul 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.68874% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.88%. Comparing base (b67b1a9) to head (728503c).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/cli/src/cli_args/rebuild.rs 93.42% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13206      +/-   ##
==========================================
+ Coverage   86.87%   86.88%   +0.01%     
==========================================
  Files         526      526              
  Lines       89826    89954     +128     
==========================================
+ Hits        78039    78161     +122     
- Misses      11787    11793       +6     

☔ 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.

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: af1be1286c23

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

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.643 ± 0.154 2.446 2.913 1.69 ± 0.19
pacquet@main 2.692 ± 0.223 2.425 3.024 1.72 ± 0.22
pnpr@HEAD 1.570 ± 0.197 1.363 1.803 1.00 ± 0.16
pnpr@main 1.565 ± 0.154 1.378 1.798 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6425028772799997,
      "stddev": 0.1538789922910169,
      "median": 2.61617317798,
      "user": 2.10130662,
      "system": 1.62836204,
      "min": 2.44578385848,
      "max": 2.9131235974800003,
      "times": [
        2.67882076948,
        2.83727848948,
        2.9131235974800003,
        2.62610058848,
        2.45817700348,
        2.74839705848,
        2.44578385848,
        2.5521095654800003,
        2.55899207448,
        2.60624576748
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.69244036038,
      "stddev": 0.22289192131798435,
      "median": 2.67410214548,
      "user": 2.0576659200000003,
      "system": 1.65066274,
      "min": 2.4245063144800003,
      "max": 3.02378258148,
      "times": [
        2.7595736094800003,
        2.4245063144800003,
        2.45329265948,
        2.87981800248,
        2.78890837548,
        2.97329646448,
        2.57845353948,
        2.58863068148,
        3.02378258148,
        2.45414137548
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5701002818799998,
      "stddev": 0.19653530687768128,
      "median": 1.56679437848,
      "user": 1.2195794199999999,
      "system": 1.30271014,
      "min": 1.3631646914800002,
      "max": 1.80344872848,
      "times": [
        1.77246633248,
        1.74141853748,
        1.38015044548,
        1.3706992874800001,
        1.4318108384800001,
        1.3631646914800002,
        1.70177791848,
        1.38398665548,
        1.80344872848,
        1.7520793834800001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5650196047799998,
      "stddev": 0.15443478661349944,
      "median": 1.48729140648,
      "user": 1.3190565200000002,
      "system": 1.43970064,
      "min": 1.37834312148,
      "max": 1.79790937148,
      "times": [
        1.46598227348,
        1.72607711748,
        1.71192209148,
        1.37834312148,
        1.79790937148,
        1.42990135148,
        1.48144612848,
        1.49313668448,
        1.44635649948,
        1.71912140848
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 436.5 ± 95.8 331.1 604.3 1.30 ± 0.29
pacquet@main 350.9 ± 33.3 315.9 414.0 1.05 ± 0.11
pnpr@HEAD 335.7 ± 13.7 314.0 357.3 1.00
pnpr@main 398.3 ± 36.7 340.8 467.1 1.19 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.43654247869999996,
      "stddev": 0.0957763293747178,
      "median": 0.43194730800000003,
      "user": 0.39921594,
      "system": 0.7382555000000001,
      "min": 0.331123343,
      "max": 0.604321236,
      "times": [
        0.45967534600000004,
        0.36129288700000006,
        0.514949428,
        0.604321236,
        0.40421927,
        0.347058603,
        0.539791052,
        0.46775744100000005,
        0.331123343,
        0.335236181
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.35092378190000006,
      "stddev": 0.03330374118732216,
      "median": 0.34101791300000006,
      "user": 0.29029734,
      "system": 0.648931,
      "min": 0.31593007700000003,
      "max": 0.41403190700000003,
      "times": [
        0.35599865900000005,
        0.331295716,
        0.33044948700000004,
        0.371576569,
        0.32899481300000005,
        0.39385518700000005,
        0.31593007700000003,
        0.35074011000000005,
        0.41403190700000003,
        0.316365294
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.33572891450000003,
      "stddev": 0.013710898135919476,
      "median": 0.33525841850000004,
      "user": 0.28980323999999996,
      "system": 0.6311351000000001,
      "min": 0.314025741,
      "max": 0.35729201000000005,
      "times": [
        0.32242074200000004,
        0.33283302600000003,
        0.322246921,
        0.314025741,
        0.347900034,
        0.33929787400000005,
        0.33438735700000005,
        0.35075596000000003,
        0.33612948000000004,
        0.35729201000000005
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.39829569260000003,
      "stddev": 0.03668850461816764,
      "median": 0.3973352345000001,
      "user": 0.3336605399999999,
      "system": 0.69194,
      "min": 0.340791999,
      "max": 0.46707142600000007,
      "times": [
        0.40185047800000007,
        0.39281999100000003,
        0.428116176,
        0.37543394500000005,
        0.41318344,
        0.340791999,
        0.419579968,
        0.38895536,
        0.46707142600000007,
        0.35515414300000003
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.871 ± 0.038 2.816 2.958 1.73 ± 0.20
pacquet@main 2.896 ± 0.116 2.793 3.147 1.74 ± 0.21
pnpr@HEAD 1.717 ± 0.125 1.529 1.921 1.03 ± 0.14
pnpr@main 1.660 ± 0.189 1.448 1.955 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.8711165547200004,
      "stddev": 0.03756056110116395,
      "median": 2.86809600622,
      "user": 1.9771604799999998,
      "system": 1.51889898,
      "min": 2.81626093322,
      "max": 2.95803193522,
      "times": [
        2.86928246022,
        2.95803193522,
        2.89658658022,
        2.81626093322,
        2.87089128322,
        2.86647137922,
        2.86690955222,
        2.87745386422,
        2.8445408752200003,
        2.84473668422
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.89595749272,
      "stddev": 0.11633904339975372,
      "median": 2.8536972787200003,
      "user": 1.9818622799999996,
      "system": 1.50382738,
      "min": 2.79272105522,
      "max": 3.14735090922,
      "times": [
        2.88298759122,
        2.85284321422,
        2.8582961082200002,
        2.83077238722,
        2.79272105522,
        2.82535346522,
        2.8545513432200003,
        2.84327780222,
        3.07142105122,
        3.14735090922
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.7170505634200002,
      "stddev": 0.12524372696048902,
      "median": 1.72763882972,
      "user": 1.2789970799999997,
      "system": 1.35123638,
      "min": 1.52940745422,
      "max": 1.9208266582200002,
      "times": [
        1.58966410622,
        1.77657975622,
        1.6847962122200002,
        1.8419868132200001,
        1.9208266582200002,
        1.61594905122,
        1.63403596222,
        1.8067781732200001,
        1.52940745422,
        1.7704814472200001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.65965908582,
      "stddev": 0.18901624907166792,
      "median": 1.6079451267200002,
      "user": 1.28481518,
      "system": 1.3664857799999999,
      "min": 1.4476596482200002,
      "max": 1.95483666722,
      "times": [
        1.95483666722,
        1.46418574522,
        1.62153270922,
        1.8225384452200002,
        1.94825241722,
        1.54268883122,
        1.68684562322,
        1.51369322722,
        1.5943575442200002,
        1.4476596482200002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 701.5 ± 93.7 632.3 939.2 2.20 ± 0.30
pacquet@main 644.1 ± 16.9 622.0 666.5 2.02 ± 0.07
pnpr@HEAD 320.8 ± 9.7 307.5 337.0 1.01 ± 0.04
pnpr@main 319.0 ± 7.4 309.1 333.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.7015422953000001,
      "stddev": 0.09374308529904171,
      "median": 0.6634034557,
      "user": 0.85836008,
      "system": 0.7567520400000001,
      "min": 0.6323312342,
      "max": 0.9392364462,
      "times": [
        0.9392364462,
        0.7243440712,
        0.7708805122,
        0.6613896672,
        0.6363133152,
        0.6323312342,
        0.6654172442,
        0.6531923972,
        0.6509970932,
        0.6813209722
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.6441031426999999,
      "stddev": 0.016876579320385093,
      "median": 0.6479676312,
      "user": 0.77311508,
      "system": 0.7149289399999998,
      "min": 0.6219777622,
      "max": 0.6664967222,
      "times": [
        0.6543126122,
        0.6242140252,
        0.6545378642,
        0.6657840632,
        0.6478644672,
        0.6294481472,
        0.6283249682000001,
        0.6219777622,
        0.6480707952,
        0.6664967222
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3207825267,
      "stddev": 0.009723903147871214,
      "median": 0.3220359677,
      "user": 0.21464057999999997,
      "system": 0.53078614,
      "min": 0.3074673822,
      "max": 0.3370338092,
      "times": [
        0.3370338092,
        0.3255271202,
        0.3259943002,
        0.3306481322,
        0.3114411282,
        0.3074673822,
        0.3086662742,
        0.3197031502,
        0.3169751852,
        0.3243687852
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.31895959230000004,
      "stddev": 0.007403464753860902,
      "median": 0.3181300807,
      "user": 0.19501657999999997,
      "system": 0.55670404,
      "min": 0.3091215902,
      "max": 0.3339237162,
      "times": [
        0.3187548892,
        0.3140525532,
        0.3118169142,
        0.3091215902,
        0.3206417342,
        0.32666643219999997,
        0.3226052622,
        0.31750527219999997,
        0.3145075592,
        0.3339237162
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.002 ± 0.063 1.947 2.131 6.29 ± 0.29
pacquet@main 1.949 ± 0.031 1.908 2.009 6.12 ± 0.22
pnpr@HEAD 0.338 ± 0.021 0.315 0.385 1.06 ± 0.07
pnpr@main 0.318 ± 0.010 0.303 0.333 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.00184055246,
      "stddev": 0.06297530600098011,
      "median": 1.98437764836,
      "user": 1.05037224,
      "system": 0.8523192399999999,
      "min": 1.94652719286,
      "max": 2.13124743186,
      "times": [
        1.98768434586,
        1.97233755286,
        1.94652719286,
        1.95763569286,
        1.9990085408600002,
        1.95378771286,
        1.98745834086,
        1.98129695586,
        2.10142175786,
        2.13124743186
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.94856286416,
      "stddev": 0.031305410091338054,
      "median": 1.9468969828600002,
      "user": 1.0200142399999998,
      "system": 0.75523704,
      "min": 1.9075669668600002,
      "max": 2.0088823808600003,
      "times": [
        1.9075669668600002,
        1.9649958598600001,
        2.0088823808600003,
        1.98071466186,
        1.95634368586,
        1.93691138686,
        1.9521974048600002,
        1.91125562686,
        1.92516410686,
        1.94159656086
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.33751210186,
      "stddev": 0.020990485196927755,
      "median": 0.33455997986,
      "user": 0.22077764000000002,
      "system": 0.56412544,
      "min": 0.31460978286,
      "max": 0.38482466986,
      "times": [
        0.31697772086000003,
        0.33973032786,
        0.32329013086,
        0.33887229686000003,
        0.33024766286,
        0.31460978286,
        0.32790404986,
        0.35791115586,
        0.34075322086,
        0.38482466986
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.31830904206,
      "stddev": 0.010386475628340008,
      "median": 0.31788361886,
      "user": 0.20705703999999997,
      "system": 0.5311200399999999,
      "min": 0.30343923586,
      "max": 0.33273024686,
      "times": [
        0.33273024686,
        0.31662235386,
        0.31036927586,
        0.32869246086,
        0.32742458986,
        0.32694194286,
        0.30490402786,
        0.30343923586,
        0.31914488386,
        0.31282140286
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 360.1 ± 13.4 346.3 386.0 3.98 ± 0.18
pacquet@main 407.1 ± 15.2 377.8 427.0 4.50 ± 0.20
pnpr@HEAD 90.4 ± 2.2 86.5 93.8 1.00
pnpr@main 90.7 ± 4.0 85.4 104.8 1.00 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.3601028193200001,
      "stddev": 0.013427633374640927,
      "median": 0.35516820222,
      "user": 0.35117042,
      "system": 0.05863752,
      "min": 0.34631628672000003,
      "max": 0.38602732472000006,
      "times": [
        0.37899275672000005,
        0.35727568672000004,
        0.35306071772000003,
        0.36699208172000003,
        0.34631628672000003,
        0.35264202172000003,
        0.35105779472000004,
        0.34745419472000005,
        0.36120932772000003,
        0.38602732472000006
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.4071422106200001,
      "stddev": 0.015199879182101304,
      "median": 0.4088463452200001,
      "user": 0.3912847200000001,
      "system": 0.07199542,
      "min": 0.37782911172000005,
      "max": 0.42704361372000005,
      "times": [
        0.40309343672000003,
        0.42438636072,
        0.42704361372000005,
        0.40611327072000003,
        0.41153299272000005,
        0.37782911172000005,
        0.38722953272000005,
        0.41650109672,
        0.40886538072000006,
        0.40882730972000003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09041873965548389,
      "stddev": 0.002171484562422414,
      "median": 0.09083712572000001,
      "user": 0.021956565161290315,
      "system": 0.011015987096774194,
      "min": 0.08649813372000001,
      "max": 0.09381337672000001,
      "times": [
        0.09083712572000001,
        0.09051512072000001,
        0.08947368472000002,
        0.09350966572000001,
        0.09055171872000001,
        0.08892087472000001,
        0.09369898272000002,
        0.08882577672000001,
        0.08765607972000002,
        0.09114575572000001,
        0.08649813372000001,
        0.08732925472000001,
        0.08807572772000001,
        0.09105544572000002,
        0.09093865672000001,
        0.08802193672000001,
        0.09126947772,
        0.09091996072000001,
        0.09366761272000002,
        0.09143021872000001,
        0.08955088872000001,
        0.08825295972000001,
        0.09202589872000001,
        0.09155231872000001,
        0.09350604972000001,
        0.09335317172000002,
        0.09381337672000001,
        0.09162898272000002,
        0.08949264972000001,
        0.08673426772000001,
        0.08872915472000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.0906797895587097,
      "stddev": 0.0040276745952421734,
      "median": 0.09049139572,
      "user": 0.02095988774193548,
      "system": 0.011883406451612904,
      "min": 0.08535794172000001,
      "max": 0.10475993272000002,
      "times": [
        0.09178015572,
        0.08766189872,
        0.09059315672000001,
        0.08766267172000002,
        0.08657616972000001,
        0.08739987772,
        0.08628261772000001,
        0.08769892972000001,
        0.08535794172000001,
        0.08882303172000001,
        0.09057929072000001,
        0.08726336072000002,
        0.08736963072000001,
        0.08749118872000002,
        0.09270593672,
        0.09358547972000002,
        0.08902244672000001,
        0.08853474872000001,
        0.09214528272000001,
        0.09383189172,
        0.10475993272000002,
        0.09846629872000001,
        0.08897560672000002,
        0.08776748772000001,
        0.09298774572000001,
        0.09184029072000001,
        0.09130100672000001,
        0.09266786472,
        0.09408465572000001,
        0.09536548272,
        0.09049139572
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.563 ± 0.082 4.505 4.784 1.26 ± 0.04
pacquet@main 4.661 ± 0.161 4.469 4.898 1.29 ± 0.06
pnpr@HEAD 3.610 ± 0.105 3.466 3.761 1.00
pnpr@main 3.691 ± 0.110 3.516 3.822 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.56294954398,
      "stddev": 0.08206836804895609,
      "median": 4.5357652993799995,
      "user": 1.9811421,
      "system": 1.52813006,
      "min": 4.50540190888,
      "max": 4.78357193188,
      "times": [
        4.6025672988799995,
        4.52481077388,
        4.52889868388,
        4.50540190888,
        4.541296055879999,
        4.78357193188,
        4.55602320488,
        4.51309108488,
        4.53023454288,
        4.54359995388
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.6610575804800005,
      "stddev": 0.16118252146305131,
      "median": 4.62653486988,
      "user": 1.9939809999999998,
      "system": 1.56146886,
      "min": 4.46932949188,
      "max": 4.89760685988,
      "times": [
        4.62177622688,
        4.87262555088,
        4.59435911588,
        4.52483089588,
        4.63129351288,
        4.67706556788,
        4.47289435988,
        4.89760685988,
        4.84879422288,
        4.46932949188
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.61047789288,
      "stddev": 0.10524550744048092,
      "median": 3.63714912988,
      "user": 1.3836181999999997,
      "system": 1.3962956599999998,
      "min": 3.46550328088,
      "max": 3.76110256888,
      "times": [
        3.48864711188,
        3.48109987188,
        3.6647505178800004,
        3.5649250388800002,
        3.76110256888,
        3.46550328088,
        3.65199454088,
        3.7207080878800003,
        3.62230371888,
        3.68374419088
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.6910700346800005,
      "stddev": 0.10953539016721377,
      "median": 3.69894540538,
      "user": 1.4847345999999997,
      "system": 1.46521246,
      "min": 3.5163713388800004,
      "max": 3.82211971288,
      "times": [
        3.7273639218800003,
        3.81616410588,
        3.67052688888,
        3.53071430588,
        3.66489285388,
        3.5163713388800004,
        3.7419700448800004,
        3.7914422928800002,
        3.62913488088,
        3.82211971288
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13206
Testbedpacquet

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
isolated-linker.fresh-restore.hot-cache.hot-storeLatency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
331.12 ms
(+23.71%)Baseline: 267.67 ms
321.21 ms
(103.09%)

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
2,816.26 ms
(+1.26%)Baseline: 2,781.18 ms
3,337.42 ms
(84.38%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,946.53 ms
(+0.05%)Baseline: 1,945.57 ms
2,334.69 ms
(83.37%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
632.33 ms
(+0.97%)Baseline: 626.28 ms
751.54 ms
(84.14%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
346.32 ms
(-7.21%)Baseline: 373.22 ms
447.86 ms
(77.33%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,445.78 ms
(+1.52%)Baseline: 2,409.16 ms
2,891.00 ms
(84.60%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,505.40 ms
(+0.79%)Baseline: 4,469.99 ms
5,363.99 ms
(83.99%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
🚨 view alert (🔔)
331.12 ms
(+23.71%)Baseline: 267.67 ms
321.21 ms
(103.09%)

🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan force-pushed the recursive-rebuild branch from af1be12 to 728503c Compare July 22, 2026 05:40
Copilot AI review requested due to automatic review settings July 22, 2026 05:40

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-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 728503c

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan
zkochan merged commit ea75ed7 into main Jul 22, 2026
32 checks passed
@zkochan
zkochan deleted the recursive-rebuild branch July 22, 2026 05:50
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