The Nix package, the dev shell, and the test check set CC_wasm32_wasip2 and AR_wasm32_wasip2 to the clang of pkgsCross.wasi32 (wasi-libc), so build scripts with the cc crate work, for example rusqlite with bundled SQLite. The runtime-toolchain check links C into a probe with the packaged host and an empty PATH.
This commit is contained in:
@@ -265,6 +265,11 @@ The reply is `{"type": "built", "wasm": "/actor/cargo/public/builds/<n>/<name>.w
|
||||
or `{"type": "build_failed", "errors": "...", "tests": {...}}`. Pass
|
||||
`wasm`, `source`, and `built_by` on to `spawn` or `upgrade`.
|
||||
|
||||
Build scripts can compile C for `wasm32-wasip2`: the host sets
|
||||
`CC_wasm32_wasip2` and `AR_wasm32_wasip2` to a WASI clang with wasi-libc, so
|
||||
the `cc` crate (for example `rusqlite` with `bundled`) works. Its headers are
|
||||
WASI 0.1: C code that needs sockets does not build.
|
||||
|
||||
A Rust actor depends on the SDK with `sausage-actor = "0.1"`. `cargo` points
|
||||
that dependency at the SDK of the host, which it publishes at
|
||||
`/actor/cargo/public/sdk/`.
|
||||
|
||||
Reference in New Issue
Block a user