Skip to content

Commit 999db32

Browse files
committed
Use cargo-apple-runner for testing iOS
1 parent f12bafb commit 999db32

3 files changed

Lines changed: 17 additions & 189 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ jobs:
240240
# FIXME(ppc): SIGILL running tests, see
241241
# https://github.com/rust-lang/libc/pull/4254#issuecomment-2636288713
242242
# - target: powerpc-unknown-linux-gnu
243+
- target: aarch64-apple-ios-sim
244+
os: macos-26
245+
cargo-apple-runner: true
246+
simulator: "iPhone 17"
247+
env: { CARGO_TARGET_AARCH64_APPLE_IOS_SIM_RUNNER: cargo-apple-runner }
243248
runs-on: ${{ matrix.os && matrix.os || 'ubuntu-24.04' }}
244249
timeout-minutes: 25
245250
env:
@@ -261,6 +266,16 @@ jobs:
261266
jq -r 'to_entries | map("\(.key)=\(.value|tostring)") | .[]' >>$GITHUB_ENV
262267
shell: bash
263268

269+
- name: Install `cargo-apple-runner`
270+
if: matrix.cargo-apple-runner
271+
uses: taiki-e/install-action@0631aa6515c7d545823c67cfae7ef4fc7f490154 # v2.81.8
272+
with:
273+
tool: cargo-apple-runner
274+
275+
- name: Start simulator
276+
if: matrix.simulator
277+
run: xcrun simctl boot "${{ matrix.simulator }}"
278+
264279
- name: Run natively
265280
if: runner.os != 'Linux'
266281
run: ./ci/run.sh ${{ matrix.target }}

ci/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ The remaining architectures look like:
3737
the generated binary to actually verify the tests pass.
3838
* The MUSL build just has to download a MUSL compiler and target libraries and
3939
then otherwise runs tests normally.
40-
* iOS builds need an extra linker flag currently, but beyond that they're built
41-
as standard as everything else.
40+
* iOS is tested using [`cargo-apple-runner`][cargo-apple-runner].
4241
* The BSD builds, currently OpenBSD and FreeBSD, use QEMU to boot up a system
4342
and compile/run tests. More information on that below.
4443

4544
[Actions config]: https://github.com/rust-lang/libc/tree/HEAD/.github/workflows
4645
[android-docker]: https://github.com/rust-lang/libc/blob/HEAD/ci/docker/x86_64-linux-android/Dockerfile
46+
[cargo-apple-runner]: https://github.com/madsmtm/cargo-apple-runner
4747

4848
## QEMU
4949

ci/ios/deploy_and_run_on_ios_simulator.rs

Lines changed: 0 additions & 187 deletions
This file was deleted.

0 commit comments

Comments
 (0)