Skip to content

Commit 65cee64

Browse files
committed
Auto merge of #12482 - rukai:rerun-if-changed-docs, r=weihanglo
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.
2 parents 3a73377 + 24ad2bc commit 65cee64

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,10 @@ The `rerun-if-env-changed` instruction tells Cargo to re-run the build script
346346
if the value of an environment variable of the given name has changed.
347347

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

352354

353355
### The `links` Manifest Key

0 commit comments

Comments
 (0)