Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional ARM targets to release #2417

Merged
merged 9 commits into from
Mar 15, 2024
Merged

Add additional ARM targets to release #2417

merged 9 commits into from
Mar 15, 2024

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Mar 13, 2024

Closes #2415.
Closes #2416.

@charliermarsh
Copy link
Member Author

This will take some trial and error.

@charliermarsh charliermarsh force-pushed the charlie/arm branch 7 times, most recently from 961ca84 to b75959c Compare March 13, 2024 16:03
@charliermarsh charliermarsh added the releases Related to building and distributing release artifacts of uv label Mar 13, 2024
@charliermarsh charliermarsh force-pushed the charlie/arm branch 21 times, most recently from 0924efa to 791d697 Compare March 14, 2024 04:53
@charliermarsh charliermarsh force-pushed the charlie/arm branch 7 times, most recently from 1d92264 to 33a58b3 Compare March 14, 2024 17:54
@charliermarsh charliermarsh marked this pull request as ready for review March 14, 2024 18:15
@@ -534,8 +540,6 @@ jobs:
- target: aarch64-unknown-linux-musl
arch: aarch64
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
- target: armv7-unknown-linux-musleabihf
arch: armv7
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we build this here, or in the linux-arm category that I augmented above?

@@ -107,6 +109,8 @@ impl Arch {
Self::Aarch64 | Self::Armv7L | Self::Powerpc64 | Self::Powerpc64Le | Self::S390X => 17,
// manylinux 1
Self::X86 | Self::X86_64 => 5,
// not supported
Self::Armv6L => 0,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@konstin - This is a bit awkward

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about

diff --git a/crates/platform-tags/src/platform.rs b/crates/platform-tags/src/platform.rs
index c28e9b76..d36c91e9 100644
--- a/crates/platform-tags/src/platform.rs
+++ b/crates/platform-tags/src/platform.rs
@@ -103,14 +103,16 @@ impl fmt::Display for Arch {
 
 impl Arch {
     /// Returns the oldest possible Manylinux tag for this architecture
-    pub fn get_minimum_manylinux_minor(&self) -> u16 {
+    pub fn get_minimum_manylinux_minor(&self) -> Option<u16> {
         match self {
             // manylinux 2014
-            Self::Aarch64 | Self::Armv7L | Self::Powerpc64 | Self::Powerpc64Le | Self::S390X => 17,
+            Self::Aarch64 | Self::Armv7L | Self::Powerpc64 | Self::Powerpc64Le | Self::S390X => {
+                Some(17)
+            }
             // manylinux 1
-            Self::X86 | Self::X86_64 => 5,
+            Self::X86 | Self::X86_64 => Some(5),
             // not supported
-            Self::Armv6L => 0,
+            Self::Armv6L => None,
         }
     }
 }
diff --git a/crates/platform-tags/src/tags.rs b/crates/platform-tags/src/tags.rs
index b4db57da..3cd9a2db 100644
--- a/crates/platform-tags/src/tags.rs
+++ b/crates/platform-tags/src/tags.rs
@@ -336,18 +336,19 @@ fn compatible_tags(platform: &Platform) -> Result<Vec<String>, PlatformError> {
     let platform_tags = match (&os, arch) {
         (Os::Manylinux { major, minor }, _) => {
             let mut platform_tags = vec![format!("linux_{}", arch)];
-            platform_tags.extend(
-                (arch.get_minimum_manylinux_minor()..=*minor)
-                    .map(|minor| format!("manylinux_{major}_{minor}_{arch}")),
-            );
-            if (arch.get_minimum_manylinux_minor()..=*minor).contains(&12) {
-                platform_tags.push(format!("manylinux2010_{arch}"));
-            }
-            if (arch.get_minimum_manylinux_minor()..=*minor).contains(&17) {
-                platform_tags.push(format!("manylinux2014_{arch}"));
-            }
-            if (arch.get_minimum_manylinux_minor()..=*minor).contains(&5) {
-                platform_tags.push(format!("manylinux1_{arch}"));
+            if let Some(min_minor) = arch.get_minimum_manylinux_minor() {
+                platform_tags.extend(
+                    (min_minor..=*minor).map(|minor| format!("manylinux_{major}_{minor}_{arch}")),
+                );
+                if (min_minor..=*minor).contains(&12) {
+                    platform_tags.push(format!("manylinux2010_{arch}"));
+                }
+                if (min_minor..=*minor).contains(&17) {
+                    platform_tags.push(format!("manylinux2014_{arch}"));
+                }
+                if (min_minor..=*minor).contains(&5) {
+                    platform_tags.push(format!("manylinux1_{arch}"));
+                }
             }
             platform_tags
         }

@messense
Copy link
Contributor

Woah, was that just a coincidence?

I saw this PR and thought that it can be supported directly in maturin-action.

@charliermarsh
Copy link
Member Author

@messense - Thank you very much.

@@ -107,6 +109,8 @@ impl Arch {
Self::Aarch64 | Self::Armv7L | Self::Powerpc64 | Self::Powerpc64Le | Self::S390X => 17,
// manylinux 1
Self::X86 | Self::X86_64 => 5,
// not supported
Self::Armv6L => 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about

diff --git a/crates/platform-tags/src/platform.rs b/crates/platform-tags/src/platform.rs
index c28e9b76..d36c91e9 100644
--- a/crates/platform-tags/src/platform.rs
+++ b/crates/platform-tags/src/platform.rs
@@ -103,14 +103,16 @@ impl fmt::Display for Arch {
 
 impl Arch {
     /// Returns the oldest possible Manylinux tag for this architecture
-    pub fn get_minimum_manylinux_minor(&self) -> u16 {
+    pub fn get_minimum_manylinux_minor(&self) -> Option<u16> {
         match self {
             // manylinux 2014
-            Self::Aarch64 | Self::Armv7L | Self::Powerpc64 | Self::Powerpc64Le | Self::S390X => 17,
+            Self::Aarch64 | Self::Armv7L | Self::Powerpc64 | Self::Powerpc64Le | Self::S390X => {
+                Some(17)
+            }
             // manylinux 1
-            Self::X86 | Self::X86_64 => 5,
+            Self::X86 | Self::X86_64 => Some(5),
             // not supported
-            Self::Armv6L => 0,
+            Self::Armv6L => None,
         }
     }
 }
diff --git a/crates/platform-tags/src/tags.rs b/crates/platform-tags/src/tags.rs
index b4db57da..3cd9a2db 100644
--- a/crates/platform-tags/src/tags.rs
+++ b/crates/platform-tags/src/tags.rs
@@ -336,18 +336,19 @@ fn compatible_tags(platform: &Platform) -> Result<Vec<String>, PlatformError> {
     let platform_tags = match (&os, arch) {
         (Os::Manylinux { major, minor }, _) => {
             let mut platform_tags = vec![format!("linux_{}", arch)];
-            platform_tags.extend(
-                (arch.get_minimum_manylinux_minor()..=*minor)
-                    .map(|minor| format!("manylinux_{major}_{minor}_{arch}")),
-            );
-            if (arch.get_minimum_manylinux_minor()..=*minor).contains(&12) {
-                platform_tags.push(format!("manylinux2010_{arch}"));
-            }
-            if (arch.get_minimum_manylinux_minor()..=*minor).contains(&17) {
-                platform_tags.push(format!("manylinux2014_{arch}"));
-            }
-            if (arch.get_minimum_manylinux_minor()..=*minor).contains(&5) {
-                platform_tags.push(format!("manylinux1_{arch}"));
+            if let Some(min_minor) = arch.get_minimum_manylinux_minor() {
+                platform_tags.extend(
+                    (min_minor..=*minor).map(|minor| format!("manylinux_{major}_{minor}_{arch}")),
+                );
+                if (min_minor..=*minor).contains(&12) {
+                    platform_tags.push(format!("manylinux2010_{arch}"));
+                }
+                if (min_minor..=*minor).contains(&17) {
+                    platform_tags.push(format!("manylinux2014_{arch}"));
+                }
+                if (min_minor..=*minor).contains(&5) {
+                    platform_tags.push(format!("manylinux1_{arch}"));
+                }
             }
             platform_tags
         }

@charliermarsh charliermarsh enabled auto-merge (squash) March 15, 2024 13:41
@charliermarsh charliermarsh merged commit c296da3 into main Mar 15, 2024
47 checks passed
@charliermarsh charliermarsh deleted the charlie/arm branch March 15, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
releases Related to building and distributing release artifacts of uv
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add armv7 binary to release pipeline Add armhf binary to release pipeline
3 participants