gh-156115: Use the simulator deployment-target flag for iOS simulator builds - #156116
gh-156115: Use the simulator deployment-target flag for iOS simulator builds#156116clementperon wants to merge 2 commits into
Conversation
-mios-version-min names the device platform, so against the simulator SDK the linker rejects every dylib it resolves there. Configuring for the simulator still exits 0, but conftest links fail and iconv, sqlite3 and zlib features are misdetected as absent; a build with a library on LDFLAGS before the first compiler check fails outright instead. The device/simulator split is already known from the host triple, so select the flag from it.
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>
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>
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>
freakboy3742
left a comment
There was a problem hiding this comment.
This is mechanically correct, but I think it can be significantly simplified.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
Thanks — both applied. The block is now a single Re-checked on macOS/arm64 with I have made the requested changes; please review again |
|
Thanks for making the requested changes! @freakboy3742: please review the changes made to this pull request. |
configureappends-mios-version-minto CFLAGS/LDFLAGS for every iOS build. That is the device flag (an alias for-miphoneos-version-min), so against the simulator SDK the linker rejects everything it resolves there:_host_deviceis already derived from the host triple atconfigure.ac:794, so this selects the flag from it:-mios-simulator-version-minfor the simulator,-mios-version-minunchanged for the device.The wrappers in
Platforms/Apple/iOS/Resources/binhide this, because they pass--target=arm64-apple-ios-simulatorand that pins the platform regardless of the later flag. Driving clang directly with-isysroot, as a cross-compiling build system typically does, hits it.It is a quiet failure rather than a loud one. On unpatched
main, a simulator configure still exits 0, butconfig.logholds 17 failed conftest links and features come out misdetected:With a library on
LDFLAGSbefore the first compiler check it fails outright withconfigure: error: C compiler cannot create executables.Verified on macOS/arm64: the simulator build emits
-mios-simulator-version-min=12.0and detects all four features; the device build still emits-mios-version-min=12.0and is otherwise unchanged.