fe binary fails wasm32-wasip1 check due to sonatina native deps
- Dominant language
- Rust
- Stars
- 1.7k
- Forks
- 218
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 8
Description
The `fe` binary can't compile for `wasm32-wasip1` because sonatina-codegen transitively pulls in mimalloc (via egglog), which needs native C compilation.
The dependency chain is: sonatina-codegen -> egglog -> mimalloc -> libmimalloc-sys (fails on wasm, needs sched.h)
Current workaround (#1218): removed `-p fe` from the wasi CI check. fe-driver and fe-resolver still pass fine.
Before the sonatina backend the full binary compiled for wasi. Would be nice to get that back, especially if we ever want to run the compiler in a wasm sandbox.
Some options:
- Feature-gate sonatina-codegen so wasm builds can skip the native backend
- Upstream fix in egglog to use a pure-Rust allocator on wasm targets
- cfg(not(target_arch = "wasm32")) around sonatina imports in fe-codegen, yul-only on wasm
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the wasi CI check and the dependency chain through sonatina-codegen, egglog, mimalloc, and libmimalloc-sys. Inspect fe-codegen's sonatina imports and the workaround in #1218, then determine which listed approach is viable. Done means the fe binary builds for wasm32-wasip1 and the full wasi check can include -p fe again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100