Skip to content

Commit 9d23d30

Browse files
committed
Auto merge of #13436 - ehuss:clarify-build-script-metadata, r=epage
docs: Minor clarification of build script metadata. This adds a minor clarification to the build script docs around links metadata. "As mentioned above in the output format" didn't really clue me in to what section it was talking about, or clearly tell me how to set the metadata.
2 parents 10a7f20 + 2630813 commit 9d23d30

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

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

+10-8
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,16 @@ In other words, it is forbidden to have two packages link to the same native
376376
library. This helps prevent duplicate symbols between crates. Note, however,
377377
that there are [conventions in place](#-sys-packages) to alleviate this.
378378

379-
As mentioned above in the output format, each build script can generate an
380-
arbitrary set of metadata in the form of key-value pairs. This metadata is
381-
passed to the build scripts of **dependent** packages. For example, if the
382-
package `bar` depends on `foo`, then if `foo` generates `key=value` as part of
383-
its build script metadata, then the build script of `bar` will have the
384-
environment variables `DEP_FOO_KEY=value`. See the ["Using another `sys`
385-
crate"][using-another-sys] for an example of
386-
how this can be used.
379+
Build scripts can generate an arbitrary set of metadata in the form of
380+
key-value pairs. This metadata is set with the `cargo::metadata=KEY=VALUE`
381+
instruction.
382+
383+
The metadata is passed to the build scripts of **dependent** packages. For
384+
example, if the package `bar` depends on `foo`, then if `foo` generates
385+
`key=value` as part of its build script metadata, then the build script of
386+
`bar` will have the environment variables `DEP_FOO_KEY=value`. See the ["Using
387+
another `sys` crate"][using-another-sys] for an example of how this can be
388+
used.
387389

388390
Note that metadata is only passed to immediate dependents, not transitive
389391
dependents.

0 commit comments

Comments
 (0)