feat(pacquet): add --ignore-scripts to install#12454
Conversation
`pacquet install` runs the dependency build phase on the fresh-lockfile path (since #12436), so a project with blocked build scripts (e.g. sharp, esbuild) fails with `ERR_PNPM_IGNORED_BUILDS` under the default `strictDepBuilds`. pnpm's answer is `--ignore-scripts`; pacquet had no equivalent, so there was no way to install such a project without approving every build. Add `--ignore-scripts`, mirroring pnpm: a `Config.ignore_scripts` field fed by the CLI flag (merged enable-only at the Install dispatch, like `--frozen-store`). When set, the during-install build loop bypasses its allow-build gate entirely — no script runs and nothing is recorded as an ignored build, so the install no longer fails under `strictDepBuilds`. Patches still apply, and the project's own lifecycle scripts are skipped too, matching pnpm's `ignoreScripts`. This also unblocks the vlt.sh benchmark, whose pacquet command was the only one missing the `--ignore-scripts` the pnpm command already passes, making pacquet show up as DNF on every fixture.
Code Review by Qodo
1.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds Changes--ignore-scripts feature end-to-end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
PR Summary by QodoAdd --ignore-scripts to pacquet install (pnpm-compatible behavior) WalkthroughsDescription• Add pacquet install --ignore-scripts to suppress dependency and project lifecycle scripts. • Bypass ignored-build collection so strictDepBuilds won’t raise ERR_PNPM_IGNORED_BUILDS. • Add unit + CLI tests covering ignored-build behavior and lifecycle script suppression. Diagramgraph TD
A["pacquet CLI"] --> B["InstallArgs (--ignore-scripts)"] --> C["CLI dispatch merge"] --> D[("Config.ignore_scripts")] --> E["Install pipeline"] --> F["BuildModules (build loop)"] --> H["ignoredBuilds set"]
D --> G["Project lifecycle scripts"]
F --> G
High-Level AssessmentThe following are alternative approaches to this PR: 1. Map --ignore-scripts to strictDepBuilds=false
2. Skip scripts but still populate ignoredBuilds (don’t fail)
Recommendation: Keep the PR’s current approach: treat File ChangesEnhancement (6)
Tests (3)
|
…ml/env Two follow-ups from PR review: - Git and git-hosted-tarball dependencies were fetched with `ignore_scripts: false` hardcoded, so their `prepare` script still ran during install even under `--ignore-scripts`. Thread `config.ignore_scripts` into `GitFetcher` / `GitHostedTarballFetcher`, and flip the git store-index key's `built` dimension to `!ignore_scripts` at both the write site (`install_package_by_snapshot`) and the warm-prefetch site (`snapshot_cache_key`) so the two stay in lock-step and address the same slot. - `Config.ignore_scripts` was only set by the CLI flag; `ignoreScripts` in `pnpm-workspace.yaml` and `PNPM_CONFIG_IGNORE_SCRIPTS` were silently dropped. Wire it through `WorkspaceSettings` + `apply_to` and the env overlay, mirroring `strictDepBuilds`.
|
Code review by qodo was updated up to the latest commit 6492995 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12454 +/- ##
==========================================
+ Coverage 88.00% 88.02% +0.02%
==========================================
Files 308 308
Lines 41418 41438 +20
==========================================
+ Hits 36448 36476 +28
+ Misses 4970 4962 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Micro-Benchmark ResultsLinux |
Integrated-Benchmark Report (Linux)Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.275508483960001,
"stddev": 0.1230199108876675,
"median": 4.21764453516,
"user": 4.115974999999999,
"system": 3.462112559999999,
"min": 4.14023865566,
"max": 4.434791377660001,
"times": [
4.41957900666,
4.434791377660001,
4.42864382566,
4.17676131666,
4.373981742660001,
4.22096236566,
4.19641441166,
4.149385432660001,
4.14023865566,
4.21432670466
]
},
{
"command": "pacquet@main",
"mean": 4.267578029160001,
"stddev": 0.14142806817970627,
"median": 4.22265395216,
"user": 4.1522542,
"system": 3.4567897599999995,
"min": 4.071509386660001,
"max": 4.53964311066,
"times": [
4.249514550660001,
4.1928406786600005,
4.3108781376600005,
4.17748889966,
4.47812487966,
4.53964311066,
4.071509386660001,
4.2104727436600005,
4.226155261660001,
4.21915264266
]
},
{
"command": "pnpr@HEAD",
"mean": 2.15525635456,
"stddev": 0.17994723233776005,
"median": 2.14009635816,
"user": 2.7678242,
"system": 2.92332506,
"min": 1.9671724476599999,
"max": 2.41680236466,
"times": [
2.04264973366,
2.41680236466,
2.29963967466,
1.9898454866600002,
2.38391106966,
1.99337845166,
2.24783306566,
2.23754298266,
1.9671724476599999,
1.97378826866
]
},
{
"command": "pnpr@main",
"mean": 2.21553293906,
"stddev": 0.17435404924226766,
"median": 2.20404064166,
"user": 2.7580451999999993,
"system": 2.8880944599999996,
"min": 1.96766880866,
"max": 2.51973967066,
"times": [
2.05140431166,
2.51973967066,
2.27691976766,
2.05345286266,
1.96766880866,
2.38660655066,
2.3666689496599997,
2.17216639166,
2.12478718566,
2.23591489166
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6415175972,
"stddev": 0.010063001061014923,
"median": 0.6385365362,
"user": 0.38652053999999997,
"system": 1.32276192,
"min": 0.6293475152,
"max": 0.6610397842,
"times": [
0.6441062362,
0.6535153872,
0.6475681032,
0.6359760822,
0.6293475152,
0.6410969902,
0.6610397842,
0.6347141472,
0.6348659082,
0.6329458182
]
},
{
"command": "pacquet@main",
"mean": 0.6453401181,
"stddev": 0.016878981217364634,
"median": 0.6402136897,
"user": 0.38593734,
"system": 1.33173902,
"min": 0.6280682282,
"max": 0.6803743252,
"times": [
0.6409134882,
0.6395138912,
0.6303170112,
0.6313699042,
0.6325878912,
0.6545337752,
0.6565804452,
0.6591422212,
0.6280682282,
0.6803743252
]
},
{
"command": "pnpr@HEAD",
"mean": 0.7345697271,
"stddev": 0.13931752126104033,
"median": 0.6903775687,
"user": 0.41026444,
"system": 1.37049642,
"min": 0.6667543992,
"max": 1.1282069932,
"times": [
0.6822880862,
0.6829673032,
0.6932226762,
0.6963793512,
0.6667543992,
0.6875324612,
0.6978832452,
0.6798248212,
1.1282069932,
0.7306379342
]
},
{
"command": "pnpr@main",
"mean": 0.717258234,
"stddev": 0.03184041178818746,
"median": 0.7051701212,
"user": 0.40856773999999996,
"system": 1.3671607199999998,
"min": 0.6821498672,
"max": 0.7807257762,
"times": [
0.6962543652000001,
0.6999884452,
0.6952948782,
0.7501419692,
0.7458155172,
0.7103517972,
0.6910880022,
0.7807257762,
0.6821498672,
0.7207717222
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.31664539684,
"stddev": 0.050791197054236854,
"median": 4.33301975444,
"user": 3.9284382400000006,
"system": 3.3135919399999993,
"min": 4.23699236394,
"max": 4.3799210109399995,
"times": [
4.36839560494,
4.249150247939999,
4.35821845294,
4.23699236394,
4.33939741994,
4.2847114589399995,
4.3799210109399995,
4.27821664394,
4.3448086759399995,
4.32664208894
]
},
{
"command": "pacquet@main",
"mean": 4.308814524640001,
"stddev": 0.037804329570098966,
"median": 4.31587117944,
"user": 3.903358339999999,
"system": 3.32354734,
"min": 4.21758701694,
"max": 4.359113454939999,
"times": [
4.30284782694,
4.32276689494,
4.3295025869399995,
4.3308856129399995,
4.3000241379399995,
4.28838850794,
4.21758701694,
4.32805374294,
4.3089754639399995,
4.359113454939999
]
},
{
"command": "pnpr@HEAD",
"mean": 2.09647864424,
"stddev": 0.07790815723253594,
"median": 2.08161855994,
"user": 2.5836913399999997,
"system": 2.8480049399999996,
"min": 1.99311409694,
"max": 2.2407476549400003,
"times": [
2.13139757694,
2.03977451494,
2.19674750194,
2.10168181494,
2.03623701694,
2.2407476549400003,
1.99311409694,
2.06155530494,
2.04094822294,
2.12258273694
]
},
{
"command": "pnpr@main",
"mean": 2.2137885182400003,
"stddev": 0.13368543298988975,
"median": 2.1660770029400003,
"user": 2.55339854,
"system": 2.8187710399999997,
"min": 2.07716663794,
"max": 2.40300392794,
"times": [
2.1999586259400004,
2.13219537994,
2.39849690194,
2.0918490759400004,
2.08319626494,
2.07716663794,
2.40300392794,
2.29471546094,
2.34375511194,
2.11354779494
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.3653209774799997,
"stddev": 0.0194264523945747,
"median": 1.36475800058,
"user": 1.36054204,
"system": 1.7205275,
"min": 1.33743613258,
"max": 1.39488686158,
"times": [
1.33743613258,
1.36844188258,
1.39488686158,
1.34398594758,
1.36107411858,
1.36884182058,
1.3858272465800001,
1.35730788858,
1.34829584658,
1.38711202958
]
},
{
"command": "pacquet@main",
"mean": 1.39860041178,
"stddev": 0.0784553440720034,
"median": 1.37182499358,
"user": 1.36625634,
"system": 1.7214803999999997,
"min": 1.35435639858,
"max": 1.61776389858,
"times": [
1.38470266058,
1.36354833458,
1.61776389858,
1.35925887858,
1.40413008158,
1.38987315958,
1.3687207185799999,
1.37039909958,
1.37325088758,
1.35435639858
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6737814226800001,
"stddev": 0.07464027302602376,
"median": 0.6503516785800001,
"user": 0.34524124,
"system": 1.2842459,
"min": 0.63920595758,
"max": 0.88479235758,
"times": [
0.66522667258,
0.88479235758,
0.63920595758,
0.65455581758,
0.64614753958,
0.64586458858,
0.65813283558,
0.65884957158,
0.64015239558,
0.64488649058
]
},
{
"command": "pnpr@main",
"mean": 0.65651984208,
"stddev": 0.06354666510017888,
"median": 0.63827621408,
"user": 0.32342284,
"system": 1.2623119,
"min": 0.62739880758,
"max": 0.83626038058,
"times": [
0.64877699758,
0.64400263258,
0.63875552558,
0.63239486558,
0.62869434458,
0.63779690258,
0.62739880758,
0.64152439458,
0.62959356958,
0.83626038058
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.0498671831599995,
"stddev": 0.03245688046387863,
"median": 3.03724979336,
"user": 1.8202639600000001,
"system": 1.99378454,
"min": 3.01679084986,
"max": 3.12026201086,
"times": [
3.01679084986,
3.03246192586,
3.03938827486,
3.05885268286,
3.03291216586,
3.0351113118599997,
3.01897856186,
3.08781323886,
3.12026201086,
3.0561008088599997
]
},
{
"command": "pacquet@main",
"mean": 3.044791149359999,
"stddev": 0.05271179283550148,
"median": 3.03016258886,
"user": 1.7930486599999997,
"system": 1.9946519399999996,
"min": 2.99489201686,
"max": 3.18464182586,
"times": [
3.04837074586,
3.0434623088599997,
3.06143880786,
3.0178092678599997,
3.01093336986,
3.03270193686,
3.02762324086,
2.99489201686,
3.18464182586,
3.0260379728599998
]
},
{
"command": "pnpr@HEAD",
"mean": 0.67289773096,
"stddev": 0.005157847565035208,
"median": 0.67222233436,
"user": 0.34157236,
"system": 1.3202358399999998,
"min": 0.66439858986,
"max": 0.68067315786,
"times": [
0.6707948678600001,
0.67104295786,
0.67894453286,
0.67695802486,
0.67298184486,
0.68067315786,
0.66439858986,
0.6666497208600001,
0.67146282386,
0.67507078886
]
},
{
"command": "pnpr@main",
"mean": 0.65119836216,
"stddev": 0.011422481451060083,
"median": 0.6481394943600001,
"user": 0.32768586,
"system": 1.27764444,
"min": 0.64142531386,
"max": 0.67974423786,
"times": [
0.6487526288600001,
0.64251562486,
0.6461604338600001,
0.6475263598600001,
0.6540188448600001,
0.6593308268600001,
0.67974423786,
0.6430398498600001,
0.6494695008600001,
0.64142531386
]
}
]
} |
|
| Branch | pr/12454 |
| Testbed | pacquet |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result milliseconds (ms) (Result Δ%) | Upper Boundary milliseconds (ms) (Limit %) |
|---|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot 🚷 view threshold | 4,316.65 ms(+3.51%)Baseline: 4,170.37 ms | 5,004.44 ms (86.26%) |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot 🚷 view threshold | 3,049.87 ms(+2.05%)Baseline: 2,988.48 ms | 3,586.17 ms (85.05%) |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot 🚷 view threshold | 1,365.32 ms(+3.98%)Baseline: 1,313.00 ms | 1,575.60 ms (86.65%) |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot 🚷 view threshold | 4,275.51 ms(+8.25%)Baseline: 3,949.75 ms | 4,739.70 ms (90.21%) |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot 🚷 view threshold | 641.52 ms(+3.34%)Baseline: 620.80 ms | 744.97 ms (86.11%) |
|
| Branch | pr/12454 |
| Testbed | pnpr |
⚠️ 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-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 2,096.48 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 672.90 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 673.78 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 2,155.26 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 734.57 ms |
What
Adds an
--ignore-scriptsflag topacquet install, mirroring pnpm's flag of the same name.Why
Since #12436,
pacquet installruns the dependency build phase on the fresh-lockfile path. A project with blocked build scripts (e.g.sharp,esbuild,unrs-resolver) therefore fails withERR_PNPM_IGNORED_BUILDS(exit 1) under the defaultstrictDepBuilds, with no way to install it short of approving every build. pnpm's answer is--ignore-scripts; pacquet had no equivalent (pacquet install --ignore-scriptsexited 2 — unknown flag).This is also what broke pacquet on the vlt.sh benchmark: every fixture (
next/astro/svelte/vue/large/babylon) has a package with a blocked build, sopacquet installexits 1, and the benchmark chart marks any non-zero exit as DNF. The benchmark'spnpmcommand already passes--ignore-scripts; thepacquetcommand couldn't, because the flag didn't exist. pacquet went DNF across the board starting with 0.11.8.How
Mirrors pnpm's
ignoreScriptssemantics:Config.ignore_scriptsfield, fed by the--ignore-scriptsCLI flag and merged enable-only at the Install dispatch incli_args.rs(same pattern as--frozen-store).build_one_snapshot),ignore_scriptsbypasses the allow-build gate entirely: no script runs and nothing is added toignored_builds, so the returned set is empty and the strict-modeERR_PNPM_IGNORED_BUILDSnever fires. Patches still apply (pnpm applies a patch even when scripts are suppressed).is_full_install && !config.ignore_scripts), matching pnpm.This is pacquet catching up to pnpm, which already has
--ignore-scripts— no pnpm-side change needed.Tests
build_modules::tests::ignore_scripts_skips_build_without_collecting_ignored— unit test proving the ignored-builds set stays empty (discriminating: the old logic collected the packages).lifecycle_scripts::dependency_build_scripts::install_ignore_scripts_does_not_fail_under_strict_dep_builds— CLI test: install exits 0 under default strict mode, dependency materialized, scripts not run.lifecycle_scripts::project_scripts::ignore_scripts_skips_project_lifecycle_scripts— CLI test: the project's own lifecycle scripts don't run.just-equivalent checks (fmt, clippy-D warnings, dylint, the affected nextest suites) all pass.Follow-up (separate repo)
The benchmark itself still needs a one-line change in vltpkg/benchmarks to add
--ignore-scriptstoBENCH_INSTALL_PACQUETinscripts/variations/common.sh, exactly as thepnpmcommand already does.Written by an agent (Claude Code, claude-opus-4-8).
Summary by CodeRabbit
--ignore-scriptsCLI flag to suppress lifecycle scripts during installation.ignoreScriptssupport in configuration sources (environment variable and workspace YAML).ERR_PNPM_IGNORED_BUILDSunder strict dependency build settings while still materializing dependencies.