Skip to content
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
5 changes: 5 additions & 0 deletions src/cargo/core/compiler/custom_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@ fn build_work(build_runner: &mut BuildRunner<'_, '_>, unit: &Unit) -> CargoResul
// sorts of variables need to be discovered at that time.
let lib_deps = dependencies
.iter()
// We allow std dependencies to propagate metadata between other std dependencies but
// not to non-std crates. Non-std crates can propagate metadata to other non-std crates.
// We enforce a boundary between std and non-std crates. This may be lifted in the
// future but for now we are being conservative.
.filter(|dep| dep.unit.is_std == unit.is_std)
.filter_map(|dep| {
if dep.unit.mode.is_run_custom_build() {
let dep_metadata = build_runner.get_run_build_script_metadata(&dep.unit);
Expand Down