Skip to content

fix(deps): lift the @swc/core pin to 1.16.21, matching WeMeditateWeb - #412

Merged
Ardnived merged 4 commits into
mainfrom
fix/swc-lift-pin
Nov 15, 2026
Merged

Ardnived merged 4 commits into
mainfrom
fix/swc-lift-pin

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Summary

This lifts the @swc/core 1.16.2 pin from #401, taking route B from #405. Every SWC release since 1.16.12 fails on the Workers build image with ERR_SWC_NATIVE_CACHE. The image fails SWC's cache-root ancestor check for both ~/.cache and /tmp, and upstream has not changed since.

  • ladle:build now starts with SWC_NATIVE_BINDING_CACHE_SKIP_SECURITY_CHECK=${WORKERS_CI:+1}. That is 1 only on Workers Builds, which injects WORKERS_CI. The check stays on locally and in CI. Only the ancestor check is skipped, and SWC still verifies the addon's payload.
  • The setting is in the repo rather than the dashboard, so it is reviewed and survives reconnecting the Worker. It has to be a script prefix: Ladle imports SWC at startup, before it reads .ladle/config.mjs.
  • The pnpm.overrides entry is removed, and the lockfile resolves @swc/core 1.16.21. That is the version sydevs/WeMeditateWeb resolves, so the two playgrounds share one compiler. Only SWC entries change in the lockfile.
  • scripts/wrangler-config.test.ts pins the prefix. GitHub's runners and macOS pass the check, so nothing else would notice it being removed. I watched the new case fail before adding the prefix.
  • The ⚠ SWC paragraph in docs/rules/deployment.md is rewritten to match.

Only the playground loads SWC, so no sahajatlas-web deploy depends on this. Companion PR: sydevs/WeMeditateWeb#236.

Test plan

  • pnpm why @swc/core reports 1.16.21.
  • pnpm ladle:build passes locally.
  • pnpm test:run scripts/wrangler-config.test.ts passes, 23 of 23.
  • Workers Builds: sahajatlas-design passes on this PR, and its log shows no ERR_SWC_NATIVE_CACHE.
  • The same build passes on main after merge.

🤖 Generated with Claude Code

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]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design e21e1f4 Nov 15 2026, 06:45 PM

@Ardnived
Ardnived marked this pull request as ready for review November 15, 2026 18:52
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 15, 2026
@sydevs-bot

sydevs-bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 19:01Z address-review · attempt 1 · session · done
  • 19:01Z address-review · attempt 1 · session
  • 18:52Z review-pr · attempt 1 · session · done
  • 18:52Z review-pr · attempt 1 · session

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

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

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

This matches #405 and stops there: the override goes, one env prefix arrives, one test pins it, one doc paragraph is rewritten. No new file, helper, constant or dependency, so the ladder has nothing to walk. Route B takes SWC's own documented opt-out (swc-project/swc#12469) over hand-rolled code, and upstream's fallback (swc-project/swc#12500, shipped in 1.16.18) cannot replace it — it retries in the system temp directory, which this image refuses too. All three findings are about the prose, not the change.

Findings

  • should-fix — docs/rules/deployment.md:60 cites WeMeditateWeb#233, the ticket, for a prefix that its PR #236 has not merged yet.
  • should-fix — docs/rules/deployment.md:54 leaves #405's route A unanswered and its deciding stat unrecorded.
  • consider — scripts/wrangler-config.test.ts:158 claims a wider measurement than #405 took.

What was checked

  • ${WORKERS_CI:+1} holds. SWC enables the skip on the exact value 1, so the empty expansion leaves the check on locally and in CI, as the body claims.
  • Workers Builds: sahajatlas-design already passed on e21e1f4f — the body's unchecked box. That is the prefix working on 1.16.21 on the real image.
  • The lockfile diff is SWC entries only, as claimed. @swc/core resolves 1.16.21 through @vitejs/[email protected], its one dependent.
  • scripts/wrangler-config.test.ts read whole: the new case joins the PACKAGE.scripts assertions already in describe('the targets'), so it has a home, and nothing else in the file wants the prefix.
  • No finding, but worth knowing: nothing pins 1.16.21 now. The next lockfile refresh floats to 1.16.22 or later, which the flag should cover and nobody has built.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread docs/rules/deployment.md Resolved
Comment thread docs/rules/deployment.md Resolved
Comment thread scripts/wrangler-config.test.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 15, 2026
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
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
"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
@sydevs-bot

Copy link
Copy Markdown
Contributor

Three critic threads, all adopted. Pushed to claude/relay-412-a8dbf24 for the relay.

Lean gate green: lint, typecheck, 2081 tests. /security-review ran on the lockfile trigger and found nothing. Docs checked, nothing else stale.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 15, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 15, 2026
@sydevs-bot
sydevs-bot enabled auto-merge November 15, 2026 19:15
@Ardnived
Ardnived merged commit ca3f207 into main Nov 15, 2026
10 checks passed
@Ardnived
Ardnived deleted the fix/swc-lift-pin branch November 15, 2026 19:15
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 15, 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.

3 participants