If a dependency contains the following build script:
fn main() { println!("cargo:rerun-if-changed=build.rs"); }
Then running cargo build
twice in a row compile the dependency twice, instead of just once:
$ cargo build
Compiling a v0.1.0 (file:///home/mbrubeck/src/test/cargotest)
Compiling cargotest v0.1.0 (file:///home/mbrubeck/src/test/cargotest)
$ cargo build
Compiling a v0.1.0 (file:///home/mbrubeck/src/test/cargotest)
Compiling cargotest v0.1.0 (file:///home/mbrubeck/src/test/cargotest)
$ cargo build
$
Possibly related: the following message appears in the log output during the second build, but not the first or third build:
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for a v0.1.0 (file:///home/mbrubeck/src/test/cargotest): local fingerprint type has changed
As reported by @cdlm on IRC, this affects the current version of the glutin
crate. And here is a minimal test case for this issue: https://github.com/mbrubeck/cargotest