Skip to content

Commit e0e1df9

Browse files
committed
Auto merge of #10708 - svenstaro:patch-1, r=weihanglo
Document how to debug change detection events ### What does this PR try to resolve? I noticed that my build would sometimes seemingly randomly rebuild other crates. I figured this must be the build script detecting a change in some external files. In order to debug this, I figured I'd look at the Cargo sources whether something like this was already being logged. Thankfully, the logging for this was already in place but I didn't find it documented anyway so I thought it might be rather helpful in such scenarios. I believe it's a common enough scenario that inclusion into the official documentation on this topic should be considered. ### How should we test and review this PR? Build/view documentation. ### Additional information
2 parents e23cf43 + 16e4c29 commit e0e1df9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/doc/src/reference/build-scripts.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ list of files controlled by the [`exclude` and `include` fields]). For most
328328
cases, this is not a good choice, so it is recommended that every build script
329329
emit at least one of the `rerun-if` instructions (described below). If these
330330
are emitted, then Cargo will only re-run the script if the given value has
331-
changed.
331+
changed. If Cargo is re-running the build scripts of your own crate or a
332+
dependency and you don't know why, see ["Why is Cargo rebuilding my code?" in the
333+
FAQ](../faq.md#why-is-cargo-rebuilding-my-code).
332334

333335
[`exclude` and `include` fields]: manifest.md#the-exclude-and-include-fields
334336

0 commit comments

Comments
 (0)