Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config.toml.example: wasi-root field is in a wrong section #82317

Closed
osa1 opened this issue Feb 20, 2021 · 2 comments · Fixed by #82360
Closed

config.toml.example: wasi-root field is in a wrong section #82317

osa1 opened this issue Feb 20, 2021 · 2 comments · Fixed by #82360
Assignees
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@osa1
Copy link
Contributor

osa1 commented Feb 20, 2021

The wasi-root field needs to be in section target.wasm32-wasi, but in config.toml.example it's in target.x86_64-unknown-linux-gnu section. Just enabling wasi-root causes an unhelpful error message.

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/bootstrap/compile.rs:193:48
stack backtrace:
   0: rust_begin_unwind
             at /rustc/05b6023675d77979637b04a350c85903fbf59257/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/05b6023675d77979637b04a350c85903fbf59257/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/05b6023675d77979637b04a350c85903fbf59257/library/core/src/panicking.rs:50:5
   3: core::option::Option<T>::unwrap
             at /rustc/05b6023675d77979637b04a350c85903fbf59257/library/core/src/option.rs:386:21
   4: bootstrap::compile::copy_self_contained_objects
             at ./src/bootstrap/compile.rs:193:22
   5: <bootstrap::compile::Std as bootstrap::builder::Step>::run
             at ./src/bootstrap/compile.rs:95:28
   6: bootstrap::builder::Builder::ensure
             at ./src/bootstrap/builder.rs:1529:23
   7: <bootstrap::compile::Std as bootstrap::builder::Step>::make_run
             at ./src/bootstrap/compile.rs:51:9
   8: bootstrap::builder::StepDescription::maybe_run
             at ./src/bootstrap/builder.rs:197:13
   9: bootstrap::builder::StepDescription::run
             at ./src/bootstrap/builder.rs:238:21
  10: bootstrap::builder::Builder::run_step_descriptions
             at ./src/bootstrap/builder.rs:587:9
  11: bootstrap::builder::Builder::execute_cli
             at ./src/bootstrap/builder.rs:579:9
  12: bootstrap::Build::build
             at ./src/bootstrap/lib.rs:506:17
  13: bootstrap::main
             at ./src/bootstrap/bin/main.rs:33:5
  14: core::ops::function::FnOnce::call_once
             at /rustc/05b6023675d77979637b04a350c85903fbf59257/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
failed to run: /home/omer/rust/rust/build/bootstrap/debug/bootstrap build --stage 1 library/std

If having a wasm32-wasi section always in the example config file is fine then we could move the section and wasi-root field right before the beginning of next section (e.g. [dist]). So the config.toml.example would look like:

...
[target.wasm32-wasi]

# The root location of the `wasm32-wasi` sysroot.
# wasi-root = "..."

[dist]
...
@osa1 osa1 changed the title config.toml: wasi-root field is in a wrong section config.toml.example: wasi-root field is in a wrong section Feb 20, 2021
@JohnTitor JohnTitor added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Feb 20, 2021
@Mark-Simulacrum
Copy link
Member

I'd be happy to accept a PR moving it.

@osa1
Copy link
Contributor Author

osa1 commented Feb 21, 2021

@rustbot claim

jyn514 pushed a commit to jyn514/rust that referenced this issue Mar 1, 2021
config.toml parsing error improvements

Improve error messages for musl-libdir and wasi-root keys. Previously
the parser would panic with `unwrap()`. Now it prints

      Target "wasm32-wasi" does not have a "wasi-root" key

(and similar for the `musl-libdir` field, which is used in target that
use musl)

Also update comments around wasi-root field to make it clear that the
field is only valid in wasm32-wasi target and needs to be moved to a
`[target.wasm32-wasi]` section to be valid.

Fixes rust-lang#82317

---

r? `@Mark-Simulacrum`
@bors bors closed this as completed in 81cfa98 Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants