Latest Results
fix(bindings): fall back to a secure Windows profile cache (#12452)
**Description:**
Windows native binding loading can fail when the default LocalAppData
cache inherits writable AppContainer permissions. The same failure
affects `SWC_NATIVE_BINDING_CACHE=0`, since temporary loading uses the
default cache root.
Retry cache failures from `%LOCALAPPDATA%\swc` in
`%USERPROFILE%\.swc-cache`, using the existing owner, ACL, and
reparse-point checks. Apply the same fallback to default loading,
temporary loading, and default loading after a custom cache fails. Keep
temporary files unique and preserve their cleanup behavior. Explicit
`cached_at` calls retain their specified root, and integrity failures
remain fatal.
Report both attempted locations and their causes when fallback fails,
log retries with structured diagnostics, and document the Windows path
order. Add isolated Windows ACL and cache fixtures plus real Node
carrier coverage for concurrent loading, reuse, corruption recovery,
callbacks, cleanup, and preservation of the original root ACLs.
**Validation:**
- On macOS: `cargo fmt --all`, `cargo clippy --all --all-targets -- -D
warnings`, tests for `swc_native_addon`, `swc_native_addon_pack`, and
`binding_native_addon`, and the private-crate Rust 1.73 MSRV suite
passed.
- `packages/core`: `pnpm build:dev && pnpm test` passed (119 tests
passed, 3 skipped).
- [Carrier lifecycle
CI](https://github.com/swc-project/swc/actions/runs/36813599959) passed
on Windows x64, Windows ARM64, macOS, and Linux at implementation commit
`c2bb98d7cb219bec35bfb0c6528a7adb3c900558`, including Windows ACL/cache
fixtures, real Node loading, cleanup, and the x64 Rust 1.73 checks. The
subsequent commit only adds the changeset.
**Related issue (if exists):**
Fixes #12442 Latest Branches
+3%
codex/fix-windows-native-cache-12442 0%
codex/fix-env-for-await-12399 0%
codex/fix-wasmtime-advisory-0316 © 2026 CodSpeed Technology