Skip to content

Commit

Permalink
Document that cargo automatically registers variables used in env! ma…
Browse files Browse the repository at this point in the history
…cro to trigger rebuilds
  • Loading branch information
Imberflur committed Jan 15, 2025
1 parent 54df3c7 commit 706e4c8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/doc/src/reference/build-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,13 @@ 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.

As of 1.46, using [`env!`][env-macro] and [`option_env!`][option-env-macro] in
source code will automatically detect changes and trigger rebuilds.
`rerun-if-env-changed` is no longer needed for variables already referenced by
these macros.

[option-env-macro]: ../../std/macro.option_env.html

## The `links` Manifest Key

The `package.links` key may be set in the `Cargo.toml` manifest to declare
Expand Down

0 comments on commit 706e4c8

Please sign in to comment.