From 9a5fd425e13b5b769d70c7f100afd0dd5f6247be Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Tue, 12 Nov 2024 16:41:59 -0500 Subject: [PATCH] feat(rustdoc): diplay env vars in extra verbose mode This seems to be an overlook --- src/cargo/core/compiler/compilation.rs | 5 ++++- tests/testsuite/profile_targets.rs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cargo/core/compiler/compilation.rs b/src/cargo/core/compiler/compilation.rs index e4cccf2609a..39f0f9f7241 100644 --- a/src/cargo/core/compiler/compilation.rs +++ b/src/cargo/core/compiler/compilation.rs @@ -199,7 +199,10 @@ impl<'gctx> Compilation<'gctx> { unit: &Unit, script_meta: Option, ) -> CargoResult { - let rustdoc = ProcessBuilder::new(&*self.gctx.rustdoc()?); + let mut rustdoc = ProcessBuilder::new(&*self.gctx.rustdoc()?); + if self.gctx.extra_verbose() { + rustdoc.display_env_vars(); + } let cmd = fill_rustc_tool_env(rustdoc, unit); let mut cmd = self.fill_env(cmd, &unit.pkg, script_meta, unit.kind, ToolKind::Rustdoc)?; cmd.retry_with_argfile(true); diff --git a/tests/testsuite/profile_targets.rs b/tests/testsuite/profile_targets.rs index 8aa2c372db6..c95369966ef 100644 --- a/tests/testsuite/profile_targets.rs +++ b/tests/testsuite/profile_targets.rs @@ -715,7 +715,7 @@ fn profile_selection_doc() { [COMPILING] bar v0.0.1 ([ROOT]/foo/bar) [DOCUMENTING] bar v0.0.1 ([ROOT]/foo/bar) [RUNNING] `[..] rustc --crate-name bar --edition=2015 bar/src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C codegen-units=5 [..]` -[RUNNING] `rustdoc [..]--crate-name bar bar/src/lib.rs [..] +[RUNNING] `[..] rustdoc [..]--crate-name bar bar/src/lib.rs [..] [RUNNING] `[..] rustc --crate-name bar --edition=2015 bar/src/lib.rs [..]--crate-type lib --emit=[..]metadata -C panic=abort[..]-C codegen-units=1 -C debuginfo=2 [..]` [COMPILING] bdep v0.0.1 ([ROOT]/foo/bdep) [RUNNING] `[..] rustc --crate-name bdep --edition=2015 bdep/src/lib.rs [..]--crate-type lib --emit=[..]link[..]-C codegen-units=5 [..]` @@ -724,7 +724,7 @@ fn profile_selection_doc() { [RUNNING] `[..][ROOT]/foo/target/debug/build/foo-[HASH]/build-script-build` [foo 0.0.1] foo custom build PROFILE=debug DEBUG=true OPT_LEVEL=0 [DOCUMENTING] foo v0.0.1 ([ROOT]/foo) -[RUNNING] `rustdoc [..]--crate-name foo src/lib.rs [..] +[RUNNING] `[..] rustdoc [..]--crate-name foo src/lib.rs [..] [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [GENERATED] [ROOT]/foo/target/doc/foo/index.html