Skip to content

Commit 1530ed8

Browse files
authored
Rollup merge of #99864 - klensy:bootstrap-art-dupe, r=jyn514
bootstrap: don't emit warn about duplicated deps with same/different features if some of sets actually empty Example (https://github.com/rust-lang-ci/rust/runs/7551453940?check_suite_focus=true#step:25:15008): ``` duplicate artifacts found when compiling a tool, this typically means that something was recompiled because a transitive dependency has different features activated than in a previous build: the following dependencies are duplicated although they have the same features enabled: the following dependencies have different features: memchr 2.5.0 (registry+https://github.com/rust-lang/crates.io-index) `clippy-driver` additionally enabled features {} at "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-freebsd/release/deps/libmemchr-44aa6ff4f08e293f.rlib" `cargo` additionally enabled features {"use_std"} at "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-freebsd/release/deps/libmemchr-70e29af0fd3ef292.rlib" ``` Notice that no info printed under `the following dependencies are duplicated although they have the same features enabled:`
2 parents f9aa989 + 3395094 commit 1530ed8

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

src/bootstrap/tool.rs

+28-24
Original file line numberDiff line numberDiff line change
@@ -158,34 +158,38 @@ impl Step for ToolBuild {
158158
a transitive dependency has different features activated \
159159
than in a previous build:\n"
160160
);
161-
eprintln!(
162-
"the following dependencies are duplicated although they \
163-
have the same features enabled:"
164-
);
165161
let (same, different): (Vec<_>, Vec<_>) =
166162
duplicates.into_iter().partition(|(_, cur, prev)| cur.2 == prev.2);
167-
for (id, cur, prev) in same {
168-
eprintln!(" {}", id);
169-
// same features
170-
eprintln!(" `{}` ({:?})\n `{}` ({:?})", cur.0, cur.1, prev.0, prev.1);
171-
}
172-
eprintln!("the following dependencies have different features:");
173-
for (id, cur, prev) in different {
174-
eprintln!(" {}", id);
175-
let cur_features: HashSet<_> = cur.2.into_iter().collect();
176-
let prev_features: HashSet<_> = prev.2.into_iter().collect();
177-
eprintln!(
178-
" `{}` additionally enabled features {:?} at {:?}",
179-
cur.0,
180-
&cur_features - &prev_features,
181-
cur.1
182-
);
163+
if !same.is_empty() {
183164
eprintln!(
184-
" `{}` additionally enabled features {:?} at {:?}",
185-
prev.0,
186-
&prev_features - &cur_features,
187-
prev.1
165+
"the following dependencies are duplicated although they \
166+
have the same features enabled:"
188167
);
168+
for (id, cur, prev) in same {
169+
eprintln!(" {}", id);
170+
// same features
171+
eprintln!(" `{}` ({:?})\n `{}` ({:?})", cur.0, cur.1, prev.0, prev.1);
172+
}
173+
}
174+
if !different.is_empty() {
175+
eprintln!("the following dependencies have different features:");
176+
for (id, cur, prev) in different {
177+
eprintln!(" {}", id);
178+
let cur_features: HashSet<_> = cur.2.into_iter().collect();
179+
let prev_features: HashSet<_> = prev.2.into_iter().collect();
180+
eprintln!(
181+
" `{}` additionally enabled features {:?} at {:?}",
182+
cur.0,
183+
&cur_features - &prev_features,
184+
cur.1
185+
);
186+
eprintln!(
187+
" `{}` additionally enabled features {:?} at {:?}",
188+
prev.0,
189+
&prev_features - &cur_features,
190+
prev.1
191+
);
192+
}
189193
}
190194
eprintln!();
191195
eprintln!(

0 commit comments

Comments
 (0)