From 2630813d15b224164e2db847dd737b5fba021ecd Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 12 Feb 2024 15:31:03 -0800 Subject: [PATCH] docs: Minor clarification of build script metadata. --- src/doc/src/reference/build-scripts.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/doc/src/reference/build-scripts.md b/src/doc/src/reference/build-scripts.md index e49d3c78b2c..dc74fea95e3 100644 --- a/src/doc/src/reference/build-scripts.md +++ b/src/doc/src/reference/build-scripts.md @@ -376,14 +376,16 @@ In other words, it is forbidden to have two packages link to the same native library. This helps prevent duplicate symbols between crates. Note, however, that there are [conventions in place](#-sys-packages) to alleviate this. -As mentioned above in the output format, each build script can generate an -arbitrary set of metadata in the form of key-value pairs. This 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. +Build scripts can generate an arbitrary set of metadata in the form of +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. Note that metadata is only passed to immediate dependents, not transitive dependents.