Open kornelski opened 3 years ago
I agree this would be great to support! I don't know the best way to finagle it but having something like a separate command which installs the sdk is probably the best starting point, and this could probably manage the install via the pre-compiled binaries on wasi-sdk's CI.
Target wasm32-wasip1
successfully compiles with zstd-sys dependency via cargo build --target wasm32-wasip1
.
Probably, we have just to wait.... a bit....
Easier to use cargo-zigbuild, so you can use the same command to cross-compile to any target, including wasi.
cargo-zigbuild --target=wasm32-wasi
zigbuild doesn't build zstd-sys for me :cry:
Results in:
(cargo-wasi v0.1.23, Rust 1.55, macOS 15b/x86-64)
From what I could gather, compiling C deps with headers requires wasi-sdk and adding a flag to
clang
:--sysroot=${WASI_SDK_PATH}/share/wasi-sysroot"
.Could
cargo wasi
support installing and configuring the SDK? Without it it's hard to build any non-trivial Rust project (about 23% of Rust crates depend on C code).