Skip to content

Commit 974e802

Browse files
committed
add note on how to build wasi
1 parent 41a9cd4 commit 974e802

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/tests/running.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,35 @@ coordinate running tests (see [src/bootstrap/src/core/build_steps/test.rs]).
342342
> **TODO**
343343
>
344344
> - Is there any support for using an iOS emulator?
345-
> - It's also unclear to me how the wasm or asm.js tests are run.
345+
> - It's also unclear to me how the asm.js tests are run.
346346
347347
[armhf-gnu]: https://github.com/rust-lang/rust/tree/master/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile
348348
[QEMU]: https://www.qemu.org/
349349
[remote-test-client]: https://github.com/rust-lang/rust/tree/master/src/tools/remote-test-client
350350
[remote-test-server]: https://github.com/rust-lang/rust/tree/master/src/tools/remote-test-server
351351
[src/bootstrap/src/core/build_steps/test.rs]: https://github.com/rust-lang/rust/blob/master/src/bootstrap/src/core/build_steps/test.rs
352352

353+
## Testing tests on wasi (wasm32-wasip1)
354+
355+
Some tests are specific to wasm targets.
356+
To run theste tests, you have to pass `--target wasm32-wasip1` to `x test`.
357+
Additionally, you need the wasi sdk.
358+
Follow the install instructions from the [wasi sdk repository] to get a sysroot on your computer.
359+
Some cmake commands that take a while and give a lot of very concerning c++ warnings...
360+
Then, in `bootstrap.toml`, point to the sysroot like so:
361+
362+
```
363+
[target.wasm32-wasip1]
364+
wasi-root = "<wasi-sdk ___location>/build/sysroot/install/share/wasi-sysroot"
365+
```
366+
367+
In my case I git-cloned it next to my rust folder, so it was `../wasi-sdk/build/....`
368+
Now, tests should just run, you don't have to set up anything else.
369+
370+
[wasi sdk repository]: https://github.com/WebAssembly/wasi-sdk
371+
372+
373+
353374
## Running rustc_codegen_gcc tests
354375

355376
First thing to know is that it only supports linux x86_64 at the moment. We will

0 commit comments

Comments
 (0)