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

bootstrap: Normal compiler errors should not panic rustbuild #53379

Closed
RalfJung opened this issue Aug 15, 2018 · 5 comments
Closed

bootstrap: Normal compiler errors should not panic rustbuild #53379

RalfJung opened this issue Aug 15, 2018 · 5 comments

Comments

@RalfJung
Copy link
Member

When there is an error building rustc, there always is a 20-line wall of text below the actual error message:

Caused by:
  process didn't exit successfully: `/home/r/src/rust/rustc/build/bootstrap/debug/rustc --crate-name rustc_mir librustc_mir/lib.rs --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=ff181b58e43e5a7e -C extra-filename=-ff181b58e43e5a7e --out-dir /home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern arena=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libarena-b8f9e6fb5ae336d7.so --extern bitflags=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-3907cba388d41ef0.rlib --extern byteorder=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbyteorder-8246be02936c9b1b.rlib --extern either=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libeither-0a515e87c8afea9e.rlib --extern graphviz=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libgraphviz-45ae4394366d07fd.so --extern log=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-b6c566856a1e65b9.rlib --extern log_settings=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog_settings-f501f9d595863bbf.rlib --extern polonius_engine=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libpolonius_engine-c6e8cf18dad58451.rlib --extern rustc=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-b308e2da12bfc8a3.so --extern rustc_apfloat=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-165c205e2819b15f.rlib --extern rustc_data_structures=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-8b624a6d6082b2ff.so --extern rustc_errors=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-89eed8215142aadd.so --extern rustc_target=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-20eb47b9c402fee3.so --extern serialize=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8c9bc9ee6cc9592f.so --extern serialize=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8c9bc9ee6cc9592f.rlib --extern syntax=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-64bbe8e4870170a3.so --extern syntax_pos=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-3b51f50aecba154c.so -L native=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-01a673445b66da02/out -L native=/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-3c585aa15bfc4e69/out` (exit code: 1)
command did not execute successfully: "/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "8" "--release" "--features" " jemalloc" "--manifest-path" "/home/r/src/rust/rustc/src/rustc/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101
thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1119:9

Things get even worse when RUST_BACKTRACE is enabled because one is debugging something in the compiler, and the stage 1 build panics -- then we get two backtraces.

At least in the default configuration, bootstrap should not panic when cargo failed, it should exit gracefully.

@Mark-Simulacrum
Copy link
Member

We should get this I think in 4ish weeks, the fix has landed in cargo but we don't plan to backport it to beta.

@Mark-Simulacrum
Copy link
Member

Well, we can fix the panic, that's separate.

@RalfJung
Copy link
Member Author

RalfJung commented Aug 15, 2018

Yeah I was about to ask which role cargo plays here? It is the process being run, sure, but it seems like the problem is bootstrap asserting a successful execution, and panicking otherwise.

@Mark-Simulacrum
Copy link
Member

The caused by and process didn't execute successfully lines take up space too and are printed by Cargo.

@RalfJung
Copy link
Member Author

Ah I see. Yeah the biggest space-eater here is the "process didn't exit successfully".

However, once you run with RUST_BACKTRACE, the fact that it panics is also more than just aesthetics (panics are for unexpected errors, a compile failure is not so unexpected) -- it means that two backtraces are shown, the lower one usually filling the entire screen already.

pietroalbini added a commit to pietroalbini/rust that referenced this issue Nov 15, 2018
do not panic just because cargo failed

Currently, a rustc ICE during bootstrap shows *two* backtraces with `RUST_BACKTRACE`. Fix that by making bootstrap just exit when cargo fails. This matches what we do [when building a tool fails](https://github.com/rust-lang/rust/blob/master/src/bootstrap/tool.rs#L189) and [when other stuff (not called through `stream_cargo`, like `cargo test`) fails](https://github.com/rust-lang/rust/blob/master/src/build_helper/lib.rs#L43).

Fixes rust-lang#53379
kennytm added a commit to kennytm/rust that referenced this issue Nov 17, 2018
do not panic just because cargo failed

Currently, a rustc ICE during bootstrap shows *two* backtraces with `RUST_BACKTRACE`. Fix that by making bootstrap just exit when cargo fails. This matches what we do [when building a tool fails](https://github.com/rust-lang/rust/blob/master/src/bootstrap/tool.rs#L189) and [when other stuff (not called through `stream_cargo`, like `cargo test`) fails](https://github.com/rust-lang/rust/blob/master/src/build_helper/lib.rs#L43).

Fixes rust-lang#53379
pietroalbini added a commit to pietroalbini/rust that referenced this issue Nov 18, 2018
do not panic just because cargo failed

Currently, a rustc ICE during bootstrap shows *two* backtraces with `RUST_BACKTRACE`. Fix that by making bootstrap just exit when cargo fails. This matches what we do [when building a tool fails](https://github.com/rust-lang/rust/blob/master/src/bootstrap/tool.rs#L189) and [when other stuff (not called through `stream_cargo`, like `cargo test`) fails](https://github.com/rust-lang/rust/blob/master/src/build_helper/lib.rs#L43).

Fixes rust-lang#53379
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants