feat: add CPython 3.15 support for iOS#2857
Conversation
4a08995 to
f2000da
Compare
agriyakhetarpal
left a comment
There was a problem hiding this comment.
Thanks @henryiii! LGTM on the other code, but some small corrections needed on the README.
|
@henryiii Thanks for picking this up. We've already spoken about the That script isn't part of the offical package either (and shouldn't be); my intention was to break that out into Alternatively, (and/or as a stop-gap measure) we could include the |
7d29259 to
d9fe4ab
Compare
Assisted-by: OpenCode:Kimi-K2.6 Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
d9fe4ab to
2f8be4d
Compare
Assisted-by: Copilot:claude-sonnet-4.6 Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
8fecae8 to
16fb156
Compare
freakboy3742
left a comment
There was a problem hiding this comment.
This all makes sense to me, and works great in my manual testing. A couple of notes inline. Not sure what's going on with the macOS test failures in CI, though.
I've taken an initial look at doing this with xbuild; it doesn't look too difficult, but there's a couple of fixes needed to xbuild to finalise that. I'm unlikely to get a chance to look at this until post-PyCon; what is in this PR seems like a very workable stop-gap.
When copying multiarch-specific support files (e.g. _cross_arm64_iphoneos.py), the code was trying to copy all items in the directory including __pycache__ directories. The shutil.copy() function only works with files, not directories, which caused an IsADirectoryError. This fix adds a check to only copy files, skipping any directories like __pycache__ that may have been created by Python imports. Assisted-by: Copilot:claude-haiku-4.5
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Assisted-by: Copilot:claude-sonnet-4.6 Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
7324931 to
0984901
Compare
Add assertion to check if target Python directory exists.
There was a problem hiding this comment.
Pull request overview
Adds CPython 3.15 iOS support by wiring official python.org iOS XCFramework downloads into cibuildwheel and vendoring support files needed to create iOS cross-compilation virtual environments.
Changes:
- Adds CPython 3.15 iOS configurations and updates expected wheel/readme support metadata.
- Adds cibuildwheel-managed iOS cross-venv support scripts and resource path constants.
- Updates iOS setup logic to inject missing platform config files for python.org 3.15+ XCFrameworks.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
test/utils.py |
Extends expected iOS wheels to include CPython 3.15 when prerelease builds are enabled. |
README.md |
Marks CPython 3.15 as supported for iOS. |
pyproject.toml |
Adjusts wheel-content checks for new iOS support resources. |
cibuildwheel/util/resources.py |
Adds a resource path for vendored iOS support files. |
cibuildwheel/resources/ios-support/x86_64-iphonesimulator/sitecustomize.py |
Adds x86_64 simulator startup customization. |
cibuildwheel/resources/ios-support/x86_64-iphonesimulator/_cross_x86_64_iphonesimulator.py |
Adds x86_64 simulator platform/sysconfig patching. |
cibuildwheel/resources/ios-support/make_cross_venv.py |
Adds cross-venv conversion helper for iOS support files. |
cibuildwheel/resources/ios-support/arm64-iphonesimulator/sitecustomize.py |
Adds arm64 simulator startup customization. |
cibuildwheel/resources/ios-support/arm64-iphonesimulator/_cross_arm64_iphonesimulator.py |
Adds arm64 simulator platform/sysconfig patching. |
cibuildwheel/resources/ios-support/arm64-iphoneos/sitecustomize.py |
Adds arm64 device startup customization. |
cibuildwheel/resources/ios-support/arm64-iphoneos/_cross_arm64_iphoneos.py |
Adds arm64 device platform/sysconfig patching. |
cibuildwheel/resources/ios-support/_cross_venv.py |
Adds build-environment import hook to preserve cross-venv files. |
cibuildwheel/resources/build-platforms.toml |
Adds CPython 3.15 iOS target configurations. |
cibuildwheel/platforms/ios.py |
Injects platform config data for 3.15+ and uses vendored cross-venv resources. |
bin/update_pythons.py |
Updates iOS version refresh logic for python.org 3.15+ releases. |
.pre-commit-config.yaml |
Excludes vendored iOS support files from pre-commit checks except the helper script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This looks okay to me! I guess we expect these support files to be included in the next CPython XCframework release? So we'll only be vendoring this stuff for a little while? |
I don't expect they'll ever be in the XCframework - but they will (and are already) in However, once it is ready for consideration, we'll be able to remove the vendoring in cibuildwheel. |
freakboy3742
left a comment
There was a problem hiding this comment.
This doesn't seem quite right yet - the _inject_support_files call shouldn't be needed at all.
I think the problem is that the platform_config_path that is being passed in for the 3.15 case doesn't actually exist - and the path to the stdlib (which is where sysconfigdata comes from) isn't being provided.
Remove the _inject_support_files workaround for python.org 3.15+ distributions. Instead of copying sysconfig files from the stdlib into a synthetic platform-config/ directory, pass the stdlib directory directly to make_cross_venv.py. make_cross_venv.py is updated to derive the multiarch tag from the _sysconfigdata_ filename rather than assuming it comes from the directory name. Co-authored-by: Russell Keith-Magee <russell@keith-magee.com> Assisted-by: OpenCode:Kimi-K2.6 Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
|
@freakboy3742 have you had a chance to look at the latest changes? (also waiting on PyPy) |
My apologies - I wasn't as productive on my flight home as I was hoping. I'm taking a look now. |
freakboy3742
left a comment
There was a problem hiding this comment.
I've pushed a couple of minor tweaks - mostly clarifying the naming of the paths being referenced in the make_cross_venv script. It doesn't change the actual work being done, but the variable/argument names correspond a little closer to the actual purpose of the script. It also tweaks the message printed describing the conversion taking place - previously, it was printing the location of the sysconfig data, not the target platform type.
Otherwise, this looks good to me. I'll be able to revisit this once I've got xbuild to a more stable state. That will remove the need to vendor these scripts; but in the meantime, this should work. Thanks @henryiii for pushing this forward.
Missing support files; either should be vendored or added to xbuild.
Assisted-by: OpenCode:Kimi-K2.6
Assisted-by: Copilot:claude-sonnet-4.6