Rebuild if src changed

From the cargo docs (https://doc.rust-lang.org/cargo/reference/build-scripts.html#change-detection):

> By default, it takes a conservative approach of always re-running the build script if any file within the package is changed (or the list of files controlled by the exclude and include fields). For most cases, this is not a good choice, so it is recommended that every build script emit at least one of the rerun-if instructions (described below). If these are emitted, then Cargo will only re-run the script if the given value has changed

So, since we emit rerun-if-path-changed, we need to emit *all* the paths.
Failing to do this shows up most visibly as an outdated git version.

Fixes #11332
This commit is contained in:
Fabian Boehm
2025-03-28 18:24:42 +01:00
parent 11c7310f17
commit b2aaf1db52

View File

@@ -49,6 +49,7 @@ fn main() {
build_man(&targetman);
}
rsconf::rebuild_if_path_changed("src/libc.c");
rsconf::rebuild_if_path_changed("src/");
cc::Build::new()
.file("src/libc.c")
.include(build_dir)