WASM: compile for wasm32, and fix trunk's binary selection on aarch64 #17
Reference in New Issue
Block a user
Delete Branch "fix/clippy-lints-wasm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Makes
cargo check --target wasm32-unknown-unknowncompile, and fixes the step after itso the job's remaining failure is a real one rather than a known-wrong binary download.
Refs #11. Not markedClosesdeliberately — see What this does not do.The three commits
9f6321dfix(formats)— drop the unused normaltokiodependencya7af8a4fix(wasm)— the two--cfgflags, in a wasm-scoped.cargo/config.toml90365b1ci(wasm)—trunk-actionv0.5.0 → v0.5.1 for aarch64#11was written around the getrandom error alone. It turned out to be three stackedblockers, each invisible until the previous was gone:
getrandom0.3 refuseswasm32-unknown-unknownwithout--cfg getrandom_backend="wasm_js"and the crate's
wasm_jsfeature — its own error is explicit that either alone isinsufficient. It is not a direct dependency; it arrives through
ahash.sylpheed-formatsdeclaredtokioas a normal dependency it never used as one,pulling
tokio/full→net→mio, which does not build for wasm32.bevy_eguineeds--cfg web_sys_unstable_apis.Ordering
The
tokioremoval is first and separate, because it is the one change that touchesanother crate, and because the reverse order would leave an intermediate commit still
failing on
mio. Verified: at9f6321dalone,cargo check --workspaceexits 0 and thewasm check fails with 0
mioerrors, 2 getrandom errors — the tokio removal reallydoes clear
mio, and every commit builds.Verification
Confirmed on two machines, two architectures, two toolchains:
cargo check --workspaceEach blocker is confirmed separately, not by the aggregate exit code: in the passing
run
bevy_eguicompiles and neithermionortokioappears in the wasm graph at all;in the failing control
bevy_eguiis never reached, which is what "stacked" means.The trunk bump was read out of the two bundled
dist/index.jsfiles rather than therelease notes. v0.5.0 switches on platform alone —
case 'linux': arch = 'x86_64-unknown-linux-gnu'— and never consults architecture, so on this aarch64 runnerit fetches an x86_64 binary. v0.5.1 adds
process.archwith'x64' → 'x86_64','arm64' → 'aarch64', andcore.setFailedotherwise. It also moves the download hostthedodd/trunk→trunk-rs/trunk(trunk moved repositories), and swapsio.mvforio.cp, which is what avoidsEXDEVon a self-hosted runner whose/tmpis a separatefilesystem — ours. Note
EXDEVappears zero times in either bundle; that fix isvisible only as the primitive swap.
What this does not do
It is not known to turn the job green. Every check above concerns compiling, and
selecting and fetching trunk. The step after —
trunk build --release— has neverexecuted in this repository on any architecture, so there is no basis to predict it.
Read that log fresh.
#11should close on a green job, not on this merge.Provenance
Authored by
sylph-pi, which found and verified all three blockers. The commit split,the cross-architecture A/B, and the trunk-version check were done on the desktop. Neither
agent could complete it alone: the Pi holds
write:issuebut is read-only on the repo,the desktop holds
write:repositorybut cannot file issues.tokiodependency 9f6321d7d6cargo check --target wasm32compile a7af8a41c2`Install Trunk` has never run to completion here, because the two steps before it always failed first. With those cleared it becomes reachable, and on this runner v0.5.0 would fetch the wrong binary. v0.5.0 switches on PLATFORM alone and never consults the architecture: case 'linux': arch = 'x86_64-unknown-linux-gnu'; break; v0.5.1 reads it and maps it, failing loudly rather than wrongly: const arch = process.env['ARCH'] || process.arch; case 'x64': targetArch = 'x86_64'; break; case 'arm64': targetArch = 'aarch64'; break; default: core.setFailed(`Unsupported architecture: ${arch}`); return; Node reports `arm64` here, so it resolves to `aarch64`, and upstream does publish trunk-aarch64-unknown-linux-gnu.tar.gz. There is also an `ARCH` env override if the mapping is ever wrong. Read out of the two bundled dist/index.js files, not the release notes. Counts moved as predicted: `x86_64-unknown-linux-gnu` 1 -> 0, `aarch64` 0 -> 1, `os.arch()` 5 -> 5. Confirmed independently on both machines. Two further changes the bump carries, neither of them about architecture: * the download host moves thedodd/trunk -> trunk-rs/trunk. Trunk moved repositories and v0.5.0 still points at the old one -- arguably the more durable half of the fix. * `io.mv` 1 -> 0 and `io.cp` 2 -> 3. A cross-filesystem move throws EXDEV; a copy does not. This is the fix for self-hosted runners whose /tmp is a separate filesystem, which is ours. NOTE: the string EXDEV appears zero times in either bundle, so this cannot be found by grepping for the error it prevents -- it is visible only as the primitive swap. STILL UNVERIFIED: whether `trunk build --release` then succeeds. Everything above concerns selecting and fetching the binary. The step after it has never run in this repository's history, on any architecture, so there is no basis to predict it. Expect to read that log fresh. Refs #11 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>With the build fixed, `trunk build --release` succeeds and the job then died on its last step: ::error:: @actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES. Gitea presents as GHES and the action aborts by design -- go-gitea/gitea #31256 and #36024. Same class as the trunk-action bug this branch already fixes: an action written for GitHub's hosted fleet, on a runner that is not it. Dropped rather than downgraded, because nothing consumes the artifact. `web-dist` had exactly one reference in the repository -- the line that produced it. There is no `download-artifact`, no deploy step, and no second workflow. It was failing the job for no benefit. The two ways to keep it are recorded in the file rather than here, because choosing between them needs a fact this run does not provide (the runner's node version) or a supply-chain decision (a third-party action). What now runs end to end on aarch64, from scratch: Install Trunk ok (v0.5.1, the arch fix, on the real runner) cargo check wasm32 ok trunk build --release ok 10m 56s, 3 files in dist/ Refs #11 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>