Repository navigation
Description
Summary
The Ladle playground (sahajatlas-design) builds only because @swc/core is held at 1.16.2 by a pnpm.overrides entry (#401). Since 1.16.12, SWC unpacks its native addon into a cache directory and refuses any directory whose ancestors another user can write without a sticky bit. On the Workers build image, since 2026-11-13, that rules out both ~/.cache and /tmp, so every playground build failed with ERR_SWC_NATIVE_CACHE before Ladle ran. 1.16.22 still fails. The pin leaves us on an aging compiler that receives no fixes, so lift it once an upstream release or a change to the build image makes a newer SWC load there.
Approach
- Check whether a newer
@swc/coreloads its addon on Workers Builds. Look for one of: an upstream release that falls back when the cache directory is refused, an environment variable that points the cache somewhere the image allows, or a change to the build image's directory permissions.SWC_NATIVE_BINDING_CACHE=/tmp/...did not work, because/tmpis refused too. Testing on macOS can't reproduce the failure, since/private/tmpthere has the sticky bit. - Drop
"@swc/core": "1.16.2"frompnpm.overridesinpackage.json, and runpnpm installto refreshpnpm-lock.yaml. - Remove the ⚠
@swc/coreparagraph from thesahajatlas-designbullet indocs/rules/deployment.md.
Acceptance criteria
-
package.jsonhas no@swc/coreoverride, and the lockfile resolves a release newer than 1.16.11. - The
sahajatlas-designWorkers build passes on the PR's preview and again onmainafter merge. -
docs/rules/deployment.mdno longer describes the pin.
Verification checklist
-
pnpm why @swc/corereports a version above 1.16.11. - The
Workers Builds: sahajatlas-designcheck run on the PR is green, and its log shows noERR_SWC_NATIVE_CACHE. -
pnpm ladle:buildsucceeds locally.
Notes
The failing build logs were 8712be11 (on 1.16.x with a /tmp cache) and 1413ebd6 (on 1.16.22). The first green build after the pin was 307a9844.
Measured 2026-11-13 against @swc/core 1.16.22, by unpacking the addon and reproducing the refusal:
- 1.16.22 (2026-11-05) is the newest release, and the newest nightly. Nothing upstream has moved, so step 1's first route is closed today.
binding.jsis byte-identical between 1.16.2 and 1.16.22. The refusal comes from the addon itself (crates/swc_native_addon), not the JS loader. Each Linux platform package ships one file: a 10.7 MB carrier that materialises a 31 MB addon at first load.- Load order, from the addon's own strings: self-replacement at the carrier path →
SWC_NATIVE_BINDING_CACHE→$XDG_CACHE_HOME/$HOME/.cache/swc-native-<uid>/v1→ a temporary addon inTMPDIR. - The cache root must be absolute, a real directory owned by the current user with mode 0700, not on a
noexecmount, and must have no parent "writable by another user without trusted sticky protection". - Reproduced as an unprivileged user: a 0700 root under a root-owned 0777 non-sticky parent, with
TMPDIRnon-sticky so the last fallback could not mask it, fails withcustom cache failed: validate cache root <p>: cache root has a parent writable by another user without trusted sticky protection. Two variations of that same run load: a cache root whose chain is owned end to end by the running user, and the failing root plusSWC_NATIVE_BINDING_CACHE_SKIP_SECURITY_CHECK=1("skipping native cache root security check by explicit environment opt-out"). Integrity checking is a separate stage and stays on either way. - Only the playground is exposed.
@swc/corehas exactly one dependent in the lockfile,@vitejs/[email protected], imported only by@ladle/[email protected].vite.config.tscompiles the app with@vitejs/plugin-react(Babel), so nosahajatlas-webdeploy rides on this. - docs(deployment): name the real gate on lifting the @swc/core pin #406 rewrites the
docs/rules/deployment.mdsentence that told a reader to wait for upstream.
Open questions
How should the pin be lifted, now that upstream is not the gate? Criterion 2 cannot be met by waiting for a release. Three routes:
- A — point the cache inside the build workspace. Set
SWC_NATIVE_BINDING_CACHEto an absolute path in the checkout, from the Ladle script. No security opt-out, and measured to work when the chain is owned by the build user. ⚠ It may not hold here:~/.cachebeing refused means an ancestor of$HOMEis other-owned and writable, and a workspace under$HOMEshares that ancestor. - B — opt out of that one check.
SWC_NATIVE_BINDING_CACHE_SKIP_SECURITY_CHECK=1beside a workspace-local 0700 root, set only for the playground build. Measured to work whatever the image's permissions are. It trades SWC's ancestry check for a compiler upgrade on a build that ships no app code; the payload integrity check still runs. Your call, not ours. - C — keep the pin. Free today. The compiler ages and receives no fixes, which is this ticket's reason to exist.
A and B both turn on one fact nobody has read: the build user, and the owner and mode of /, $HOME and the checkout on Workers Builds. A stat line in the playground build command answers it on one preview build and makes the choice between A and B factual.
Recommendation: add that stat line, read it off one build, then take A if the chain is clean and B if it is not.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Hold Until
Projects
- StatusShow more project fieldsDone
Activity
Ardnived commentedon Nov 13, 2026
@sydevs-bot implement
sydevs-bot commentedon Nov 13, 2026
🤖 no session running
approved by Ardnived
recent dispatches
Written by the sydevs dispatcher. Sessions never edit this comment.
sydevs-bot commentedon Nov 13, 2026
I did not lift the pin. 1.16.22 (2026-11-05) is the newest release and still fails, so this ticket's trigger has not fired.
Upstream was never the only route. The refusal comes from the addon's own cache-root check, not the JS loader —
binding.jsis byte-identical across 1.16.2 and 1.16.22. I reproduced it as an unprivileged user and measured two ways past it: a cache root whose parent chain the build user owns, andSWC_NATIVE_BINDING_CACHE_SKIP_SECURITY_CHECK=1. The error text and the load order are now in Notes.Both routes turn on one unread fact: the owner and mode of
/,$HOMEand the checkout on Workers Builds. Open questions lays out A, B and C with a recommendation. B is a security opt-out, so that call is yours.#406 corrects the deployment rule that sent a reader to wait for upstream. Only the playground loads SWC, so no app deploy rides on this.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
fix(deps): lift the @swc/core pin to 1.16.21, matching WeMeditateWeb (#…