Skip to content

Commit

Permalink
dist: Identify requested additional component wildcards
Browse files Browse the repository at this point in the history
Sometimes someone might choose an additional component to add
during an install/update which is wildcarded.  We need to ensure
that we detect this and request the install with the wildcard
otherwise we can hit situations such as that identified in rust-lang#2601

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
  • Loading branch information
kinnison committed Dec 9, 2020
1 parent 0197ff4 commit 5dcfc35
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/dist/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,12 +730,27 @@ fn try_update_from_dist_<'a>(

let mut all_components: HashSet<Component> = profile_components.into_iter().collect();

let rust_package = m.get_package("rust")?;
let rust_target_package = rust_package.get_target(Some(&toolchain.target.clone()))?;

for component in components.iter().copied() {
let mut component =
Component::new(component.to_string(), Some(toolchain.target.clone()), false);
if let Some(renamed) = m.rename_component(&component) {
component = renamed;
}
// Look up the newly constructed/renamed component and ensure that
// if it's a wildcard component we note such, otherwise we end up
// exacerbating the problem we thought we'd fixed with #2087 and #2115
if let Some(c) = rust_target_package
.components
.iter()
.find(|c| c.short_name_in_manifest() == component.short_name_in_manifest())
{
if c.target.is_none() {
component = component.wildcard();
}
}
all_components.insert(component);
}

Expand Down

0 comments on commit 5dcfc35

Please sign in to comment.