Stream: t-compiler/help

Topic: how to enable debug-assertions for rustdoc


yunhua (Dec 26 2019 at 02:30, on Zulip):

following rustc-guide instruction, I've built rustdoc tool with the command: "./x.py build --stage 1 src/libstd src/tools/rustdoc --keep-stage 1".
in the source code, there are some debug print like debug!(...). but
RUST_LOG=debug ./build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc test.rs
I couldn't get any debug!(...) output.
I've added debug = true and debug-assertions = true in

  1. $rustc_source/config.toml
  2. $rustc_source/Cargo.toml
    [profile.release]
    debug = true
    debug-assertions = true

[profile.dev]
debug = true
debug-assertions = true

[profile.test]
debug = true
debug-assertions = true

I also tried add those to src/tools/rustdoc/Cargo.toml
[profile.dev]
debug = true
debug-assertions = true

Got warning like this.
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package: $rustc_source/src/tools/rustdoc/Cargo.toml
workspace: $rustc_source/Cargo.toml

Still couldn't get debug!() output with command:
RUST_LOG=debug ./build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc test.rs

yunhua (Dec 26 2019 at 04:13, on Zulip):

OH, it should be RUSTDOC_LOG=debug. this is the right command.
RUSTDOC_LOG=debug ./build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc test.rs

Last update: Jan 28 2020 at 01:15UTC