Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/cargo/core/compiler/custom_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ fn build_work(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Job> {
);
cmd.env_remove("RUSTFLAGS");

if cx.bcx.ws.config().extra_verbose() {
cmd.display_env_vars();
}

// Gather the set of native dependencies that this package has along with
// some other variables to close over.
//
Expand Down
16 changes: 16 additions & 0 deletions tests/testsuite/build_script_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,22 @@ fn rustc_bootstrap() {
.run();
}

#[cargo_test]
fn build_script_env_verbose() {
let build_rs = r#"
fn main() {}
"#;
let p = project()
.file("Cargo.toml", &basic_manifest("verbose-build", "0.0.1"))
.file("src/lib.rs", "")
.file("build.rs", build_rs)
.build();

p.cargo("check -vv")
.with_stderr_contains("[RUNNING] `[..]CARGO=[..]build-script-build`")
.run();
}

#[cargo_test]
#[cfg(target_arch = "x86_64")]
fn build_script_sees_cfg_target_feature() {
Expand Down