Repository navigation
fix(deps): pin @swc/core to 1.16.2 so the playground builds on Workers - #401
Conversation
Every sahajatlas-design build since 2026-11-13 02:39Z failed before Ladle ran: @swc/core unpacks its addon into ~/.cache and refuses a cache root whose parent another user can write without a sticky bit, which the Workers build image's /opt/buildhome now is (ERR_SWC_NATIVE_CACHE). ladle:build points the cache at /tmp, which is sticky; locally SWC falls back to the user cache when that path is unusable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
One script line, one spec, one doc paragraph, for a build that broke under the repo rather than because of it. The shape is as small as the problem, and the "why" sits in the file that owns deploy topology.
The gap is upstream. @swc/core is transitive and unpinned by this repo — @vitejs/[email protected] asks for ^1.12.11 — and 1.16.22 shipped 2026-11-05, six releases after 1.16.13. A lockfile bump would leave nothing permanent behind, and the body does not say it was tried. That is the question worth answering before this lands.
The body's proof, the Workers Builds: sahajatlas-design check, was still in progress when this review ran.
Findings
- should-fix — upstream bump not walked before a permanent script-level workaround ·
package.json:24 - consider — the new spec pins the spelling
/tmp/, not the property it guards ·scripts/wrangler-config.test.ts:144 - consider —
package.jsondefault vs. thesahajatlas-designtrigger's variables ·package.json:24
What was checked
- The whole diff (3 files, +12/−1) against the body, plus
package.jsonscripts,scripts/wrangler-config.test.ts,docs/rules/deployment.mdanddocs/environment.md. - Ladder:
ladle:buildis the only caller ofladle build(ci.yml:43,deployment.md'ssahajatlas-designbullet), so one line covers both CI and the design Worker. - Upstream:
npm view @swc/core→ 1.16.22 on 2026-11-05;@vitejs/[email protected]→^1.12.11; nopnpm.overridesentry for it. - No contract surface touched:
docs/embedding.md,types:cmspaths,public/. - Unverified: that
@swc/core1.16.13 readsSWC_NATIVE_BINDING_CACHE. Nonode_moduleshere, and no preview in.claude/workflow.json, so the pending Workers build is the only evidence there will be.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
@swc/core 1.16.18 stopped refusing a cache root whose parent another user can write without a sticky bit, which is what `/opt/buildhome` on the Workers build image became on 2026-11-13. 1.16.17 still refuses it, and nothing in this repo pins the version, so the lockfile alone held 1.16.13. Bumping it to 1.16.22 drops the `SWC_NATIVE_BINDING_CACHE` default from `ladle:build` and the spec that pinned its spelling, so no future build carries the workaround. `docs/rules/deployment.md` records the floor instead. Verified: `@swc/core` 1.16.13 and 1.16.17 throw `ERR_SWC_NATIVE_CACHE` under a home whose parent is world-writable without a sticky bit; 1.16.18, 1.16.20, 1.16.21 and 1.16.22 load. `ladle build` completes under that same home on 1.16.22 with no environment override. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVvh2nMhkqMLrWkgRd
|
One commit, 8342969, answers all three threads. Adopted the upstream bump. That reverts the Lean gate passes. Security review on the lockfile found nothing. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
Not required, so not blocking: 🤖 sydevs dispatcher |
1.16.22 failed on Workers Builds too: its addon refuses /tmp as well as ~/.cache there, since an ancestor of each is writable by another user. From 1.16.12 the linux binary is a compressed carrier that must unpack into such a cache; 1.16.2 is the last release whose .node loads directly, so an override holds it there until a newer release builds on Workers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…412) * fix(deps): lift the @swc/core pin to 1.16.21, matching WeMeditateWeb The playground held @swc/core at 1.16.2 because every later release died on the Workers build image with ERR_SWC_NATIVE_CACHE (#401): its addon refuses a cache directory with an ancestor another user can write, and the image fails that rule for both ~/.cache and /tmp. Upstream has not moved, so the pin had no exit (#405). Route B from #405 lifts it, set in the repo rather than the dashboard: ladle:build now sets SWC_NATIVE_BINDING_CACHE_SKIP_SECURITY_CHECK=1 when WORKERS_CI is set, which Workers Builds injects and nothing else does. Only the ancestor check goes; the payload integrity check stays on, and the check stays on locally and in CI. It has to be a script prefix: Ladle loads SWC before it reads any config file. GitHub's runners and macOS pass the check, so wrangler-config.test.ts pins the prefix. 1.16.21 is what WeMeditateWeb's playground resolves under the same prefix (sydevs/WeMeditateWeb#233), so the two Ladle builds share one compiler. Only the playground loads SWC, so no sahajatlas-web deploy rides on this. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(docs): cite WeMeditateWeb's PR for the shared SWC prefix The deployment rule named sydevs/WeMeditateWeb#233, the ticket, not #236, the PR that adds the prefix there. Nothing but this line couples the two repos, so a wrong number outlives the PR that introduced it. #236 is open, so the prefix is proposed there rather than in use. Their main already resolves @swc/core 1.16.21, so only the prefix clause was premature. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYcLZ56AdrFyykCbKQ * fix(docs): say why a checkout-local SWC cache root was not taken The paragraph ruled out ~/.cache and /tmp, the roots SWC picks by itself, and left #405's route A unanswered. A reader asking "why not point the cache at the checkout?" found nothing. The stat #405 recommended was never read, so this records the inference rather than a measurement: ~/.cache being refused puts the offending ancestor at or above $HOME, which a checkout under $HOME inherits. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYcLZ56AdrFyykCbKQ * fix(test): trim the SWC prefix comment to its why "for every directory it tries" claimed more than #405 measured: the default cache root and /tmp, never a checkout-local one. The two sentences before the last one restated docs/rules/deployment.md. What remains is the reason the test exists — no other lane fails without the prefix, so nothing else catches its removal. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYcLZ56AdrFyykCbKQ --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Why
Every
Workers Builds: sahajatlas-designrun since 2026-11-13 ~02:39Z failed (#399, #400) with no code change behind it:Ladle compiles through
@vitejs/plugin-react-swc→@swc/core. From 1.16.12, the Linux addon ships as a compressed carrier that unpacks itself into a cache directory, and it refuses any directory whose ancestors another user can write. On the Workers build image, which changed on the 13th, that rules out both~/.cacheand/tmp.What
pnpm.overridespins@swc/coreto 1.16.2, the last release whose.nodeloads directly. That satisfies plugin-react-swc's^1.12.11.docs/rules/deployment.mdrecords the pin and when to lift it.Two earlier attempts on this branch failed on Workers and are superseded:
SWC_NATIVE_BINDING_CACHEat/tmp;/tmpthere too.Verified
@swc/core-linux-x64-gnubinaries for 1.15.47 through 1.16.2 carry no cache code; 1.16.12 does (10 MB carrier vs 30 MB plain).ladle buildpasses on 1.16.2 withHOMEandTMPDIRunder a non-sticky world-writable directory, and the lean gate passes.Workers Builds: sahajatlas-designcheck passes (build307a9844).After merge, #399 and #400 need
mainmerged in for their playground builds to go green.🤖 Generated with Claude Code