Skip to content

Commit

Permalink
Remove maybe_filter_for_musl_platform from picker code
Browse files Browse the repository at this point in the history
Now that we check the libc name along with OS & arch, this code was redundant.
  • Loading branch information
autarch committed Nov 24, 2024
1 parent 731acbb commit 38c9daa
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions ubi/src/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ impl<'a> AssetPicker<'a> {
return Ok(asset);
}

let filtered = self.maybe_filter_for_musl_platform(filtered);

debug!(
"cannot disambiguate multiple asset names, picking the first one after sorting by name"
);
Expand Down Expand Up @@ -312,33 +310,6 @@ impl<'a> AssetPicker<'a> {
(matches, None)
}

fn maybe_filter_for_musl_platform(&mut self, matches: Vec<Asset>) -> Vec<Asset> {
if !self.is_musl {
return matches;
}

let asset_names = matches.iter().map(|a| a.name.as_str()).collect::<Vec<_>>();
debug!(
"found multiple candidate assets, filtering for musl binaries in {:?}",
asset_names,
);

if !matches.iter().any(|a| a.name.contains("musl")) {
debug!("no musl assets found, falling back to all assets");
return matches;
}

let musl = matches
.into_iter()
.filter(|a| a.name.contains("musl"))
.collect::<Vec<_>>();
debug!(
"found musl assets: {}",
musl.iter().map(|a| a.name.as_str()).join(",")
);
musl
}

fn os_matcher(&self) -> &'static Lazy<Regex> {
debug!("current OS = {}", self.platform.target_os);

Expand Down

0 comments on commit 38c9daa

Please sign in to comment.