Skip to content

Doc: add a note about Rustc's minimum MACOSX_DEPLOYMENT_TARGET requirement #2326

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

Merged
merged 3 commits into from
Mar 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,16 @@ CIBW_BEFORE_ALL_WINDOWS: rustup target add i686-pc-windows-msvc
CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH"
```

Rust does not provide Cargo for musllinux 32-bit, so that needs to be skipped:
Rust's minimum macOS target is 10.12, while CPython supports 10.9 before
Python 3.12, so you'll need to raise the minimum:

```toml
[tool.cibuildwheel.macos.environment]
MACOSX_DEPLOYMENT_TARGET = "10.12"
```

And Rust does not provide Cargo for musllinux 32-bit, so that needs to be
skipped:

```toml
[tool.cibuildwheel]
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ macOS builds will honor the `MACOSX_DEPLOYMENT_TARGET` environment variable to c

If you set the value lower, cibuildwheel will cap it to the lowest supported value for each target as needed.

!!! note
For Rust-based extensions, `Rustc` requires `MACOSX_DEPLOYMENT_TARGET` to be at
least 10.12. However, `cibuildwheel` defaults to 10.9 for
**Intel / CPython 3.8-3.11** builds. Users must manually set
`MACOSX_DEPLOYMENT_TARGET` to 10.12 or higher when building Rust extensions.

## Universal builds

By default, macOS builds will build a single architecture wheel, using the build machine's architecture. If you need to support both x86_64 and Apple Silicon, you can use the `CIBW_ARCHS` environment variable to specify the architectures you want to build, or the value `universal2` to build a multi-architecture wheel. cibuildwheel will test x86_64 wheels (or the x86_64 slice of a `universal2` wheel) when running on Apple Silicon hardware, but it is *not* possible to test Apple Silicon wheels on x86_64 hardware.