Conversation
Contributor
Stats from current PR🔴 1 regression, 2 improvements
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
Build Cache
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URLCommit: aedde0f |
Contributor
Tests PassedCommit: 122583b |
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
August 26, 2026 12:53
49ca5dd to
aedde0f
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
August 28, 2026 08:01
aedde0f to
92cd58f
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
2 times, most recently
from
September 8, 2026 09:19
92cd58f to
f0005a1
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 8, 2026 11:04
f0005a1 to
dcaec44
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 8, 2026 20:57
dcaec44 to
2a5bc17
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 9, 2026 01:19
2a5bc17 to
4e3be9b
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 9, 2026 08:25
4e3be9b to
96723f4
Compare
sokra
marked this pull request as ready for review
September 9, 2026 08:30
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 12, 2026 13:13
96723f4 to
8c1292f
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 12, 2026 16:14
8c1292f to
f8c2708
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 13, 2026 11:37
f8c2708 to
91fcf59
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 13, 2026 11:43
91fcf59 to
d755c80
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 14, 2026 16:33
d755c80 to
fff3243
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 15, 2026 16:03
fff3243 to
413fc48
Compare
sokra
removed this pull request from stack #97861
September 15, 2026 19:29
sokra
added this pull request to stack #98698
September 15, 2026 19:34
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 15, 2026 20:46
413fc48 to
9c7851f
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
2 times, most recently
from
September 15, 2026 22:18
b4ea9ae to
9bfa249
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 16, 2026 07:50
9bfa249 to
f28e98f
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 16, 2026 08:38
f28e98f to
264031e
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 16, 2026 10:03
264031e to
4d3c9e7
Compare
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 16, 2026 10:50
4d3c9e7 to
122583b
Compare
| // neither unix nor windows (`memmap2/src/stub.rs`). Nothing in the test can work around that. | ||
| #[cfg_attr( | ||
| target_family = "wasm", | ||
| ignore = "no mmap on WASI: memmap2 has no implementation for this target" |
Contributor
There was a problem hiding this comment.
shouldn't we enable the FileRead env var here?
ditto for all the tests that trigger persistence
can we enable the backend to use fileread mode when under wasm without the env var so this just works?
`std::env::temp_dir()` is hard-unsupported on WASI: it panics at
`std/sys/paths/wasi.rs` with "not supported by WASI yet" regardless of
`TMPDIR`. `tempfile::tempdir()` asks it where to put the directory, so
every test using it aborted, and 11 attributes (15 instances) in
turbo-tasks-backend were ignored on wasm because of it.
The filesystem itself is fine — a WASI guest reaches whatever the host
preopens, and the test host preopens the working directory as `/`. So a
shared `test_temp_dir()` helper creates the directory *inside* a preopened
path on wasm and keeps `tempfile::tempdir()` on native. One cfg site, 11
call sites, cleanup still owned by `TempDir`.
That re-enables the 12 `db_versioning` instances, which only manipulate
directories. It also let the 3 `kv_backing_storage` instances get further
and hit a second, real platform gap that the temp-dir panic had been
masking:
Error: Unable to open meta file 00000002.meta
Caused by: 0: Failed to mmap
1: platform not supported
`memmap2` ships `unix.rs`, `windows.rs` and a stub for everything else
(`memmap2/src/stub.rs`), so `turbo-persistence` cannot open a database on
WASI at all. Those 3 keep an ignore, but now with the cause that is
actually true instead of one that isn't. An mmap-free read path is real
product work and is left as a follow-up.
Also sharpens the 12 `no unwinding on wasm` reasons to say *why* they are
permanent — std for this target is built `panic = abort`, so
`catch_unwind` can never catch. Verified: `-C panic=unwind` fails to link
with "the crate `panic_unwind` does not have the panic strategy `unwind`",
so this is not a to-do.
turbo-tasks-backend on wasm goes from 15 ignored to 3; across the stack,
31 ignored instances become 19. Every remaining one names a platform
limit traceable to a specific file.
Includes one unrelated-but-required fix: `storage_schema.rs` imports
`std::mem::size_of` whose only use is inside a
`#[cfg(target_pointer_width = "64")]` test, so wasm saw an unused import
and `-D warnings` failed. The import is now gated the same way as its use.
The single `Cargo.lock` line is cargo-generated from the parent layer and
reappears on every build; committing it keeps the tree clean.
Verified: db_versioning wasm 12 passed/0 ignored; kv_backing_storage wasm
3 ignored/0 failed; backend native 99 passed/0 ignored; instance counts
unchanged (wasm 98, native 99); next-napi-bindings host+wasm 0 errors;
fmt and clippy -D warnings clean on host and wasm.
Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
sokra
force-pushed
the
codex/turbopack-wasm/wasm-temp-dir-tests
branch
from
September 17, 2026 21:21
122583b to
7c64060
Compare
sokra
removed this pull request from stack #98698
September 17, 2026 21:27
sokra
added this pull request to stack #98845
September 17, 2026 21:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Makes
turbo-tasks-backend'sdb_versioningtests run onwasm32-wasip1-threadsinstead of beingskipped, by routing temporary-directory creation in tests through a small helper that does not depend
on
std::env::temp_dir().Twelve test instances that were previously skipped now execute on wasm. Three related
kv_backing_storageinstances remain skipped, but for a different — and verified — reason (see below).Native behaviour is unchanged: the same tests run exactly as before, and nothing is newly skipped there.
The wider WASI suite also exposed an unrelated intermittent stall in
test_unbounded_busy_queue_does_not_churn_workers: passing isolated runs finish in about 0.25 seconds,while repeated runs can stop making progress indefinitely. That stress test is now ignored only on
WASI, with the observed reason recorded; native coverage remains enabled while the underlying
multi-threaded runtime stall is investigated separately.
Why?
These tests were skipped with the reason
no temp directory on WASI, which turned out to be only halftrue. WASI genuinely has no notion of a system temp directory —
std::env::temp_dir()is hard-coded tounsupported()instd/sys/paths/wasi.rs, so it panics regardless ofTMPDIR— but the filesystemitself works fine. A WASI guest can use any directory the host preopens for it.
So the blocker was in how the tests asked for a directory, not in the platform. Asking WASI where "temp"
is fails; creating a directory inside a path the host already granted succeeds.
This matters beyond tidiness: skip reasons are the primary record of what does and does not work on
wasm, and an inaccurate one is worse than no reason at all, because it makes a fixable problem look like
a platform limit and quietly discourages anyone from trying.
Fixing it also uncovered the real limitation underneath. With temp directories working, the three
kv_backing_storagetests get further and hit a genuine platform gap:memmap2shipsunix.rs,windows.rsand a stub for every other target, soturbo-persistencecannot open a database on WASIat all (
Failed to mmap: platform not supported). Those three are still skipped, now with that causerecorded instead of the temp-directory one. That is a real, separate piece of work — persistent caching
cannot function on wasm until
turbo-persistencegrows a non-mmap read path — and it is now visiblerather than hidden behind a misleading reason.
How?
A single test-only helper owns the platform difference, so the ~11 call sites stay identical in shape
and no test carries its own
cfg. On native it delegates totempfile::tempdir(), preserving today'sbehaviour byte for byte, including having
TempDirown cleanup. On wasm it creates the directory insidea preopened path instead of consulting the environment. The helper is crate-private and compiled only
for tests, so it adds nothing to the shipped crate, and it returns
tempfile's own error type ratherthan erasing it.
Two deliberate choices are worth calling out for review:
kv_backing_storagetests was run individually and traced tomemmap2's stub before being skippedagain; the twelve
db_versioningones were confirmed to pass. Nothing is skipped speculatively.ignorewith a reason rather thancfg, so they appear in test output asignored, <reason>instead of silently vanishing from the run. That is what keeps the count ofwhat-doesn't-work-on-wasm honest and reviewable, and it is asserted that the native run still has
zero ignored tests.
The wasm coupling is documented at the helper: it relies on the host preopening a directory, which the
repository's Node wasi test host does. A different runner must provide the same, or update the helper.