gh-156109: Allow static, non-framework iOS builds - #156110
Open
clementperon wants to merge 2 commits into
Open
Conversation
clementperon
requested review from
AA-Turner,
corona10,
emmatyping,
erlend-aasland and
itamaro
as code owners
August 20, 2026 13:33
An iOS app can only load a signed framework, so a shared Python has to be built as one. A static libpython is linked into the app binary and loads nothing at runtime, so the requirement does not apply to it, but configure refused that configuration outright. Refuse it only where it cannot work: a shared build with no framework. The LINKFORSHARED and MODULE_DEPS_SHARED framework references are gated on enable_framework, as the Darwin arm above already does, since a build without a framework has nothing to link against. Passing no framework option at all still errors, so a non-framework build stays an explicit opt-in.
clementperon
force-pushed
the
ios-static-nonframework
branch
from
August 20, 2026 13:37
82788a4 to
e710088
Compare
This was referenced Aug 20, 2026
clementperon
added a commit
to clementperon/xbmc
that referenced
this pull request
Aug 20, 2026
CPython appends -mios-version-min - the device flag - to every iOS build. Against the simulator SDK the linker rejects the dylibs it resolves there, and the first configure check that links one fails, taking the depends build with it. The local patch faked ac_sys_system=iOS by deleting CPython's host parsing, because config.site.in pinned every package to the tree's darwin triplet. Python now configures against its own iOS triplet, so CPython derives ac_sys_system, the deployment target and the device/simulator split itself, and the 76 lines that deleted that logic are gone. What is left matches three patches under review upstream, so all three can be dropped when python is next bumped: python/cpython#156110 python/cpython#156116 python/cpython#156113 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
clementperon
added a commit
to clementperon/xbmc
that referenced
this pull request
Aug 20, 2026
CPython appends -mios-version-min - the device flag - to every iOS build. Against the simulator SDK the linker rejects the dylibs it resolves there, and the first configure check that links one fails, taking the depends build with it. The local patch faked ac_sys_system=iOS by deleting CPython's host parsing, because config.site.in pinned every package to the tree's darwin triplet. Python now configures against its own iOS triplet, so CPython derives ac_sys_system, the deployment target and the device/simulator split itself, and the 76 lines that deleted that logic are gone. What is left matches three patches under review upstream, so all three can be dropped when python is next bumped: python/cpython#156110 python/cpython#156116 python/cpython#156113 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
clementperon
added a commit
to clementperon/xbmc
that referenced
this pull request
Aug 20, 2026
CPython appends -mios-version-min - the device flag - to every iOS build. Against the simulator SDK the linker rejects the dylibs it resolves there, and the first configure check that links one fails, taking the depends build with it. The local patch faked ac_sys_system=iOS by deleting CPython's host parsing, because config.site.in pinned every package to the tree's darwin triplet. Python now configures against its own iOS triplet, so CPython derives ac_sys_system, the deployment target and the device/simulator split itself, and the 76 lines that deleted that logic are gone. What is left matches three patches under review upstream, so all three can be dropped when python is next bumped: python/cpython#156110 python/cpython#156116 python/cpython#156113 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
configurerefuses any non-framework iOS build. That is correct for a shared Python — an iOS app can only load a signed framework, never a bare dylib — but a--disable-sharedbuild produces alibpython3.x.athat is linked into the app binary and loads nothing at runtime, so the requirement does not apply to it.This narrows the refusal to the combination that genuinely cannot work, and stops two Makefile variables referencing a framework that a non-framework build never produces.
--disable-frameworkpath no longer errors on iOS; it falls through to the existing non-framework setup.PY_ENABLE_SHAREDis known, rejects a shared build with no framework.LINKFORSHAREDandMODULE_DEPS_SHAREDgate their$(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)appends onenable_framework, as the Darwin arm directly above the first one already does.--disable-framework.Verified on macOS/arm64 against
main:--host=arm64-apple-ios12.0)--disable-framework --disable-sharedmake libpython3.16.asucceeds — arm64,LC_BUILD_VERSION platform 2,minos 12.0--disable-framework --enable-shared--enable-frameworkMakefileandpyconfig.hbyte-identical to unpatchedmainconfigurewas regenerated withTools/build/regen-configure.sh;autoreconf -ivf -Werroris clean and the generated diff contains no unrelated churn.