From 0d81c2b94c5074c96a4bd2f50d5f2642ce98621f Mon Sep 17 00:00:00 2001 From: Ryan Butler Date: Wed, 14 Sep 2022 13:35:45 -0400 Subject: [PATCH 1/2] Clarify when cargo detects changes --- src/doc/src/reference/build-scripts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/src/reference/build-scripts.md b/src/doc/src/reference/build-scripts.md index f4df9cb7f82..bcd2a44c72e 100644 --- a/src/doc/src/reference/build-scripts.md +++ b/src/doc/src/reference/build-scripts.md @@ -323,7 +323,7 @@ cross-compiling, so keep that in consideration of the impact on compile time. When rebuilding a package, Cargo does not necessarily know if the build script needs to be run again. By default, it takes a conservative approach of always -re-running the build script if any file within the package is changed (or the +re-running the build script if any rust 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 From 53a106450d090503b6a7541d15b59bffcb399fbe Mon Sep 17 00:00:00 2001 From: Ryan Butler Date: Wed, 14 Sep 2022 13:41:46 -0400 Subject: [PATCH 2/2] Update build-scripts.md --- src/doc/src/reference/build-scripts.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/src/reference/build-scripts.md b/src/doc/src/reference/build-scripts.md index bcd2a44c72e..c7aeb410fdf 100644 --- a/src/doc/src/reference/build-scripts.md +++ b/src/doc/src/reference/build-scripts.md @@ -323,9 +323,9 @@ cross-compiling, so keep that in consideration of the impact on compile time. When rebuilding a package, Cargo does not necessarily know if the build script needs to be run again. By default, it takes a conservative approach of always -re-running the build script if any rust 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 +re-running the build script if *any* file within the package directory 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. If Cargo is re-running the build scripts of your own crate or a