From ebe04700961ce4c82b7cd7452a20163da1e81a3d Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 16 Oct 2025 11:29:59 +0800 Subject: [PATCH 01/10] Add CI job to test iOS builds. --- .github/workflows/build.yml | 32 +++++++++++++++++++ ...-10-16-11-30-53.gh-issue-140189.YCrUyt.rst | 1 + 2 files changed, 33 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2025-10-16-11-30-53.gh-issue-140189.YCrUyt.rst diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 625466151e34de..ac1644a2b520f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -414,6 +414,36 @@ jobs: - name: Build and test run: ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android + build-ios: + name: iOS (${{ matrix.arch }}) + needs: build-context + if: needs.build-context.outputs.run-tests == 'true' + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + include: + - arch: aarch64 + runs-on: macos-15 + + runs-on: ${{ matrix.runs-on }} + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + # GitHub recommends explicitly selecting the desired Xcode version: + # https://github.com/actions/runner-images/issues/12541#issuecomment-3083850140 + # This became a necessity as a result of + # https://github.com/actions/runner-images/issues/12541 and + # https://github.com/actions/runner-images/issues/12751. + - name: Select Xcode version + run: | + sudo xcode-select --switch /Applications/Xcode_16.4.app + + - name: Build and test + run: python3 Apple ci iOS --simulator 'iPhone 16e,OS=18.5' + build-wasi: name: 'WASI' needs: build-context @@ -723,6 +753,7 @@ jobs: - build-ubuntu-ssltests-awslc - build-ubuntu-ssltests-openssl - build-android + - build-ios - build-wasi - test-hypothesis - build-asan @@ -759,6 +790,7 @@ jobs: build-ubuntu-ssltests-awslc, build-ubuntu-ssltests-openssl, build-android, + build-ios, build-wasi, test-hypothesis, build-asan, diff --git a/Misc/NEWS.d/next/Build/2025-10-16-11-30-53.gh-issue-140189.YCrUyt.rst b/Misc/NEWS.d/next/Build/2025-10-16-11-30-53.gh-issue-140189.YCrUyt.rst new file mode 100644 index 00000000000000..a1b81659242670 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-10-16-11-30-53.gh-issue-140189.YCrUyt.rst @@ -0,0 +1 @@ +iOS builds were added to CI. From e1f19c796147f9d5414e848955d82db2df94c02c Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 21 Oct 2025 09:59:59 +0800 Subject: [PATCH 02/10] Enable line buffering in framework build scripts. --- Apple/__main__.py | 6 ++++++ Apple/testbed/__main__.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/Apple/__main__.py b/Apple/__main__.py index 96c2d34fbe0959..2b022b01589b93 100644 --- a/Apple/__main__.py +++ b/Apple/__main__.py @@ -1012,4 +1012,10 @@ def signal_handler(*args): if __name__ == "__main__": + # Under the buildbot, stdout is not a TTY, but we must still flush after + # every line to make sure our output appears in the correct order relative + # to the output of our subprocesses. + for stream in [sys.stdout, sys.stderr]: + stream.reconfigure(line_buffering=True) + main() diff --git a/Apple/testbed/__main__.py b/Apple/testbed/__main__.py index 4a1333380cdb6d..f3407ecdf7e734 100644 --- a/Apple/testbed/__main__.py +++ b/Apple/testbed/__main__.py @@ -412,4 +412,9 @@ def main(): if __name__ == "__main__": + # Under the buildbot, stdout is not a TTY, but we must still flush after + # every line to make sure our output appears in the correct order relative + # to the output of our subprocesses. + for stream in [sys.stdout, sys.stderr]: + stream.reconfigure(line_buffering=True) main() From 4193eed61bb54c0f32fb678ccbf1f144cf90c100 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 21 Oct 2025 10:12:58 +0800 Subject: [PATCH 03/10] Switch to macos-14 runner. --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac1644a2b520f7..f601496ecdcc2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -424,8 +424,7 @@ jobs: matrix: include: - arch: aarch64 - runs-on: macos-15 - + runs-on: macos-14 runs-on: ${{ matrix.runs-on }} steps: - uses: actions/checkout@v4 @@ -439,10 +438,10 @@ jobs: # https://github.com/actions/runner-images/issues/12751. - name: Select Xcode version run: | - sudo xcode-select --switch /Applications/Xcode_16.4.app + sudo xcode-select --switch /Applications/Xcode_15.4.app - name: Build and test - run: python3 Apple ci iOS --simulator 'iPhone 16e,OS=18.5' + run: python3 Apple ci iOS --simulator 'iPhone SE 3rd generation,OS=17.5' build-wasi: name: 'WASI' From a30fa8382f0f7a810bc160fccc1ca377688cf73c Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 21 Oct 2025 10:23:19 +0800 Subject: [PATCH 04/10] Correct naming of SE simulator. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f601496ecdcc2d..0a1b8f536c957a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -441,7 +441,7 @@ jobs: sudo xcode-select --switch /Applications/Xcode_15.4.app - name: Build and test - run: python3 Apple ci iOS --simulator 'iPhone SE 3rd generation,OS=17.5' + run: python3 Apple ci iOS --simulator 'iPhone SE (3rd generation),OS=17.5' build-wasi: name: 'WASI' From 22e3968af111734c99a2ea1ed420a05870c66e4f Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 21 Oct 2025 12:52:17 +0800 Subject: [PATCH 05/10] Revert to macos-15 runnner. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a1b8f536c957a..ee13fa77313cb1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -424,7 +424,7 @@ jobs: matrix: include: - arch: aarch64 - runs-on: macos-14 + runs-on: macos-15 runs-on: ${{ matrix.runs-on }} steps: - uses: actions/checkout@v4 @@ -438,10 +438,10 @@ jobs: # https://github.com/actions/runner-images/issues/12751. - name: Select Xcode version run: | - sudo xcode-select --switch /Applications/Xcode_15.4.app + sudo xcode-select --switch /Applications/Xcode_16.4.app - name: Build and test - run: python3 Apple ci iOS --simulator 'iPhone SE (3rd generation),OS=17.5' + run: python3 Apple ci iOS --simulator 'iPhone 16e,OS=18.5' build-wasi: name: 'WASI' From 5103ac798ab0893a07e812ac5ade45884306bafa Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 21 Oct 2025 12:52:47 +0800 Subject: [PATCH 06/10] Simplify build artefact in 'fast' mode. --- Apple/__main__.py | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/Apple/__main__.py b/Apple/__main__.py index 2b022b01589b93..88c65f3952e796 100644 --- a/Apple/__main__.py +++ b/Apple/__main__.py @@ -836,11 +836,39 @@ def test(context: argparse.Namespace, host: str | None = None) -> None: ) +def apple_sim_host(platform_name: str) -> str: + """Determine the native simulator target for this platform.""" + for _, slice_parts in HOSTS[platform_name].items(): + for host_triple in slice_parts: + parts = host_triple.split('-') + if parts[0] == platform.machine() and parts[-1] == "simulator": + return host_triple + + raise KeyError(platform_name) + + def ci(context: argparse.Namespace) -> None: - """The implementation of the "ci" command.""" + """The implementation of the "ci" command. + + In "Fast" mode, this compiles the build python, and the simulator for the + build machine's architecture; and runs the test suite with `--fast-ci` + configuration. + + In "Slow" mode, it compiles the build python, plus all candidate + architectures (both device and simulator); then runs the test suite with + `--slow-ci` configuration. + """ clean(context, "all") - build(context, host="all") - test(context, host="all") + if context.slow: + # In slow mode, doa. tu + build(context, host="all") + test(context, host="all") + else: + # In fast mode, just build the simulator platform. + sim_host = apple_sim_host(context.platform) + build(context, host="build") + build(context, host=sim_host) + test(context, host=sim_host) def parse_args() -> argparse.Namespace: From 6ed3dcfee12a185b5dbdc471fa91b5787e103f1b Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 21 Oct 2025 13:31:55 +0800 Subject: [PATCH 07/10] Normalize the slow/fast argument for CI execution. --- Apple/__main__.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Apple/__main__.py b/Apple/__main__.py index 88c65f3952e796..34744871f681ea 100644 --- a/Apple/__main__.py +++ b/Apple/__main__.py @@ -823,7 +823,7 @@ def test(context: argparse.Namespace, host: str | None = None) -> None: + [ "--", "test", - "--slow-ci" if context.slow else "--fast-ci", + f"--{context.ci_mode}-ci", "--single-process", "--no-randomize", # Timeout handling requires subprocesses; explicitly setting @@ -859,8 +859,8 @@ def ci(context: argparse.Namespace) -> None: `--slow-ci` configuration. """ clean(context, "all") - if context.slow: - # In slow mode, doa. tu + if context.ci_mode == "slow": + # In slow mode, build and test the full XCframework build(context, host="all") test(context, host="all") else: @@ -975,11 +975,13 @@ def parse_args() -> argparse.Namespace: "an ARM64 iPhone 16 Pro simulator running iOS 26.0." ), ) - cmd.add_argument( - "--slow", - action="store_true", - help="Run tests with --slow-ci options.", - ) + group = cmd.add_mutually_exclusive_group() + group.add_argument( + "--fast-ci", action="store_const", dest="ci_mode", const="fast", + help="Add test arguments for GitHub Actions") + group.add_argument( + "--slow-ci", action="store_const", dest="ci_mode", const="slow", + help="Add test arguments for buildbots") for subcommand in [configure_build, configure_host, build, ci]: subcommand.add_argument( From 57300c349d0eb9c777e414493f6ddd09f7fde10c Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 21 Oct 2025 13:39:32 +0800 Subject: [PATCH 08/10] Explicitly use --fast-ci mode in CI config. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee13fa77313cb1..032553f7ad3b25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -441,7 +441,7 @@ jobs: sudo xcode-select --switch /Applications/Xcode_16.4.app - name: Build and test - run: python3 Apple ci iOS --simulator 'iPhone 16e,OS=18.5' + run: python3 Apple ci iOS --fast-ci --simulator 'iPhone 16e,OS=18.5' build-wasi: name: 'WASI' From f69bdf4494adec9b045b376b984dba3c84ce6c03 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 22 Oct 2025 07:11:23 +0800 Subject: [PATCH 09/10] Simplify CI configuration for iOS builds. Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .github/workflows/build.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 032553f7ad3b25..efab37599b69ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -415,17 +415,13 @@ jobs: run: ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android build-ios: - name: iOS (${{ matrix.arch }}) + name: iOS needs: build-context if: needs.build-context.outputs.run-tests == 'true' timeout-minutes: 60 strategy: fail-fast: false - matrix: - include: - - arch: aarch64 - runs-on: macos-15 - runs-on: ${{ matrix.runs-on }} + runs-on: macos-15 steps: - uses: actions/checkout@v4 with: From 57c429078952df2fd740187b7035af3d1c8e26e2 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 22 Oct 2025 07:17:40 +0800 Subject: [PATCH 10/10] Remove fail-fast strategy. --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efab37599b69ab..6aa99928278294 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -419,8 +419,6 @@ jobs: needs: build-context if: needs.build-context.outputs.run-tests == 'true' timeout-minutes: 60 - strategy: - fail-fast: false runs-on: macos-15 steps: - uses: actions/checkout@v4