Skip to content

Commit 751a4e1

Browse files
committed
Fix building arm64 wheel with cibuildwheel
1 parent 11d221e commit 751a4e1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
- Add support for `kebab-case` executable names. [#205](https://github.com/PyO3/setuptools-rust/pull/205)
66
- Add support for custom cargo profiles. [#216](https://github.com/PyO3/setuptools-rust/pull/216)
77

8+
### Fixed
9+
- Fix building macOS arm64 wheel with cibuildwheel. [#217](https://github.com/PyO3/setuptools-rust/pull/217)
10+
811
## 1.1.2 (2021-12-05)
912
### Changed
1013
- Removed dependency on `tomli` to simplify installation. [#200](https://github.com/PyO3/setuptools-rust/pull/200)

setuptools_rust/build.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ def run_for_extension(self, ext: RustExtension) -> None:
9292
universal2 = False
9393
if self.plat_name.startswith("macosx-") and arch_flags:
9494
universal2 = "x86_64" in arch_flags and "arm64" in arch_flags
95+
if not universal2 and not self.target:
96+
if "arm64" in arch_flags:
97+
self.target = "aarch64-apple-darwin"
98+
elif "x86_64" in arch_flags:
99+
self.target = "x86_64-apple-darwin"
100+
95101
if universal2:
96102
arm64_dylib_paths = self.build_extension(ext, "aarch64-apple-darwin")
97103
x86_64_dylib_paths = self.build_extension(ext, "x86_64-apple-darwin")

0 commit comments

Comments
 (0)