Stream: t-compiler/help

Topic: Bug in config.toml wasi-root field?


osa1 (Aug 03 2020 at 12:51, on Zulip):

I have this in my config.toml

target = ["x86_64-unknown-linux-gnu", "wasm32-unknown-emscripten", "wasm32-wasi"]
...
wasi-root = "/home/omer/wasi-sdk-11.0/share/wasi-sysroot"

This is the panic I'm getting when I do x.py build:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/bootstrap/compile.rs:187:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to run: /home/omer/rust/rust/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:00:05

Panicking line:

let srcdir = builder.wasi_root(target).unwrap().join("lib/wasm32-wasi");

I have a wasi_root field already so I'm not sure why this is failing. Any ideas?

simulacrum (Aug 03 2020 at 13:01, on Zulip):

@osa1 is the wasi-root in a target config for, uh, whatever target you're trying to build for?

simulacrum (Aug 03 2020 at 13:01, on Zulip):

(I guess wasm32-unknown-wasi?)

osa1 (Aug 03 2020 at 13:02, on Zulip):

@simulacrum the wasi-root field is already in the config.toml.example, it's commented out, I just enabled it and updated the value. Should I move it to elsewhere?

simulacrum (Aug 03 2020 at 13:02, on Zulip):

let me look

osa1 (Aug 03 2020 at 13:03, on Zulip):

Oh wow, you're right, I need a new section for the target

simulacrum (Aug 03 2020 at 13:03, on Zulip):

yeah it's under target.x86_64-unknown-linux-gnu which is useless afaict, you probably want to move it to target.wasm32-unknown-wasi or whatever the triple is (I forget)

osa1 (Aug 03 2020 at 13:03, on Zulip):

Yeah this works:

[target.wasm32-wasi]
wasi-root = "/home/omer/wasi-sdk-11.0/share/wasi-sysroot"

[target.wasm32-unknown-emscripten]
wasi-root = "/home/omer/wasi-sdk-11.0/share/wasi-sysroot"
simulacrum (Aug 03 2020 at 13:03, on Zulip):

I'd be happy to take a patch fixing the config.toml.example

osa1 (Aug 03 2020 at 13:05, on Zulip):

Will submit a PR.

Last update: Sep 27 2020 at 13:45UTC