Skip to content

Commit ad2c1af

Browse files
authored
Merge pull request #2201 from messense/aarch64-apple-darwin
Add aarch64-apple-darwin test to CI
2 parents c339550 + afe5221 commit ad2c1af

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,13 @@ jobs:
244244
manylinux: auto
245245
args: --release -i python3.9 --no-sdist -m examples/maturin-starter/Cargo.toml
246246

247+
- name: Test cross compilation
248+
if: ${{ matrix.platform.os == 'macos-latest' && matrix.python-version == '3.9' }}
249+
uses: messense/maturin-action@v1
250+
with:
251+
target: aarch64-apple-darwin
252+
args: --release -i python3.9 --no-sdist -m examples/maturin-starter/Cargo.toml
253+
247254
env:
248255
CARGO_TERM_VERBOSE: true
249256
CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
### Fixed
1616

1717
- Fix incorrect platform detection for Windows in `pyo3-build-config`. [#2198](https://github.com/PyO3/pyo3/pull/2198)
18+
- Fix cross compiling to aarch64 macOS. [#2201](https://github.com/PyO3/pyo3/pull/2201)
1819

1920
## [0.16.0] - 2022-02-27
2021

pyo3-build-config/src/impl_.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,16 @@ pub fn cross_compiling(
623623
let cross_lib_dir = env_var("PYO3_CROSS_LIB_DIR");
624624
let cross_python_version = env_var("PYO3_CROSS_PYTHON_VERSION");
625625

626-
let target_triple = format!("{}-{}-{}", target_arch, target_vendor, target_os);
626+
let target_triple = format!(
627+
"{}-{}-{}",
628+
target_arch,
629+
target_vendor,
630+
if target_os == "macos" {
631+
"darwin"
632+
} else {
633+
target_os
634+
}
635+
);
627636

628637
if cross.is_none() && cross_lib_dir.is_none() && cross_python_version.is_none() {
629638
// No cross-compiling environment variables set; try to determine if this is a known case

0 commit comments

Comments
 (0)