Skip to content

Commit

Permalink
feat(rustdoc): diplay env vars in extra verbose mode
Browse files Browse the repository at this point in the history
This seems to be an overlook
  • Loading branch information
weihanglo committed Nov 13, 2024
1 parent 40ee338 commit 9a5fd42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/cargo/core/compiler/compilation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ impl<'gctx> Compilation<'gctx> {
unit: &Unit,
script_meta: Option<Metadata>,
) -> CargoResult<ProcessBuilder> {
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);
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/profile_targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 [..]`
Expand All @@ -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
Expand Down

0 comments on commit 9a5fd42

Please sign in to comment.