fix(ci): stop evaluating pantry env, which sometimes re-installs JS deps mid-job - #107
Merged
Merged
Conversation
`integration` kept failing at "Build TypeScript SDK" with
error: Cannot find package 'typescript' from '…/packages/typescript/scripts'
while `typescript-sdk` — same commit, same runner, same `bun run build`,
same shim — passed. The difference is one step earlier: `integration` runs
`eval "$(pantry env | sed -n '/^export /,$p')" && zig build`, and the log
inside that step reads:
+ typescript@7.1.0-dev.20260708.3
+ better-dx@0.2.20
Linked 11 workspace package(s)
Installing JS deps via bun
683 packages installed
✗ Patch failed for ts-maps
⚡ pantry env activated → craft
`pantry env` does not just print exports. It runs a workspace setup: it
installs its own typescript and better-dx — neither the version the lockfile
names — then runs its own `bun install` with an explicit `--linker` flag
(`js_delegate.zig:208`), which overrides `bunfig.toml`'s `hoisted` and
re-links the whole tree. The explicit install step had put 351 packages in
place; this put 683, and root `node_modules/typescript` was gone.
The eval contributed nothing a step used. `pantry env` exports only
`PANTRY_*` variables (0.10.3 exports nothing at all), and no workflow reads
them. `zig` was found because the pantry action already puts every installed
bin on PATH — `packages/action/src/index.ts:852–912` — which is why `bun
install` runs without any eval. zig-js's CI uses the same action and runs
bare `zig build`.
Removed from all 16 sites across five workflows. The Apple signing gate in
release.yml is untouched; the only lines changed there are three build
prefixes and one bare eval inside the cross-compile loop.
This was also the origin of the `integration` break #104 set out to fix:
the dev-build `tsc` that could not find its linux-x64 binary was the one
`pantry env` had just installed and put on PATH.
✅ Binary load timeWhat this measures
Both binaries are measured interleaved on this runner and compared by |
✅ Binary Size Report
Size limits
|
pantry env, which re-installs JS deps mid-jobpantry env, which sometimes re-installs JS deps mid-job
chrisbbreuer
pushed a commit
that referenced
this pull request
Sep 3, 2026
…issed (#111) #107 removed `eval "$(pantry env …)"` from 16 sites across five workflows and said so. It missed eight more in `package.json`, and `integration` found them: its "Run root verification" step runs `bun run verify`, which reaches `build:core`, which evals `pantry env`, which runs the workspace setup — ✗ Patch failed for ts-maps error: Cannot find package 'typescript' from …/packages/typescript/scripts — the same clobbered `node_modules`, one door further along. The failing step moved from "Build TypeScript SDK" to "Run root verification"; the cause did not change at all. Guarded rather than removed, because these are not the workflow's sites. In CI the pantry action puts `zig` on PATH, so the guard short-circuits and nothing runs a workspace setup. On a developer's machine `zig` is usually not on PATH, and the eval is exactly how these scripts have always made it available — that still happens, unchanged. `.github/CONTRIBUTING.md` documents activating pantry for a shell, and this keeps working for anyone who has not. Verified both directions: with `zig` on PATH the guard skips the eval and `bun run fmt:check` exits 0; without it, the eval runs as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
integrationfailed on #106 at "Build TypeScript SDK" withCannot find package 'typescript', whiletypescript-sdk— same commit, same runner, same command, same shim — passed. The difference is one step earlier:integrationrunseval "$(pantry env …)" && zig build, and in that run the log shows pantry running a workspace setup inside the eval — installing its owntypescript@7.1.0-dev(not what the lockfile names), then its ownbun installwith an explicit--linker(js_delegate.zig:208) that overridesbunfig.toml'shoisted. The explicit install step had produced 351 packages; this produced 683, and rootnode_modules/typescriptwas gone.It is intermittent, and that is the argument for this PR
mainis currently green, includingintegration, without this change. Same workflow, same cache key, same pantry version — the setup simply did not fire:Installing JS deps33776563410typescript@7.1.0-dev33779108264pantry skips the install when it decides deps are already in sync (
js_delegate.zig:33), so whethernode_modulesgets rewritten mid-job depends on runner state rather than on anything in this repo. That is worse than a deterministic break: it fails a job that nothing in the diff touched, and it passes on retry.So this is not a fix for a red
main—mainis green. It removes the nondeterminism.The eval was never load-bearing
pantry envexports onlyPANTRY_*variables (0.10.3 exports none), and no workflow reads them.zigis on PATH because the pantry action already puts every installed bin there (packages/action/src/index.ts:852–912) — which is whybun installruns with no eval at all, and why zig-js's CI uses the same action with barezig build.Removed from all 16 sites across five workflows. The Apple signing gate in
release.ymlis untouched.Verification
All 9 checks green on this PR, including
zig-coreon both platforms (provingzigresolves without the eval) andintegration(proving the shim survives).