fix: rerun build script when target rustflags changed

fixes #13003
This commit is contained in:
heisen-li 2024-04-07 19:58:23 +08:00 committed by Weihang Lo
parent cdda9008a3
commit db7afeba4e
No known key found for this signature in database
GPG Key ID: D7DBF189825E82E7
2 changed files with 7 additions and 1 deletions

View File

@ -1526,11 +1526,14 @@ See https://doc.rust-lang.org/cargo/reference/build-scripts.html#rerun-if-change
.collect::<CargoResult<Vec<_>>>()?
};
let rustflags = build_runner.bcx.rustflags_args(unit).to_vec();
Ok(Fingerprint {
local: Mutex::new(local),
rustc: util::hash_u64(&build_runner.bcx.rustc().verbose_version),
deps,
outputs: if overridden { Vec::new() } else { vec![output] },
rustflags,
// Most of the other info is blank here as we don't really include it
// in the execution of the build script, but... this may be a latent

View File

@ -5578,6 +5578,9 @@ fn build_script_rerun_when_target_rustflags_change() {
[RUNNING] [..]
",
)
.with_stdout("")
.with_stdout(
"\
hello",
)
.run();
}