gh-138171: Migrate iOS testbed location and add Apple build script#138176
gh-138171: Migrate iOS testbed location and add Apple build script#138176freakboy3742 merged 17 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
|
The buildbot initially failed because the buildbot configuration references the older |
Sorry, something went wrong.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
!buildbot iOS |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 68d671b 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F138176%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
|
@freakboy3742 I imagine the CODEOWNERS entries will need updating in this PR? |
Sorry, something went wrong.
hugovk
left a comment
There was a problem hiding this comment.
+1 to moving these under Apple.
Or should we go a step further and have a build, platform or $bikeshed dir for all of Apple, Android and PC, and whatever comes next (Linux?)
Sorry, something went wrong.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
|
After a discussion with @ambv, I think we don't need to backport this after all. The motivation to backport was so that we buildbots could use the new directory structure and build scripts. This is required because the buildbot can't currently differentiate PR builds based on the underlying Python version. However, if we fix that underlying problem, we don't need to backport, as we can retain "old style" builds for pre-3.15, and use new-style builds going forward. On that basis, I'll merge this to main, but not backport, and target adding iOS binaries for 3.15. |
Sorry, something went wrong.
|
!buildbot iOS |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit ebbbf32 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F138176%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
|
!buildbot iOS |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit e0f6b5a 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F138176%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
35c7e52
into
python:main
Sep 19, 2025
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot x86 Debian Non-Debug with X 3.x (no tier) has failed when building commit 35c7e52. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/#/builders/1245/builds/6433 Summary of the results of the build (if available): == Click to see traceback logsTraceback (most recent call last):
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/contextlib.py"�[0m, line �[35m85�[0m, in �[35minner�[0m
return func(*args, **kwds)
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/_test_multiprocessing.py"�[0m, line �[35m596�[0m, in �[35mtest_interrupt�[0m
exitcode = self._kill_process(multiprocessing.Process.interrupt)
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/contextlib.py"�[0m, line �[35m85�[0m, in �[35minner�[0m
return func(*args, **kwds)
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/_test_multiprocessing.py"�[0m, line �[35m577�[0m, in �[35m_kill_process�[0m
self.assertEqual(�[31mjoin�[0m�[1;31m()�[0m, None)
�[31m~~~~�[0m�[1;31m^^�[0m
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/_test_multiprocessing.py"�[0m, line �[35m250�[0m, in �[35m__call__�[0m
return �[31mself.func�[0m�[1;31m(*args, **kwds)�[0m
�[31m~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^�[0m
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/multiprocessing/process.py"�[0m, line �[35m156�[0m, in �[35mjoin�[0m
res = self._popen.wait(timeout)
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/multiprocessing/popen_fork.py"�[0m, line �[35m44�[0m, in �[35mwait�[0m
return �[31mself.poll�[0m�[1;31m(os.WNOHANG if timeout == 0.0 else 0)�[0m
�[31m~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/multiprocessing/popen_fork.py"�[0m, line �[35m28�[0m, in �[35mpoll�[0m
pid, sts = �[31mos.waitpid�[0m�[1;31m(self.pid, flag)�[0m
�[31m~~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^�[0m
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/_test_multiprocessing.py"�[0m, line �[35m573�[0m, in �[35mhandler�[0m
raise RuntimeError('join took too long: %s' % p)
�[1;35mRuntimeError�[0m: �[35mjoin took too long: <Process name='Process-1' pid=28784 parent=28782 started daemon>�[0m
Traceback (most recent call last):
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/contextlib.py"�[0m, line �[35m85�[0m, in �[35minner�[0m
return func(*args, **kwds)
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/_test_multiprocessing.py"�[0m, line �[35m596�[0m, in �[35mtest_interrupt�[0m
exitcode = self._kill_process(multiprocessing.Process.interrupt)
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/contextlib.py"�[0m, line �[35m85�[0m, in �[35minner�[0m
return func(*args, **kwds)
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/_test_multiprocessing.py"�[0m, line �[35m577�[0m, in �[35m_kill_process�[0m
self.assertEqual(�[31mjoin�[0m�[1;31m()�[0m, None)
�[31m~~~~�[0m�[1;31m^^�[0m
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/_test_multiprocessing.py"�[0m, line �[35m250�[0m, in �[35m__call__�[0m
return �[31mself.func�[0m�[1;31m(*args, **kwds)�[0m
�[31m~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^�[0m
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/multiprocessing/process.py"�[0m, line �[35m156�[0m, in �[35mjoin�[0m
res = self._popen.wait(timeout)
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/multiprocessing/popen_fork.py"�[0m, line �[35m44�[0m, in �[35mwait�[0m
return �[31mself.poll�[0m�[1;31m(os.WNOHANG if timeout == 0.0 else 0)�[0m
�[31m~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/multiprocessing/popen_fork.py"�[0m, line �[35m28�[0m, in �[35mpoll�[0m
pid, sts = �[31mos.waitpid�[0m�[1;31m(self.pid, flag)�[0m
�[31m~~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^�[0m
File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/_test_multiprocessing.py"�[0m, line �[35m573�[0m, in �[35mhandler�[0m
raise RuntimeError('join took too long: %s' % p)
�[1;35mRuntimeError�[0m: �[35mjoin took too long: <Process name='Process-158' pid=21525 parent=20497 started daemon>�[0m
|
Sorry, something went wrong.
|
Thanks @freakboy3742 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
|
Sorry, @freakboy3742, I could not cleanly backport this to |
Sorry, something went wrong.
|
After a conversation with @hugovk, it might be worth back porting this to 3.14 so that it is in 3.14 final; even if we don't do a binary release until a 3.14.1 or later - or at all - having the directory renamed will make other maintenance and back porting easier. |
Sorry, something went wrong.
…ipt (python#138176) Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and even macOS, potentially). --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> (cherry picked from commit 35c7e52)
…ipt (python#138176) Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and even macOS, potentially). --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…ild script (python#138176) Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and even macOS, potentially). --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…ild script (python#138176) Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and even macOS, potentially). --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…ild script (python#138176) Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and even macOS, potentially). --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…ild script (python#138176) Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and even macOS, potentially). --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…ild script (python#138176) Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and even macOS, potentially). --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…ild script (python#138176) Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and even macOS, potentially). --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…ild script (python#138176) Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and even macOS, potentially). --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…ild script (python#138176) Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and even macOS, potentially). --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This script simplifies the process of configuring, compiling and packaging an XCframework for an Apple platform. This is an analog of the scripts used to build Android and Emscripten artefacts. It is a precursor to adding GitHub Action builds for iOS, and producing iOS build artefacts.
At present, it only supports iOS, but it has been constructed so that it could be used on any Apple platform (including, potentially, a redistributable macOS XCframework).
The simplest usage of this script is:
which will:
XCframework, merging binaries into a "fat" binary if necessary
This is the complete sequence that would be needed in CI to build and test a candidate release artefact. The output of the command will detect if it's running in a GitHub Actions and use output groups to make the log output easier to digest.
Each individual step can be invoked individually - there are commands to
clean,configure-build,make-build,configure-host,make-host,package, andtest.There is also a
buildcommand that can be used to combine the configure and make steps for the build Python, an individual host, all hosts, or all builds.One of the steps is to manage the download of binary artefacts; these artefacts are downloaded to the
cross-build/downloadsfolder by default, but an alternate cache location can be provided.There are three potentially controversial parts to this PR:
Moving
iOStoApple/iOSAs part of recognising that iOS is one of (potentially) many Apple platforms, and to prevent future proliferation of top-level directories for other Apple platforms, it migrates the iOS folder into a top level Apple folder. This change isn't strictly required, but if we don't make this change now, there is potential for a proliferation of directories if/when we add support for tvOS, watchOS, visionOS, macCatalyst. It also provides a convenient home for "cross platform" apple concerns, like the testbed script and the build script itself, as well as place for the existing content in the
Macdirectory to migrate to as part of a cleanup of macOS builds - something that @ned-deily has expressed an interest in doing 1Universal simulator binaries
This PR generates a build that includes x86_64 simulator binaries. The iOS simulator slice of the XCframework is effectively a "universal" build covering both x86_64 and ARM64; although it has to be compiled in 2 passes and binaries merged after the fact. It's possible to both compile and test x86_64 binaries on ARM64 machines (pass
--simulator "iPhone 16e,arch=x86_64"to theciortesttarget, or to the testbed script), although running the test suite in emulator mode currently causes some test failure related tobuild-details.jsonnot being fully cross-platform aware.x86_64 isn't a Tier 3 platform for Python due to the difficulties of commissioning a buildbot; but x86_64 is still a supported platform for Apple. If we're going to produce official binaries, it seems to me like we should still support x86_64.
If we choose not to support x86_64, then there will be some changes required to the build script and testbed, as the name of the simulator slice will change from
ios_arm64_x86_64_simulatortoios_arm64_simulator. It would also allow removing the most complicated part of this script - the part that does the merging of binaries.Backporting to 3.13 and 3.14
I've proposed this for backport to 3.13 and 3.14. This is primarily so that the buildbots can be migrated to use this script, and CI jobs can be added for iOS. The directory reorganization is a significant change to make in a backport, especially in the year-old 3.13 release; however, when I floated this idea at the CPython core team summit, @Yhg1s suggested 1 that while it is a big change, the set of affected iOS users would be small, so the impact wasn't a huge concern.
NOTE: This PR currently contains a duplicate of the
iOS/Resources/bindirectory; this is needed because the location is hard-coded into the buildbots. Once the location change is confirmed, I can add the new path to the buildbot configuration, and remove the duplicate bin scripts.📚 Documentation preview 📚: https://cpython-previews--138176.org.readthedocs.build/
Footnotes
https://pyfound.blogspot.com/2025/06/python-language-summit-2025-python-on-mobile.html ↩ ↩2