Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify how cargo::metadata env var is selected #14842

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/doc/src/reference/build-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,12 @@ key-value pairs. This metadata is set with the `cargo::metadata=KEY=VALUE`
instruction.

The metadata is passed to the build scripts of **dependent** packages. For
example, if the package `bar` depends on `foo`, then if `foo` generates
`key=value` as part of its build script metadata, then the build script of
`bar` will have the environment variables `DEP_FOO_KEY=value`. See the ["Using
another `sys` crate"][using-another-sys] for an example of how this can be
used.
example, if the package `foo` depends on `bar`, which links `baz`, then if
`bar` generates `key=value` as part of its build script metadata, then the
build script of `foo` will have the environment variables `DEP_BAZ_KEY=value`
(note that the value of the `links` key is used).
See the ["Using another `sys` crate"][using-another-sys] for an example of
how this can be used.

Note that metadata is only passed to immediate dependents, not transitive
dependents.
Expand Down