From 7320db98d1e31e5f3c0770052cf651c308e7e24e Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Tue, 5 Jul 2022 17:27:51 +0200 Subject: [PATCH] Add rerun-if-changed to fiber/build.rs (#4377) Not having rerun-if-changed leads to including nanosecond-precision mtimes in fingerprints and unnecessary rebuilds in docker [1]. [1] https://github.com/rust-lang/cargo/blob/0.63.1/src/cargo/core/compiler/fingerprint.rs#L1491 --- crates/fiber/build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/fiber/build.rs b/crates/fiber/build.rs index 9e7b8b5a39..6bfc5c4b9d 100644 --- a/crates/fiber/build.rs +++ b/crates/fiber/build.rs @@ -5,13 +5,16 @@ fn main() { let arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap(); let os = env::var("CARGO_CFG_TARGET_OS").unwrap(); if os == "windows" { + println!("cargo:rerun-if-changed=src/windows.c"); build.file("src/windows.c"); } else if arch == "s390x" { + println!("cargo:rerun-if-changed=src/unix/s390x.S"); build.file("src/unix/s390x.S"); } else { // assume that this is included via inline assembly in the crate itself, // and the crate will otherwise have a `compile_error!` for unsupported // platforms. + println!("cargo:rerun-if-changed=build.rs"); return; } build.define(&format!("CFG_TARGET_OS_{}", os), None);