Skip to content

Disable pnpm's implicit install-on-run in favor of explicit installs - #5804

Open
lukemelia wants to merge 2 commits into
mainfrom
fix-ci-pnpm-implicit-installs
Open

Disable pnpm's implicit install-on-run in favor of explicit installs#5804
lukemelia wants to merge 2 commits into
mainfrom
fix-ci-pnpm-implicit-installs

Conversation

@lukemelia

@lukemelia lukemelia commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What

  1. Sets verifyDepsBeforeRun: false in pnpm-workspace.yaml. pnpm 11 defaults this setting to install, which makes every pnpm run / pnpm exec check node_modules freshness first and silently run a workspace-wide install when the check fails. With false, scripts run against node_modules as-is and installs happen only when explicitly requested — the pnpm 10 behavior this workspace ran on previously.
  2. Adds pnpm-workspace.yaml to every workflow path filter that already lists pnpm-lock.yaml (and to ci-host's index-cache invalidation case). The file carries dependency-resolution settings (catalog, overrides, patchedDependencies, allowBuilds, verifyDepsBeforeRun), but a settings-only change that doesn't touch the lockfile previously ran zero suites.

Why

The freshness check never passes in CI — not even immediately after the init action's pnpm install --frozen-lockfile, and not after one of the implicit installs itself completes — so every pnpm invocation in a CI job pays a redundant 4–16s install. Green host-shard logs show the sequence plainly: the explicit install finishes, then three more implicit installs run during setup, then several concurrent ones fire when run-p boots the test services.

That concurrency is the fatal case. start:matrix, start:smtp, start:host-dist, and the rest are each pnpm run invocations, so each spawns its own workspace-wide install into the same node_modules. They stomp each other's bin links (the Failed to create bin … ENOENT warnings visible even in passing shards) and occasionally wedge each other. When start:matrix's install is the one that hangs, start-matrix.sh never reaches pnpm assert-synapse-running, the Synapse container is never created, and the shard fails with Failed to reach Synapse at http://localhost:8008/_matrix/client/versions after 60 attempts (~300s) — the recurring "Synapse startup" flake. Failing-shard logs show that install still running at teardown, killed by SIGTERM five minutes after it started, with Error response from daemon: No such container: boxel-synapse-ci in between.

The same mechanism slows local dev: every pnpm <script> pays the check, and pnpm start:all fans out the same concurrent implicit installs.

Test plan

  • pnpm config get verify-deps-before-run reports false with this change (previously unset, defaulting to install).
  • With the path filters updated, CI on this PR exercises the fix directly: host-shard logs should show no Done in Ns using pnpm implicit-install output between the init action's install and the test run, and no Failed to create bin … ENOENT warnings during service boot.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

246 tests   246 ✅  5m 33s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit d5e8aba.

Realm Server Test Results

    1 files      1 suites   13m 37s ⏱️
1 599 tests 1 599 ✅ 0 💤 0 ❌
1 636 runs  1 636 ✅ 0 💤 0 ❌

Results for commit d5e8aba.

lukemelia and others added 2 commits August 18, 2026 16:58
…flake

pnpm 11 defaults verify-deps-before-run to `install`, so every `pnpm run` /
`pnpm exec` first checks node_modules freshness and silently runs a
workspace-wide install when the check fails. In CI the check never passes,
even immediately after the init action's `pnpm install --frozen-lockfile`
(and even after one of these implicit installs completes), so every pnpm
invocation in a job pays a redundant 4-16s install. The fatal case is the
service boot: `run-p` launches ~9 pnpm scripts at once, each kicking off its
own concurrent install into the same node_modules. They stomp each other's
bin links (the "Failed to create bin ... ENOENT" warnings visible in green
shards) and occasionally deadlock; when start:matrix's install is the one
that wedges, the Synapse container is never created and the shard fails
with "Failed to reach Synapse ... after 60 attempts (~300s)".

This is the mechanism behind the recurring "Synapse startup race" flake,
which hit 12 host shards across three PRs today alone. Setting
verifyDepsBeforeRun: false restores pnpm 10 behavior: scripts run against
node_modules as-is, and installs happen only when explicitly requested.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pnpm 11 reads workspace settings (catalog, overrides, patchedDependencies,
allowBuilds, verifyDepsBeforeRun) from pnpm-workspace.yaml, but no workflow
path filter included it — a settings-only change that doesn't touch the
lockfile ran zero suites. Add it alongside pnpm-lock.yaml in every filter,
including ci-host's index-cache invalidation case, since overrides and
patches can change indexing behavior the same way a lockfile change can.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lukemelia
lukemelia force-pushed the fix-ci-pnpm-implicit-installs branch from d5e8aba to 3691ab4 Compare August 18, 2026 21:11
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.

1 participant