From fcf140e0a64340ff4310e62b3ae7b77574b07645 Mon Sep 17 00:00:00 2001 From: baudbot-agent Date: Mon, 16 Mar 2026 19:57:52 +0000 Subject: [PATCH] fix: export corepack env vars + disable vp env node management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two issues causing the run/run benchmark to fail: 1. **vp env management**: The vp installer auto-enables Node.js version management in CI ($CI env var), creating shims that intercept node/npm/corepack. Fixed by running 'vp env off' after install. 2. **corepack strict mode**: COREPACK_ENABLE_STRICT and COREPACK_ENABLE_AUTO_PIN were set in setup.sh but never exported or persisted via GITHUB_ENV. In corepack 0.34+, strict mode (on by default) refuses to run a package manager that doesn't match the packageManager field. Since zpm's prepare sets packageManager=yarn@6.0.0-rc.15 and cleanup relies on vlt pkg rm to remove it, any cleanup hiccup leaves the field in place — and corepack immediately rejects pnpm. Additionally, auto-pin (on by default) causes corepack to ADD a packageManager field when one doesn't exist, contaminating the fixture state between benchmark iterations. Fixed by exporting the vars and persisting them to GITHUB_ENV so all subsequent CI steps (including the benchmark run) inherit them. --- scripts/setup.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index bfa250fc2..3bec811c8 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -4,9 +4,18 @@ set -e # Environment Configuration -COREPACK_ENABLE_STRICT=0 -COREPACK_ENABLE_AUTO_PIN=0 -YARN_ENABLE_IMMUTABLE_INSTALLS=false +export COREPACK_ENABLE_STRICT=0 +export COREPACK_ENABLE_AUTO_PIN=0 +export YARN_ENABLE_IMMUTABLE_INSTALLS=false + +# Persist corepack env vars for subsequent CI steps (e.g., benchmark runs). +# Without these, corepack 0.34+ auto-pins packageManager and refuses to run +# a different PM than what packageManager specifies — breaking benchmarks +# that cycle through multiple package managers on the same fixture. +if [ -n "${GITHUB_ENV:-}" ]; then + echo "COREPACK_ENABLE_STRICT=0" >> "$GITHUB_ENV" + echo "COREPACK_ENABLE_AUTO_PIN=0" >> "$GITHUB_ENV" +fi # Check Node version REQUIRED_NODE_VERSION="24" @@ -39,8 +48,13 @@ echo "Installing package managers and tools..." npm install -g npm@latest corepack@latest vlt@latest bun@latest deno@latest nx@latest turbo@latest # Install Vite+ (vp) via its installer script +# Note: The vp installer auto-enables Node.js version management in CI +# (detects $CI env var). We must disable it after install so vp's shims +# don't intercept node/npm/corepack — we use actions/setup-node for that. curl -fsSL https://vite.plus | bash export PATH="$HOME/.vite-plus/bin:$PATH" +# Disable vp's Node.js version management to avoid interfering with corepack +"$HOME/.vite-plus/bin/vp" env off 2>/dev/null || true # Persist vp on PATH for subsequent CI steps if [ -n "${GITHUB_PATH:-}" ]; then echo "$HOME/.vite-plus/bin" >> "$GITHUB_PATH"