Skip to content

Commit 98e1476

Browse files
committed
Document the profile settings used to build artifact dependencies
1 parent a42fead commit 98e1476

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

text/0000-cargo-binary-dependencies.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ Cargo will unify features and versions across all kinds of dependencies, includi
113113

114114
Cargo does not take the specified `artifact` values into account when resolving a crate's version; it will resolve the version as normal, and then produce an error if that version does not support all the specified `artifact` values. Similarly, Cargo will produce an error if that version does not build all the binary artifacts required by `"bin:name"` values. Removing a crate type or an artifact is a semver-incompatible change. (Any further semver requirements on the interface provided by a binary or library depend on the nature of the binary or library in question.)
115115

116+
As with other kinds of dependencies, you can specify profile settings used to build artifact dependencies using [overrides](https://doc.rust-lang.org/cargo/reference/profiles.html#overrides). If not overridden, artifact dependencies in `build-dependencies` compiled for the host will build using the [`build-override` settings](https://doc.rust-lang.org/cargo/reference/profiles.html#build-dependencies), and all other artifact dependencies will inherit the same profile settings being used to build the crate depending on them.
117+
116118
Until this feature is stabilized, it will require specifying the nightly-only option `-Z bindeps` to `cargo`. If `cargo` encounters an artifact dependency and does not have this option specified, it will emit an error and immediately stop building.
117119

118120
The placement of artifact directories is an implementation detail of Cargo, and subject to change. The proposed implementation will place the artifact directory for each crate in `target/<TARGET>/artifact/<CRATE_NAME>-<METADATA_HASH>/<ARTIFACT_TYPE>`, where `<TARGET>` is the target triple the artifact dependency is built for (which may be the target triple of the host), `<CRATE_NAME>` is the name of the crate, `<METADATA_HASH>` is the usual hash that Cargo appends to crate-related file and directory names to ensure that changing properties (such as features) that affect the build of the crate will build into different paths, and `<ARTIFACT_TYPE>` is the artifact type (`bin`, `cdylib`, or `staticlib`).

0 commit comments

Comments
 (0)