Skip to content

Conversation

@freakboy3742
Copy link
Contributor

Modifies the handling of iOS as platform, so that:

  1. When iOS is the target platform, linking with libPython is enabled. This is required by all iOS binary modules.
  2. iOS isn't considered a "cross compiling" platform. This is needed because although iOS is actually being cross compiled, it will be built in a cross-venv environment that is able to use sysconfig to report details about the interpreter.

messense pushed a commit to PyO3/maturin that referenced this pull request Nov 10, 2025
At present, when targeting an `abi3` build, Maturin will use a dummy
interpreter to provide build configuration details, unless the user
specifies an interpreter with `--interpreter`, or the target is
cross-compiling, or Windows is being targeted.

The use of a dummy interpreter when a real interpreter is available can
lead to the interpreter details that are available and defined in
`sysconfigdata` not being used as part of the build process.

This was discovered in the process of working on iOS support (see #2827
and #2828); although the iOS build environment *does* provide build
configuration details, those details were not being passed down to the
PyO3 build configuration. With those two patches (and some patches to
PyO3 - see PyO3/pyo3#5605 and PyO3/pyo3#5606), it was possible to build
a non-abi3 wheel; but this patch was needed to build an abi3 wheel.
Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks!

@davidhewitt davidhewitt added this pull request to the merge queue Nov 11, 2025
Merged via the queue into PyO3:main with commit 6aee027 Nov 11, 2025
43 checks passed
@freakboy3742 freakboy3742 deleted the ios-build branch November 11, 2025 22:25
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.

2 participants