Skip to content

Commit

Permalink
Auto merge of #12482 - rukai:rerun-if-changed-docs, r=weihanglo
Browse files Browse the repository at this point in the history
docs: make the env var source of rerun-if-env-changed clearer

closes #12403

### What does this PR try to resolve?

The wording of the documentation on [rerun-if-env-changed](https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorerun-if-env-changedname) was misleading which led me to be confused by the behavior of cargo and then raise #12403
These changes should avoid users being confused by this in the future.
  • Loading branch information
bors committed Aug 12, 2023
2 parents 3a73377 + 24ad2bc commit 65cee64
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/doc/src/reference/build-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,10 @@ The `rerun-if-env-changed` instruction tells Cargo to re-run the build script
if the value of an environment variable of the given name has changed.

Note that the environment variables here are intended for global environment
variables like `CC` and such, it is not necessary to use this for environment
variables like `TARGET` that Cargo sets.
variables like `CC` and such, it is not possible to use this for environment
variables like `TARGET` that [Cargo sets for build scripts][build-env]. The
environment variables in use are those received by `cargo` invocations, not
those received by the executable of the build script.


### The `links` Manifest Key
Expand Down

0 comments on commit 65cee64

Please sign in to comment.