From 81ae74be0db77e435f90d76d2310caee74a4ca06 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Thu, 30 Jul 2026 02:13:07 +0200 Subject: [PATCH 1/2] fix: strip devEngines.packageManager in lockfile/node_modules variation 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/benchmarks#118 fixed for clean_all and vltpkg/benchmarks#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. --- scripts/variations/lockfile+node_modules.sh | 7 +++++-- scripts/variations/lockfile.sh | 7 +++++-- scripts/variations/node_modules.sh | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/variations/lockfile+node_modules.sh b/scripts/variations/lockfile+node_modules.sh index df22d610d1..c86c72cf07 100644 --- a/scripts/variations/lockfile+node_modules.sh +++ b/scripts/variations/lockfile+node_modules.sh @@ -4,8 +4,11 @@ set -Eeuxo pipefail # Load common variables source "$1/variations/common.sh" -# Prepare command base for each run -BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_package_manager_files" +# Prepare command base for each run. +# clean_package_manager_field must run AFTER clean_all_cache: the corepack +# yarn cache cleans re-pin devEngines.packageManager (yarn) into package.json, +# which makes npm and pnpm refuse to run entirely (see clean_all). +BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_package_manager_files clean_package_manager_field" # Run the benchmark suite # When running a cache benchmark, we want to clean up only the node_modules diff --git a/scripts/variations/lockfile.sh b/scripts/variations/lockfile.sh index 6ac11e925a..c06d61a104 100644 --- a/scripts/variations/lockfile.sh +++ b/scripts/variations/lockfile.sh @@ -4,8 +4,11 @@ set -Eeuxo pipefail # Load common variables source "$1/variations/common.sh" -# Prepare command base for each run -BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_node_modules clean_package_manager_files" +# Prepare command base for each run. +# clean_package_manager_field must run AFTER clean_all_cache: the corepack +# yarn cache cleans re-pin devEngines.packageManager (yarn) into package.json, +# which makes npm and pnpm refuse to run entirely (see clean_all). +BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_node_modules clean_package_manager_files clean_package_manager_field" # Run the benchmark suite # When running a cache benchmark, we want to clean up only the node_modules diff --git a/scripts/variations/node_modules.sh b/scripts/variations/node_modules.sh index 3264eeba70..8cedd44859 100644 --- a/scripts/variations/node_modules.sh +++ b/scripts/variations/node_modules.sh @@ -4,8 +4,11 @@ set -Eeuxo pipefail # Load common variables source "$1/variations/common.sh" -# Prepare command base for each run -BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_lockfiles clean_package_manager_files" +# Prepare command base for each run. +# clean_package_manager_field must run AFTER clean_all_cache: the corepack +# yarn cache cleans re-pin devEngines.packageManager (yarn) into package.json, +# which makes npm and pnpm refuse to run entirely (see clean_all). +BENCH_PREPARE_BASE="sleep 1; bash $BENCH_SCRIPTS/clean-helpers.sh clean_all_cache clean_lockfiles clean_package_manager_files clean_package_manager_field" # Run the benchmark suite # When running a cache benchmark, we want to clean up only the node_modules From e92ded19f13148acf48318e5455b4c023d899546 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Thu, 30 Jul 2026 02:13:09 +0200 Subject: [PATCH 2/2] fix: attribute pnpm 12 (pacquet) package counts to pacquet, not pnpm 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@); treat major >= 12 as pacquet and keep 'pnpm' as the fallback when the file is absent. --- scripts/package-count.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/package-count.sh b/scripts/package-count.sh index 8d5b2ab0e8..4d2b845ec6 100644 --- a/scripts/package-count.sh +++ b/scripts/package-count.sh @@ -18,7 +18,16 @@ infer_package_manager() { elif [[ -f "vlt-lock.json" ]]; then echo "vlt" elif [[ -f "pnpm-lock.yaml" ]]; then - echo "pnpm" + # pnpm (v11, TypeScript) and pacquet (pnpm v12, Rust) both leave a + # pnpm-lock.yaml, so the lockfile alone can't tell them apart. The + # installer records its own version in node_modules/.modules.yaml + # (packageManager: pnpm@); v12+ is pacquet. + pnpm_major=$(sed -n "s/^packageManager: ['\"]\{0,1\}pnpm@\([0-9][0-9]*\).*/\1/p" node_modules/.modules.yaml 2>/dev/null | head -1) + if [[ -n "$pnpm_major" && "$pnpm_major" -ge 12 ]]; then + echo "pacquet" + else + echo "pnpm" + fi elif [[ -f "yarn.lock" ]]; then if [[ -f ".yarnrc.yml" ]] && command -v yarn >/dev/null 2>&1; then yarn_version=$(yarn -v 2>/dev/null || echo "")