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

Need more verbose output with x.py build #44305

Closed
jessicah opened this issue Sep 4, 2017 · 7 comments
Closed

Need more verbose output with x.py build #44305

jessicah opened this issue Sep 4, 2017 · 7 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jessicah
Copy link
Contributor

jessicah commented Sep 4, 2017

Running ./x.py build -vv only outputs the rustc compilation command, which is insufficient.

For example, it should direct rustc to provide more verbose output as well, e.g. the linking steps, and where object files are created from cpp source files, these compilation steps as well.

I've tried various incantations, such as RUSTC_FLAGS="-Z verbose -Z print-link-args --verbose" RUSTC_VERBOSE=10 ./x.py build -vv --stage 0 src/librustc but I'm not getting any further useful output.

@Mark-Simulacrum
Copy link
Member

I think the expected approach today is to use RUSTFLAGS when more information from rustc is needed. It's not ideal (need to recompile everything) but otherwise should work.

@alexcrichton Is there some flag we can pass to rustc to have 'verbose' step output?

@Mark-Simulacrum Mark-Simulacrum added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-feature-request Category: A feature request, i.e: not implemented / a PR. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Sep 4, 2017
@jessicah
Copy link
Contributor Author

jessicah commented Sep 4, 2017

I've also tried with RUSTC_FLAGS="-Z verbose -Z print-link-args --verbose", but then I run into a problem with cargo: https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/cargo_rustc/mod.rs#L371 which seems to be a consequence of https://github.com/rust-lang/rust/blob/master/src/bootstrap/compile.rs#L802

I've tried removing that, but then I get an error:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:335:20

Full backtrace:

stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:380
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:396
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:611
   5: std::panicking::begin_panic_new
             at /checkout/src/libstd/panicking.rs:553
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:521
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:497
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:92
   9: core::panicking::panic
             at /checkout/src/libcore/panicking.rs:51
  10: <core::option::Option<T>>::unwrap
  11: bootstrap::compile::run_cargo
  12: <bootstrap::compile::Std as bootstrap::builder::Step>::run
  13: bootstrap::builder::Builder::ensure
  14: <bootstrap::compile::Test as bootstrap::builder::Step>::run
  15: bootstrap::builder::Builder::ensure
  16: <bootstrap::compile::Rustc as bootstrap::builder::Step>::run
  17: bootstrap::builder::Builder::ensure
  18: <bootstrap::compile::Rustc as bootstrap::builder::Step>::make_run
  19: bootstrap::builder::StepDescription::maybe_run
  20: bootstrap::builder::StepDescription::run
  21: bootstrap::builder::Builder::run
  22: bootstrap::Build::build
  23: bootstrap::main
  24: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  25: std::rt::lang_start
             at /checkout/src/libstd/panicking.rs:458
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/rt.rs:59
  26: main
  27: __libc_start_main
  28: _start
Traceback (most recent call last):
  File "./x.py", line 20, in <module>
    bootstrap.main()
  File "/home/jessicah/rust/src/bootstrap/bootstrap.py", line 761, in main
    bootstrap()
  File "/home/jessicah/rust/src/bootstrap/bootstrap.py", line 752, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/home/jessicah/rust/src/bootstrap/bootstrap.py", line 148, in run
    raise RuntimeError(err)

@petrochenkov
Copy link
Contributor

I've also tried with RUSTC_FLAGS="-Z verbose -Z print-link-args --verbose", but then I run into a problem with cargo

#43855 strikes again

@Mark-Simulacrum Mark-Simulacrum modified the milestone: impl period Sep 15, 2017
@aturon aturon removed this from the impl period milestone Sep 15, 2017
@o01eg
Copy link
Contributor

o01eg commented Dec 4, 2017

Same for RUST_LOG=info:

INFO:rustc::traits::fulfill: selecting trait `Binder(TraitPredicate(<u64 as convert::From<isize>>))` at depth 0 yielded Err
INFO:rustc::traits::trans: Cache miss: Binder(<T as num::dec2flt::rawfp::RawFloat>) => VtableParam([])
INFO:rustc::traits::trans: Cache miss: Binder(<f32 as num::dec2flt::rawfp::RawFloat>) => VtableImpl(impl_def_id=DefId { krate: CrateNum(0), index: DefIndex(0:388) => core[9097]::num[0]::dec2flt[0]::rawfp[0]::{{impl}}[1] }, substs=Slice([]), nested=[])
INFO:rustc::traits::trans: Cache miss: Binder(<f64 as num::dec2flt::rawfp::RawFloat>) => VtableImpl(impl_def_id=DefId { krate: CrateNum(0), index: DefIndex(0:401) => core[9097]::num[0]::dec2flt[0]::rawfp[0]::{{impl}}[2] }, substs=Slice([]), nested=[])
INFO:cargo::ops::cargo_rustc::job_queue: end: core v0.0.0 (file:///tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/src/libcore) => Target(lib)/Profile(build) => Target
error: Could not compile `core`.

Caused by:
  failed to parse process output: `/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/bootstrap/debug/rustc --crate-name core src/libcore/lib.rs --error-format json --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=63e74be82340645b -C extra-filename=-63e74be82340645b --out-dir /tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage0-std/release/deps` (exit code: 0)

Caused by:
  compiler stdout is not empty: `Pre-trans`
thread 'main' panicked at 'command did not execute successfully: "/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "7" "-v" "--release" "--locked" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/tmp/portage/dev-lang/rust-9999-r1/work/rust-git-src/src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', src/bootstrap/compile.rs:882:8

@pnkfelix
Copy link
Member

See also #38686

@Mark-Simulacrum Mark-Simulacrum added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Aug 19, 2019
@Mark-Simulacrum
Copy link
Member

Retagging as a compiler feature request as ultimately rustbuild can't do much beyond threading options through to rustc here.

@Mark-Simulacrum Mark-Simulacrum added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Sep 1, 2019
@jyn514
Copy link
Member

jyn514 commented Jun 27, 2022

I ran RUSTFLAGS_BOOTSTRAP="-Zverbose -Zprint-link-args --verbose" x build just now and it seemed to work ok:

"cc" "-m64" "/tmp/rustcIRuy1m/symbols.o" "/home/jnelson/rust-lang/rust2/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps/rustdoc_tool_binary-83341ce0722fdcf9.1agbt3emqoq38569.rcgu.o" ...

All the linked issues have been closed. I'm going to close this as fixed.

@jyn514 jyn514 closed this as completed Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants