Repository navigation
[depends][python] fix the iOS simulator build - #29029
Conversation
|
| Filename | Overview |
|---|---|
| tools/depends/target/config.site.in | Makes the standard cross-compilation host values defaults so an explicit package-level host triplet survives. |
| tools/depends/target/python3/Makefile | Constructs valid CPython iOS triplets and applies the three focused iOS patches to iPhone targets. |
| tools/depends/target/python3/16-ios-static-nonframework.patch | Allows static non-framework iOS builds while retaining rejection of unsupported shared non-framework builds. |
| tools/depends/target/python3/17-ios-simulator-version-min.patch | Selects the deployment-target compiler and linker flag according to CPython’s parsed device type. |
| tools/depends/target/python3/18-ios-objc-fallback.patch | Falls back to dyld resolution by library name and preserves the module’s ImportError contract if loading fails. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Depends HOST and target platform] --> B[Generate CPython iOS host triplet]
B --> C[CPython derives iOS system, deployment target, and device type]
C --> D{Simulator?}
D -->|Yes| E[-mios-simulator-version-min]
D -->|No| F[-mios-version-min]
E --> G[Static non-framework Python build]
F --> G
Reviews (1): Last reviewed commit: "fix(depends): build python for the iOS s..." | Re-trigger Greptile
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8dece55012
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Change Milestone to v23 IMO to risky and fix ios simulator not needed for v22 |
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>
python/cpython#156110, #156116 and #156113 all merged upstream, with small changes made during review. Update the local patches to match exactly what landed, and note in the Makefile that all three can be dropped once we bump python past 3.16. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
53b1840 to
fb0615b
Compare
|
@kambala-decapitator Python upstream has been merged. |
|
@garbear I will merge it as it's a fix for the E2E CI that would be nice to have to support ios-simulator. |
Description
Python fails to build for the iOS Simulator. CPython's
configureappends-mios-version-min— the device deployment-target flag — to CFLAGS/LDFLAGS for every iOS build, so against the simulator SDK the linker rejects the dylibs it resolves there:-liconvis onLDFLAGS, so the very first compiler check fails and the depends build stops atconfigure: error: C compiler cannot create executables.16-ios-platform.patchis also replaced here. Two thirds of it existed only to fakeac_sys_system=iOS:config.site.inpinned every package to the tree's darwin triplet, so CPython could never recognise the target itself, and the patch deleted its host-parsing logic wholesale. Letting python configure against its own iOS triplet removes 76 lines of that, and CPython then derivesac_sys_system,IPHONEOS_DEPLOYMENT_TARGETand the device/simulator split by itself.What remains are three patches matching submissions under review upstream, named so they can be dropped once python is bumped past them:
16-ios-static-nonframework.patch17-ios-simulator-version-min.patch18-ios-objc-fallback.patchThe
config.site.inchange makes the tree's host triplet a default rather than an override, so a package that needs a different one can pass--hostand have it survive. Nothing else in the tree passes--host, so no other package changes behaviour.Motivation and context
The iOS Simulator leg of the E2E workflow has been red since #28808 landed, which introduced
16-ios-platform.patch. tvOS is unaffected — it builds asDarwin, so none of CPython's iOS-specific code runs.How has this been tested?
Locally against Python 3.14.6 (the version this tree builds), with the three patches applied to a clean tarball plus the existing
apple/static-compile/process-vm-readypatches — all apply with zero fuzz:which is the check that previously failed. The full depends build and the Simulator E2E run are exercised by CI here.
Types of change
Checklist