Skip to content

Commit

Permalink
Auto merge of #10708 - svenstaro:patch-1, r=weihanglo
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed May 27, 2022
2 parents e23cf43 + 16e4c29 commit e0e1df9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/doc/src/reference/build-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@ 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.
changed. If Cargo is re-running the build scripts of your own crate or a
dependency and you don't know why, see ["Why is Cargo rebuilding my code?" in the
FAQ](../faq.md#why-is-cargo-rebuilding-my-code).

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

Expand Down

0 comments on commit e0e1df9

Please sign in to comment.