Skip to content

docs(deployment): name the real gate on lifting the @swc/core pin - #406

Merged
sydevs-bot merged 1 commit into
mainfrom
claude/docs-deployment-swc-cache-rule
Nov 14, 2026
Merged

sydevs-bot merged 1 commit into
mainfrom
claude/docs-deployment-swc-cache-rule

Conversation

@sydevs-bot

Copy link
Copy Markdown
Contributor

Summary

  • The sahajatlas-design rule told a reader to wait for upstream. The addon's cache root is the gate.
  • Bounds the blast radius: only the playground loads SWC, never the sahajatlas-web build.

Preview

  • No preview: the diff touches only docs/, which neither site ships.

Test results

  • Lean gate: ✓ lint + typecheck + test:run — 168 spec files, 2066 tests
  • Targeted specs: none — no code changed
  • Build: N/A

Manual verification

  1. Check the two environment variables against SWC 1.16.22's addon, if you want the claim tested rather than taken — the repro is in Detail below.

Notes for reviewer

  • I did not lift the pin, and this PR does not close chore(deps): lift the @swc/core pin once SWC builds on Workers Builds #405. 1.16.22 is still the newest release
    (2026-11-05) and still fails, so the ticket's trigger has not fired. What changed is the reason
    it has not: upstream was never the only route. The decision that remains is on chore(deps): lift the @swc/core pin once SWC builds on Workers Builds #405.
  • The two variables are measured on this container, never on Workers Builds. The paragraph says
    so, and the claim it makes is about the addon, not about the build image.
  • The paragraph keeps its ⚠, its #401 breadcrumb and the mechanism already written there. The
    pre-existing Prettier warning on line 132 of the same file (*adds* vs _adds_) is untouched.
Detail

How the addon loads. @swc/core's binding.js is byte-identical between 1.16.2 and 1.16.22,
so the refusal is not in the JS loader. Each Linux platform package ships one file — a 10.7 MB
"carrier" that materialises the real 31 MB addon at first load. Its own strings give the order:
self-replacement at the carrier path, then SWC_NATIVE_BINDING_CACHE, then
$XDG_CACHE_HOME/$HOME/.cache/swc-native-<uid>/v1, then a temporary addon in TMPDIR.

The check. The cache root must be absolute, a real directory owned by the current user with
mode 0700, not on a noexec mount, and must have no parent "writable by another user without
trusted sticky protection".

Reproduced, as an unprivileged user, cache root 0700 under a root-owned 0777 non-sticky parent,
with TMPDIR non-sticky so the last fallback could not hide it:

SWC native addon: custom cache failed: validate cache root <p>: cache root has a parent
writable by another user without trusted sticky protection; default cache failed: ...

Same run, two variations, both of which load:

  • cache root under a chain owned end to end by the running user
  • the failing root plus SWC_NATIVE_BINDING_CACHE_SKIP_SECURITY_CHECK=1, whose own string is
    "skipping native cache root security check by explicit environment opt-out". Integrity checking
    is a separate stage and stays on (ERR_SWC_NATIVE_INTEGRITY, "rejecting corrupt native cache
    entry; rebuilding from payload").

Blast radius. In pnpm-lock.yaml, @swc/core has exactly one dependent,
@vitejs/[email protected], which has exactly one importer, @ladle/[email protected].
vite.config.ts compiles the app with @vitejs/plugin-react (Babel).

Not asserted in the docs: that a workspace-local cache root fixes the image. The ticket's own
evidence that ~/.cache is refused means an ancestor of $HOME is other-owned and writable — and
if the build workspace also sits under $HOME, a repo-local root shares that ancestor and is
refused too. Untested there, so the paragraph claims nothing about it.


Generated by Claude Code

The rule told a reader to wait for an upstream release. Measuring 1.16.22's
addon shows upstream is one route and not the only one: the refusal comes from
the addon's own cache-root check, which reads SWC_NATIVE_BINDING_CACHE and can
be turned off by SWC_NATIVE_BINDING_CACHE_SKIP_SECURITY_CHECK while its
integrity check stays on. Left as written, the pin outlives its cause.

Also bound the blast radius. @swc/core has exactly one dependent in the
lockfile, @vitejs/plugin-react-swc, pulled in only by @ladle/react, so no
sahajatlas-web deploy rides on this.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjV3qMe6DZtVKAUf8n9
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Adversarial review skipped: 1 file(s), 9 changed line(s), under review.skipWhen. Say @sydevs-bot review to force one.

🤖 sydevs dispatcher

@sydevs-bot sydevs-bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 13, 2026
@sydevs-bot

sydevs-bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 14, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 0ce1c81 Nov 14, 2026
23 checks passed
@sydevs-bot
sydevs-bot deleted the claude/docs-deployment-swc-cache-rule branch November 14, 2026 17:29
@sydevs-bot sydevs-bot moved this from Pending to Done in SYDevelopers Technical Roadmap Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

chore(deps): lift the @swc/core pin once SWC builds on Workers Builds

3 participants