-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Prefix build script output with crate name when running in extra verbose mode. Fixes #6158. #6164
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
This seems reasonable to me! I might say we should just go ahead and probably switch the name output here to @rust-lang/cargo, any knee-jerk reactions or objections? |
This seems reasonable to me! (And yes, please use the version, in addition to the git hash.) |
☔ The latest upstream changes (presumably #6170) made this pull request unmergeable. Please resolve the merge conflicts. |
Sorry, what do you mean by "git hash" here? AFAICT the hashes in the output above are just cargo's calculated fingerprint for each crate. |
@luser We need enough information to uniquely identify a crate version. A version number helps; I'd also like to see a git hash for any crate being built from sources in git, or a source hash (the way cargo computes one) otherwise. Something easily tracked down after seeing it in a log. |
I changed things to use Here's what my local output looks like for my test project, having added a third build script from a git ref:
|
Looks reasonable to me! Although I agree that name+version is almost always enough to make the output unique, and if it's not then it's no worse than today! I'd personally lean towards just name/version and omitting git/path information |
dcdcb1b
to
068d9a6
Compare
…ose mode. Fixes rust-lang#6158. cargo's extra verbose mode is useful for getting detailed information out of builds in CI where it can be difficult to examine the build environment after-the-fact. However, when multiple build scripts are running as part of a build it's not always clear what output is from which build script. This patch makes cargo prefix each line of build script output with the crate name and version this case.
068d9a6
to
20920c0
Compare
OK I went with
I also rebased the patch over another change that conflicted. |
@bors: r+ |
📌 Commit 20920c0 has been approved by |
Prefix build script output with crate name when running in extra verbose mode. Fixes #6158. cargo's extra verbose mode is useful for getting detailed information out of builds in CI where it can be difficult to examine the build environment after-the-fact. However, when multiple build scripts are running as part of a build it's not always clear what output is from which build script. This patch makes cargo prefix each line of build script output with the crate name in this case. I put together [a simple test crate](https://github.com/luser/snippet/tree/build-script-output) for this. Building that crate on my machine with stable cargo produces: ``` luser@eye7:/build/snippet$ cargo build -vv Compiling one v0.1.0 (file:///build/snippet/one) Compiling two v0.1.0 (file:///build/snippet/two) Fresh itoa v0.3.4 Running `rustc --crate-name build_script_build one/build.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8e5ff38061b98562 -C extra-filename=-8e5ff38061b98562 --out-dir /build/snippet/target/debug/build/one-8e5ff38061b98562 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Running `rustc --crate-name build_script_build two/build.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=fcd8c089040e6ff4 -C extra-filename=-fcd8c089040e6ff4 --out-dir /build/snippet/target/debug/build/two-fcd8c089040e6ff4 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Running `/build/snippet/target/debug/build/two-fcd8c089040e6ff4/build-script-build` Running `/build/snippet/target/debug/build/one-8e5ff38061b98562/build-script-build` Error 0 Output 0 Output 0 Error 0 Output 1 Error 1 Error 1 Output 1 Error 2 Output 2 Error 2 Output 2 Error 3 Output 3 Error 3 Output 3 Error 4 Error 4 Output 4 Output 4 Error 5 Error 5 Output 5 Output 5 Error 6 Output 6 Error 6 Output 6 Error 7 Output 7 Error 7 Output 7 Error 8 Error 8 Output 8 Output 8 Error 9 Output 9 Error 9 Output 9 Running `rustc --crate-name two two/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=904ea56f5613ae62 -C extra-filename=-904ea56f5613ae62 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Running `rustc --crate-name one one/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=c2b76a52468c9a0b -C extra-filename=-c2b76a52468c9a0b --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Compiling snippet v0.1.4-alpha.0 (file:///build/snippet) Running `rustc --crate-name snippet src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=a5c6abeab1e38e11 -C extra-filename=-a5c6abeab1e38e11 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib` Running `rustc --crate-name snippet src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8b5a0b44264aa67c -C extra-filename=-8b5a0b44264aa67c --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern snippet=/build/snippet/target/debug/deps/libsnippet-a5c6abeab1e38e11.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib` Finished dev [unoptimized + debuginfo] target(s) in 0.76s ``` Building that crate with my local cargo including this change produces: ``` luser@eye7:/build/snippet$ /build/cargo/target/debug/cargo build -vv Compiling one v0.1.0 (/build/snippet/one) Compiling two v0.1.0 (/build/snippet/two) Compiling itoa v0.3.4 Running `rustc --crate-name build_script_build one/build.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8e5ff38061b98562 -C extra-filename=-8e5ff38061b98562 --out-dir /build/snippet/target/debug/build/one-8e5ff38061b98562 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Running `rustc --crate-name build_script_build two/build.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=fcd8c089040e6ff4 -C extra-filename=-fcd8c089040e6ff4 --out-dir /build/snippet/target/debug/build/two-fcd8c089040e6ff4 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Running `rustc --crate-name itoa /home/luser/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-0.3.4/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=327a92d5ddd56b4a -C extra-filename=-327a92d5ddd56b4a --out-dir /build/snippet/target/debug/deps -L dependency=/build/snippet/target/debug/deps --cap-lints warn` Running `/build/snippet/target/debug/build/one-8e5ff38061b98562/build-script-build` Running `/build/snippet/target/debug/build/two-fcd8c089040e6ff4/build-script-build` [one-e779b28932bbd20b] Error 0 [one-e779b28932bbd20b] Output 0 [one-e779b28932bbd20b] Output 1 [one-e779b28932bbd20b] Error 1 [two-adc2191c38bf9afc] Error 0 [two-adc2191c38bf9afc] Output 0 [one-e779b28932bbd20b] Error 2 [one-e779b28932bbd20b] Output 2 [two-adc2191c38bf9afc] Error 1 [two-adc2191c38bf9afc] Output 1 [one-e779b28932bbd20b] Output 3 [one-e779b28932bbd20b] Error 3 [two-adc2191c38bf9afc] Error 2 [two-adc2191c38bf9afc] Output 2 [one-e779b28932bbd20b] Error 4 [one-e779b28932bbd20b] Output 4 [two-adc2191c38bf9afc] Error 3 [two-adc2191c38bf9afc] Output 3 [one-e779b28932bbd20b] Error 5 [one-e779b28932bbd20b] Output 5 [two-adc2191c38bf9afc] Error 4 [two-adc2191c38bf9afc] Output 4 [one-e779b28932bbd20b] Error 6 [one-e779b28932bbd20b] Output 6 [two-adc2191c38bf9afc] Error 5 [two-adc2191c38bf9afc] Output 5 [one-e779b28932bbd20b] Error 7 [one-e779b28932bbd20b] Output 7 [two-adc2191c38bf9afc] Error 6 [two-adc2191c38bf9afc] Output 6 [one-e779b28932bbd20b] Error 8 [one-e779b28932bbd20b] Output 8 [two-adc2191c38bf9afc] Error 7 [two-adc2191c38bf9afc] Output 7 [one-e779b28932bbd20b] Error 9 [one-e779b28932bbd20b] Output 9 [two-adc2191c38bf9afc] Output 8 [two-adc2191c38bf9afc] Error 8 Running `rustc --crate-name one one/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=c2b76a52468c9a0b -C extra-filename=-c2b76a52468c9a0b --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` [two-adc2191c38bf9afc] Error 9 [two-adc2191c38bf9afc] Output 9 Running `rustc --crate-name two two/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=904ea56f5613ae62 -C extra-filename=-904ea56f5613ae62 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Compiling snippet v0.1.4-alpha.0 (/build/snippet) Running `rustc --crate-name snippet src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=a5c6abeab1e38e11 -C extra-filename=-a5c6abeab1e38e11 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib` Running `rustc --crate-name snippet src/main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8b5a0b44264aa67c -C extra-filename=-8b5a0b44264aa67c --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern snippet=/build/snippet/target/debug/deps/libsnippet-a5c6abeab1e38e11.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib` Finished dev [unoptimized + debuginfo] target(s) in 0.90s ``` I used `invocation_name` here for no particular reason other than it was being used by the build plan code immediately above, but since that includes the fingerprint it might be nicer to use just `pkg_name`?
💔 Test failed - status-appveyor |
tests/testsuite/profile_targets.rs
Outdated
[RUNNING] `rustc --crate-name foo src/lib.rs [..]--crate-type lib --emit=dep-info,metadata -C codegen-units=1 -C debuginfo=2 [..] | ||
[RUNNING] `rustc --crate-name foo src/lib.rs [..]--emit=dep-info,metadata -C codegen-units=1 -C debuginfo=2 --test [..] | ||
[RUNNING] `rustc --crate-name test1 tests/test1.rs [..]--emit=dep-info,metadata -C codegen-units=1 -C debuginfo=2 --test [..] | ||
[RUNNING] `rustc --crate-name foo src/main.rs [..]--emit=dep-info,metadata -C codegen-units=1 -C debuginfo=2 --test [..] | ||
[RUNNING] `rustc --crate-name bench1 benches/bench1.rs [..]--emit=dep-info,metadata -C codegen-units=1 -C debuginfo=2 --test [..] | ||
[RUNNING] `rustc --crate-name ex1 examples/ex1.rs [..]--emit=dep-info,metadata -C codegen-units=1 -C debuginfo=2 --test [..] | ||
[FINISHED] dev [unoptimized + debuginfo] [..] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this line should have been removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, that was a rebase mistake! I swear I ran tests locally, I'm not sure why it didn't fail here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this test only runs on nightly and I was using stable cargo to run cargo test
locally:
20920c0#diff-2cbe411b955101d5ff2d27d7a2b63503R571
@bors: r+ |
📌 Commit 989ebee has been approved by |
Prefix build script output with crate name when running in extra verbose mode. Fixes #6158. cargo's extra verbose mode is useful for getting detailed information out of builds in CI where it can be difficult to examine the build environment after-the-fact. However, when multiple build scripts are running as part of a build it's not always clear what output is from which build script. This patch makes cargo prefix each line of build script output with the crate name in this case. I put together [a simple test crate](https://github.com/luser/snippet/tree/build-script-output) for this. Building that crate on my machine with stable cargo produces: ``` luser@eye7:/build/snippet$ cargo build -vv Compiling one v0.1.0 (file:///build/snippet/one) Compiling two v0.1.0 (file:///build/snippet/two) Fresh itoa v0.3.4 Running `rustc --crate-name build_script_build one/build.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8e5ff38061b98562 -C extra-filename=-8e5ff38061b98562 --out-dir /build/snippet/target/debug/build/one-8e5ff38061b98562 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Running `rustc --crate-name build_script_build two/build.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=fcd8c089040e6ff4 -C extra-filename=-fcd8c089040e6ff4 --out-dir /build/snippet/target/debug/build/two-fcd8c089040e6ff4 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Running `/build/snippet/target/debug/build/two-fcd8c089040e6ff4/build-script-build` Running `/build/snippet/target/debug/build/one-8e5ff38061b98562/build-script-build` Error 0 Output 0 Output 0 Error 0 Output 1 Error 1 Error 1 Output 1 Error 2 Output 2 Error 2 Output 2 Error 3 Output 3 Error 3 Output 3 Error 4 Error 4 Output 4 Output 4 Error 5 Error 5 Output 5 Output 5 Error 6 Output 6 Error 6 Output 6 Error 7 Output 7 Error 7 Output 7 Error 8 Error 8 Output 8 Output 8 Error 9 Output 9 Error 9 Output 9 Running `rustc --crate-name two two/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=904ea56f5613ae62 -C extra-filename=-904ea56f5613ae62 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Running `rustc --crate-name one one/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=c2b76a52468c9a0b -C extra-filename=-c2b76a52468c9a0b --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Compiling snippet v0.1.4-alpha.0 (file:///build/snippet) Running `rustc --crate-name snippet src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=a5c6abeab1e38e11 -C extra-filename=-a5c6abeab1e38e11 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib` Running `rustc --crate-name snippet src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8b5a0b44264aa67c -C extra-filename=-8b5a0b44264aa67c --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern snippet=/build/snippet/target/debug/deps/libsnippet-a5c6abeab1e38e11.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib` Finished dev [unoptimized + debuginfo] target(s) in 0.76s ``` Building that crate with my local cargo including this change produces: ``` luser@eye7:/build/snippet$ /build/cargo/target/debug/cargo build -vv Compiling one v0.1.0 (/build/snippet/one) Compiling two v0.1.0 (/build/snippet/two) Compiling itoa v0.3.4 Running `rustc --crate-name build_script_build one/build.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8e5ff38061b98562 -C extra-filename=-8e5ff38061b98562 --out-dir /build/snippet/target/debug/build/one-8e5ff38061b98562 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Running `rustc --crate-name build_script_build two/build.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=fcd8c089040e6ff4 -C extra-filename=-fcd8c089040e6ff4 --out-dir /build/snippet/target/debug/build/two-fcd8c089040e6ff4 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Running `rustc --crate-name itoa /home/luser/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-0.3.4/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=327a92d5ddd56b4a -C extra-filename=-327a92d5ddd56b4a --out-dir /build/snippet/target/debug/deps -L dependency=/build/snippet/target/debug/deps --cap-lints warn` Running `/build/snippet/target/debug/build/one-8e5ff38061b98562/build-script-build` Running `/build/snippet/target/debug/build/two-fcd8c089040e6ff4/build-script-build` [one-e779b28932bbd20b] Error 0 [one-e779b28932bbd20b] Output 0 [one-e779b28932bbd20b] Output 1 [one-e779b28932bbd20b] Error 1 [two-adc2191c38bf9afc] Error 0 [two-adc2191c38bf9afc] Output 0 [one-e779b28932bbd20b] Error 2 [one-e779b28932bbd20b] Output 2 [two-adc2191c38bf9afc] Error 1 [two-adc2191c38bf9afc] Output 1 [one-e779b28932bbd20b] Output 3 [one-e779b28932bbd20b] Error 3 [two-adc2191c38bf9afc] Error 2 [two-adc2191c38bf9afc] Output 2 [one-e779b28932bbd20b] Error 4 [one-e779b28932bbd20b] Output 4 [two-adc2191c38bf9afc] Error 3 [two-adc2191c38bf9afc] Output 3 [one-e779b28932bbd20b] Error 5 [one-e779b28932bbd20b] Output 5 [two-adc2191c38bf9afc] Error 4 [two-adc2191c38bf9afc] Output 4 [one-e779b28932bbd20b] Error 6 [one-e779b28932bbd20b] Output 6 [two-adc2191c38bf9afc] Error 5 [two-adc2191c38bf9afc] Output 5 [one-e779b28932bbd20b] Error 7 [one-e779b28932bbd20b] Output 7 [two-adc2191c38bf9afc] Error 6 [two-adc2191c38bf9afc] Output 6 [one-e779b28932bbd20b] Error 8 [one-e779b28932bbd20b] Output 8 [two-adc2191c38bf9afc] Error 7 [two-adc2191c38bf9afc] Output 7 [one-e779b28932bbd20b] Error 9 [one-e779b28932bbd20b] Output 9 [two-adc2191c38bf9afc] Output 8 [two-adc2191c38bf9afc] Error 8 Running `rustc --crate-name one one/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=c2b76a52468c9a0b -C extra-filename=-c2b76a52468c9a0b --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` [two-adc2191c38bf9afc] Error 9 [two-adc2191c38bf9afc] Output 9 Running `rustc --crate-name two two/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=904ea56f5613ae62 -C extra-filename=-904ea56f5613ae62 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps` Compiling snippet v0.1.4-alpha.0 (/build/snippet) Running `rustc --crate-name snippet src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=a5c6abeab1e38e11 -C extra-filename=-a5c6abeab1e38e11 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib` Running `rustc --crate-name snippet src/main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8b5a0b44264aa67c -C extra-filename=-8b5a0b44264aa67c --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern snippet=/build/snippet/target/debug/deps/libsnippet-a5c6abeab1e38e11.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib` Finished dev [unoptimized + debuginfo] target(s) in 0.90s ``` I used `invocation_name` here for no particular reason other than it was being used by the build plan code immediately above, but since that includes the fingerprint it might be nicer to use just `pkg_name`?
☀️ Test successful - status-appveyor, status-travis |
cargo's extra verbose mode is useful for getting detailed information out of
builds in CI where it can be difficult to examine the build environment
after-the-fact. However, when multiple build scripts are running as part of a
build it's not always clear what output is from which build script. This patch
makes cargo prefix each line of build script output with the crate name
in this case.
I put together a simple test crate for this. Building that crate on my machine with stable cargo produces:
Building that crate with my local cargo including this change produces:
I used
invocation_name
here for no particular reason other than it was being used by the build plan code immediately above, but since that includes the fingerprint it might be nicer to use justpkg_name
?