Skip to content

Commit 9b6b8e0

Browse files
committed
Allow musl
1 parent de3fc2a commit 9b6b8e0

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

crates/platform-tags/src/platform.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,18 @@ impl fmt::Display for Arch {
102102
}
103103

104104
impl Arch {
105-
/// Returns the oldest possible Manylinux tag for this architecture
106-
pub fn get_minimum_manylinux_minor(&self) -> u16 {
105+
/// Returns the oldest possible `manylinux` tag for this architecture, if it supports
106+
/// `manylinux`.
107+
pub fn get_minimum_manylinux_minor(&self) -> Option<u16> {
107108
match self {
108109
// manylinux 2014
109-
Self::Aarch64 | Self::Armv7L | Self::Powerpc64 | Self::Powerpc64Le | Self::S390X => 17,
110+
Self::Aarch64 | Self::Armv7L | Self::Powerpc64 | Self::Powerpc64Le | Self::S390X => {
111+
Some(17)
112+
}
110113
// manylinux 1
111-
Self::X86 | Self::X86_64 => 5,
112-
// not supported
113-
Self::Armv6L => 0,
114+
Self::X86 | Self::X86_64 => Some(5),
115+
// unsupported
116+
Self::Armv6L => None,
114117
}
115118
}
116119
}

crates/platform-tags/src/tags.rs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -336,25 +336,22 @@ fn compatible_tags(platform: &Platform) -> Result<Vec<String>, PlatformError> {
336336
let platform_tags = match (&os, arch) {
337337
(Os::Manylinux { major, minor }, _) => {
338338
let mut platform_tags = vec![format!("linux_{}", arch)];
339-
platform_tags.extend(
340-
(arch.get_minimum_manylinux_minor()..=*minor)
341-
.map(|minor| format!("manylinux_{major}_{minor}_{arch}")),
342-
);
343-
if (arch.get_minimum_manylinux_minor()..=*minor).contains(&12) {
344-
platform_tags.push(format!("manylinux2010_{arch}"));
345-
}
346-
if (arch.get_minimum_manylinux_minor()..=*minor).contains(&17) {
347-
platform_tags.push(format!("manylinux2014_{arch}"));
348-
}
349-
if (arch.get_minimum_manylinux_minor()..=*minor).contains(&5) {
350-
platform_tags.push(format!("manylinux1_{arch}"));
339+
if let Some(min_minor) = arch.get_minimum_manylinux_minor() {
340+
platform_tags.extend(
341+
(min_minor..=*minor).map(|minor| format!("manylinux_{major}_{minor}_{arch}")),
342+
);
343+
if (min_minor..=*minor).contains(&12) {
344+
platform_tags.push(format!("manylinux2010_{arch}"));
345+
}
346+
if (min_minor..=*minor).contains(&17) {
347+
platform_tags.push(format!("manylinux2014_{arch}"));
348+
}
349+
if (min_minor..=*minor).contains(&5) {
350+
platform_tags.push(format!("manylinux1_{arch}"));
351+
}
351352
}
352353
platform_tags
353354
}
354-
(Os::Musllinux { .. }, Arch::Armv6L) => {
355-
// armv6l is not supported by musllinux
356-
vec![format!("linux_{}", arch)]
357-
}
358355
(Os::Musllinux { major, minor }, _) => {
359356
let mut platform_tags = vec![format!("linux_{}", arch)];
360357
// musl 1.1 is the lowest supported version in musllinux

0 commit comments

Comments
 (0)