Skip to content

Commit 5dcfc35

Browse files
committed
dist: Identify requested additional component wildcards
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 #2601 Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
1 parent 0197ff4 commit 5dcfc35

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/dist/dist.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,12 +730,27 @@ fn try_update_from_dist_<'a>(
730730

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

733+
let rust_package = m.get_package("rust")?;
734+
let rust_target_package = rust_package.get_target(Some(&toolchain.target.clone()))?;
735+
733736
for component in components.iter().copied() {
734737
let mut component =
735738
Component::new(component.to_string(), Some(toolchain.target.clone()), false);
736739
if let Some(renamed) = m.rename_component(&component) {
737740
component = renamed;
738741
}
742+
// Look up the newly constructed/renamed component and ensure that
743+
// if it's a wildcard component we note such, otherwise we end up
744+
// exacerbating the problem we thought we'd fixed with #2087 and #2115
745+
if let Some(c) = rust_target_package
746+
.components
747+
.iter()
748+
.find(|c| c.short_name_in_manifest() == component.short_name_in_manifest())
749+
{
750+
if c.target.is_none() {
751+
component = component.wildcard();
752+
}
753+
}
739754
all_components.insert(component);
740755
}
741756

0 commit comments

Comments
 (0)