Skip to content

fix: strip re-pinned devEngines.packageManager in lockfile/node_modules prepares; count pnpm 12 packages as pacquet - #136

Merged
lukekarrys merged 2 commits into
vltpkg:mainfrom
zkochan:fix/prepare-devengines-and-pnpm12-count
Jul 30, 2026
Merged

fix: strip re-pinned devEngines.packageManager in lockfile/node_modules prepares; count pnpm 12 packages as pacquet#136
lukekarrys merged 2 commits into
vltpkg:mainfrom
zkochan:fix/prepare-devengines-and-pnpm12-count

Conversation

@zkochan

@zkochan zkochan commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

What happened

Since ~Jun 18, npm, pnpm, and pnpm 12 (pacquet) have been DNF in every fixture of the lockfile, node_modules, and lockfile+node_modules variations (pnpm/pacquet in all fixtures except babylon; npm in the two fixtures that commit a .yarnrc.yml — next and babylon, since npm runs before berry/zpm write one). DNFs are charted at the slowest successful competitor's time, so these 15 cells and the averages page show pnpm 11/12 far slower than they actually are.

The install logs from the 2026-07-29 run show the failure:

-- Reading output of pnpm install 0 ---
[ERROR] This project is configured to use yarn
-- Reading output of pacquet install 0 ---
Error: ERR_PNPM_OTHER_PM_EXPECTED
  × This project is configured to use yarn

Root cause

Same one #118/#119 fixed for clean_all and the registry-lockfile prepare: the corepack yarn cache cleans inside clean_all_cache re-pin devEngines.packageManager (yarn) into the fixture's package.json. The per-run --prepare of these three variations runs clean_all_cache but never strips the field afterwards, so:

  1. the pinned devEngines.packageManager: yarn survives into the timed run;
  2. the npm pkg delete packageManager in the pnpm/pacquet setup silently fails too (npm refuses to run at all under a mismatched devEngines — EBADDEVENGINES);
  3. npm/pnpm/pacquet exit 1 → DNF.

The three variations that clean caches per-run without re-stripping are exactly the three failing ones; every variation that either keeps its cache (cache*) or strips the field per-run (clean, cache+lockfile+node_modules, registry-lockfile) is green.

Fix (commit 1): run clean_package_manager_field at the end of the three BENCH_PREPARE_BASEs, after clean_all_cache — the same ordering clean_all documents.

Also: pnpm 12 package counts were attributed to pnpm

infer_package_manager in package-count.sh maps any pnpm-lock.yaml to pnpm, and both pnpm 11 and pnpm 12 leave one. So pacquet's counts were appended to pnpm-count.txt: pacquet had no package count at all (e.g. 2026-07-29/next-clean-package-count.json has no pacquet entry), breaking its per-package normalization, and pnpm's count mixed in pacquet's runs.

Fix (commit 2): both installers record their version in node_modules/.modules.yaml (packageManager: pnpm@<version>); treat major ≥ 12 as pacquet, keep pnpm as the fallback.

Tested locally: bash -n on all touched scripts; package-count.sh produces pacquet-count.txt for a .modules.yaml with pnpm@12.0.0-beta.0, pnpm-count.txt for pnpm@11.17.0, and falls back to pnpm when the file is absent.


Written by an agent (Claude Code, claude-fable-5) on behalf of @zkochan.

zkochan added 2 commits July 30, 2026 02:13
…on prepares

The per-run --prepare of the lockfile, node_modules, and
lockfile+node_modules variations runs clean_all_cache, whose corepack
yarn cache cleans re-pin devEngines.packageManager (yarn) into
package.json. Nothing strips the field again before the timed install,
so npm and pnpm refuse to run (EBADDEVENGINES /
ERR_PNPM_OTHER_PM_EXPECTED: 'This project is configured to use yarn')
and every fixture of these three variations records a DNF for them.

This is the same failure vltpkg#118 fixed for clean_all and
vltpkg#119 fixed for the registry-lockfile prepare; these
three variation prepares were missed. npm, pnpm, and pnpm 12 (pacquet)
have been DNF in these cells since ~Jun 18, charted at the slowest
successful competitor's time.

Run clean_package_manager_field at the end of each prepare base, after
clean_all_cache, mirroring the ordering rationale documented in
clean_all.
infer_package_manager mapped any pnpm-lock.yaml to 'pnpm', so the
pacquet benchmark's package counts were appended to pnpm-count.txt:
pacquet never got a count (breaking its per-package normalization) and
pnpm's count mixed in pacquet's runs.

Both installers record their own version in node_modules/.modules.yaml
(packageManager: pnpm@<version>); treat major >= 12 as pacquet and keep
'pnpm' as the fallback when the file is absent.
@lukekarrys
lukekarrys merged commit e607389 into vltpkg:main Jul 30, 2026
3 of 4 checks passed
@lukekarrys

Copy link
Copy Markdown
Member

thanks @zkochan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants