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

Support Aarch64 on OpenBSD #570

Merged
merged 3 commits into from Jun 17, 2021
Merged

Support Aarch64 on OpenBSD #570

merged 3 commits into from Jun 17, 2021

Conversation

ghost
Copy link

@ghost ghost commented Jun 17, 2021

Took almost a day to build maturin with this diff:-

$OpenBSD$

Index: src/target.rs
--- src/target.rs.orig
+++ src/target.rs
@@ -74,7 +74,7 @@ fn get_supported_architectures(os: &Os) -> Vec<Arch> {
         Os::Windows => vec![Arch::X86, Arch::X86_64, Arch::Aarch64],
         Os::Macos => vec![Arch::Aarch64, Arch::X86_64],
         Os::FreeBsd => vec![Arch::X86_64],
-        Os::OpenBsd => vec![Arch::X86_64],
+        Os::OpenBsd => vec![Arch::X86_64, Arch::Aarch64],
     }
 }
 
@@ -157,6 +157,14 @@ impl Target {
                 };
                 let release = info.release().replace(".", "_").replace("-", "_");
                 format!("openbsd_{}_amd64", release)
+            }
+            (Os::OpenBsd, Arch::Aarch64) => {
+                let info = match PlatformInfo::new() {
+                    Ok(info) => info,
+                    Err(error) => panic!("{}", error),
+                };
+                let release = info.release().replace(".", "_").replace("-", "_");
+                format!("openbsd_{}_arm64", release)
             }
             (Os::Linux, _) => {
                 let mut tags = vec![format!("{}_{}", manylinux, self.arch)];

Obviously some refractoring was done since so I'm posting with some adaptation. The configuration is same as in #568. Build and run tested with py-adblock (All tests pass). Most probably there won't be anymore archs to add since sparc64 is failing at compiling rust and I guess it is unsupported in maturin or is it?

    Finished release [optimized] target(s) in 208m 30sock                                                                
📦 Built wheel for abi3 Python ≥ 3.6 to /usr/ports/pobj/py-adblock-0.4.4-python3/python-adblock-0.4.4/target/wheels/adblock-0.4.4-cp36-abi3-openbsd_6_9_arm64.whl

@ghost
Copy link
Author

ghost commented Jun 17, 2021

The error seems unrelated.

@konstin
Copy link
Member

konstin commented Jun 17, 2021

Looks good, could you also please add the output of python -m sysconfig here?

@ghost
Copy link
Author

ghost commented Jun 17, 2021

Looks good, could you also please add the output of python -m sysconfig here?

Sure.

@konstin
Copy link
Member

konstin commented Jun 17, 2021

Thank you!

@konstin konstin merged commit 1815107 into PyO3:main Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant