Skip to content

Test and fix iOS - #5158

Merged
tgross35 merged 7 commits into
rust-lang:mainfrom
madsmtm:cargo-apple-runner
Aug 19, 2026
Merged

tgross35 merged 7 commits into
rust-lang:mainfrom
madsmtm:cargo-apple-runner

Conversation

@madsmtm

@madsmtm madsmtm commented Jun 9, 2026 •

Copy link
Copy Markdown
Member

Description

Enable testing on iOS using cargo-apple-runner, a tool I maintain for making it easier to run binaries on the iOS/tvOS/watchOS/visionOS simulator.

This reveals a bunch of places where we exposed symbols that are not actually available on iOS, I've cfg-gated those as #[cfg(target_os = "macos")].

I have marked this as stable-nominated, because I tend to think it fits there even though it's breaking, but we should definitely wait until sysinfo has gotten a release with this fixed, and wait until said release has gotten more popular.

Fixes #1054.

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are included (see #3131)
  • Tested locally; especially relevant for platforms that may not be checked in CI
    CARGO_TARGET_AARCH64_APPLE_IOS_SIM_RUNNER=cargo-apple-runner cargo test --target aarch64-apple-ios-sim -plibc-test
    CARGO_TARGET_AARCH64_APPLE_TVOS_SIM_RUNNER=cargo-apple-runner cargo test --target aarch64-apple-tvos-sim -plibc-test
    CARGO_TARGET_AARCH64_APPLE_WATCHOS_SIM_RUNNER=cargo-apple-runner cargo test --target aarch64-apple-watchos-sim -plibc-test
    CARGO_TARGET_AARCH64_APPLE_VISIONOS_SIM_RUNNER=cargo-apple-runner cargo test --target aarch64-apple-visionos-sim -plibc-test
    

@madsmtm madsmtm added A-CI Area: CI-related items O-macos C-testsuite C-cleanup stable-nominated This PR should be considered for cherry-pick to libc's stable release branch github_actions Pull requests that update GitHub Actions code labels Jun 9, 2026
@madsmtm
madsmtm force-pushed the cargo-apple-runner branch from 2d10ab7 to f222bd7 Compare June 9, 2026 14:22
Comment thread src/unix/bsd/apple/mod.rs
pub fn proc_listpgrppids(pgrpid: crate::pid_t, buffer: *mut c_void, buffersize: c_int)
-> c_int;
pub fn proc_listchildpids(ppid: crate::pid_t, buffer: *mut c_void, buffersize: c_int) -> c_int;
pub fn proc_pidinfo(

@madsmtm madsmtm Jun 9, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cfg-gating the sys/proc_info.h stuff will mean the sysinfo crate will no longer compile on iOS/tvOS/watchOS/visionOS, CC @GuillaumeGomez, but it was probably broken before? At least unlikely that actually using these symbols it would get through the App Store.

View changes since the review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, people using sysinfo on iOS/App store have access to these functions. Would be nice to have a confirmation though as I can't do it myself.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know who's using sysinfo on iOS? I guess I know that Bevy uses it, so perhaps it's fine, though that might also just be because that code-path is unused (and thus not present in the final binary).

Anyhow, I suspect it's just ProcessInner::open_files that'll need to be gated as macOS-only.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes people open issues/PRs to fix iOS/App store builds but we'd need to go through PRs/issues to find the users. ^^'

@madsmtm madsmtm Jun 18, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed GuillaumeGomez/sysinfo#1679, leaving the thread unresolved for reviewers to see.

@madsmtm madsmtm changed the title Test on iOS Test and fix iOS Jun 9, 2026
@madsmtm
madsmtm force-pushed the cargo-apple-runner branch from f222bd7 to 5d33927 Compare June 9, 2026 14:28
Comment thread .github/workflows/ci.yaml
Comment thread .github/workflows/ci.yaml Outdated
@madsmtm
madsmtm force-pushed the cargo-apple-runner branch from 5d33927 to 3297d7a Compare June 9, 2026 14:31
@madsmtm

This comment was marked as resolved.

@madsmtm
madsmtm force-pushed the cargo-apple-runner branch 4 times, most recently from 9edcebb to 999db32 Compare June 14, 2026 15:50
Comment thread ci/run.sh Outdated
@rustbot

This comment has been minimized.

@madsmtm
madsmtm force-pushed the cargo-apple-runner branch from 999db32 to 0598978 Compare June 18, 2026 16:09
@madsmtm
madsmtm force-pushed the cargo-apple-runner branch from 0598978 to 4bfdbd8 Compare June 18, 2026 17:01
@madsmtm
madsmtm marked this pull request as ready for review June 18, 2026 17:17
Comment thread libc-test/build.rs Outdated
@tgross35

Copy link
Copy Markdown
Member

Left some first pass feedback here,
@rustbot author

@rustbot

rustbot commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@madsmtm
madsmtm deleted the cargo-apple-runner branch August 19, 2026 21:29
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
These either don't exist in the iOS, tvOS, watchOS and visionOS SDKs, or
are marked as unavailable on those platforms.

(backport <rust-lang#5158>)
(cherry picked from commit 00f55f6)
[ needed a slightly unusual resolution due to 790e5c6 ("Remove
  removed items in OpenBSD") which isn't backported - Trevor ]
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
(backport <rust-lang#5158>)
(cherry picked from commit f3b2c50)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
@tgross35 tgross35 mentioned this pull request Sep 4, 2026
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Sep 4, 2026
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
This makes it clearer where these overrides are required. There should
be no functional changes here (since the only three architectures we
support for macOS are x86, x86_64 and aarch64).

(backport <rust-lang#5158>)
(cherry picked from commit 6bf10ad)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
This fixes:
- The value of `FNM_PATHNAME` and `FNM_NOESCAPE` on iOS, tvOS, watchOS
  and visionOS.
- `memmem` and `task_set_info` not being available on watchOS.
- `sigqueue` not being available on iOS, tvOS, watchOS and visionOS.

(backport <rust-lang#5158>)
(cherry picked from commit e931965)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
These either don't exist in the iOS, tvOS, watchOS and visionOS SDKs, or
are marked as unavailable on those platforms.

(backport <rust-lang#5158>)
(cherry picked from commit 00f55f6)
[ needed a slightly unusual resolution due to 790e5c6 ("Remove
  removed items in OpenBSD") which isn't backported - Trevor ]
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
(backport <rust-lang#5158>)
(cherry picked from commit f3b2c50)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
xtqqczze added a commit to xtqqczze/bytecodealliance-rustix that referenced this pull request Sep 6, 2026
The `SYSPROTO_EVENT` and `SYSPROTO_CONTROL` constants are only available
on macOS, see rust-lang/libc#5158.
xtqqczze added a commit to xtqqczze/bytecodealliance-rustix that referenced this pull request Sep 6, 2026
The `AF_SYS_CONTROL` constant is only available on macOS, see rust-lang/libc#5158.
sunfishcode pushed a commit to bytecodealliance/rustix that referenced this pull request Sep 16, 2026
* ci: add web-sys pin

* Import statx_flags from linux_raw_sys explicitly to avoid libc conflicts

* Gate sysproto module to macOS

The `SYSPROTO_EVENT` and `SYSPROTO_CONTROL` constants are only available
on macOS, see rust-lang/libc#5158.

* Gate `AF_SYS_CONTROL` to macos

The `AF_SYS_CONTROL` constant is only available on macOS, see rust-lang/libc#5158.

* Return `NOSYS` from `utimensat` on tvOS and watchOS

tvOS and watchOS do not provide `fork`, so the `utimensat` fallback cannot be implemented on these platforms. Return `NOSYS` instead.
mmogr added a commit to mmogr/modelpipe-ffi that referenced this pull request Oct 9, 2026
…rk compile again

libc 0.2.190 stopped exposing macOS-only API on iOS (rust-lang/libc#5158).
netdev 0.46.3, underneath iroh by way of netwatch, still uses one of those
items, `in6_ifreq`, on every Apple target, so with 0.2.190 in the lock the
aarch64-apple-ios and aarch64-apple-ios-sim slices fail to compile and the
Apple build and Swift smoke job is red. netdev 0.46.2 has the same code, so
holding netdev back does not help; libc is the release to hold.

Cargo.toml now bounds libc to =0.2.189 on Apple targets, which bounds the
lock everywhere, so a later `cargo update` or Update dependencies run keeps
it. Dependabot ignores libc >= 0.2.190 for the same reason. Both come out
once netdev ships a release that builds for iOS against a newer libc.
mmogr added a commit to mmogr/modelpipe-ffi that referenced this pull request Oct 9, 2026
… its range allows (#51)

* chore(deps): the lock resolves every dependency to the newest version its range allows

allocator-api2 0.2.21 -> (none)
async-trait 0.1.92 -> (none)
bitflags 2.13.1 -> 2.13.2
camino 1.2.5 -> 1.2.6
cc 1.4.5 -> 1.6.0
cfg-if 1.0.4 -> 1.0.5
clap 4.6.6 -> 4.6.7
clap_builder 4.6.6 -> 4.6.7
clap_derive 4.6.4 -> 4.6.7
clap_lex 1.1.0 -> 1.1.1
core-foundation 0.9.4 -> (none)
critical-section 1.2.0 -> (none)
crossbeam-channel 0.5.17 -> (none)
crossbeam-epoch 0.9.21 -> (none)
crossbeam-utils 0.8.23 -> (none)
ctutils 0.4.2 -> 0.4.3
either 1.18.0 -> (none)
find-msvc-tools 0.1.12 -> 0.1.14
fs-err 3.3.1 -> 3.3.2
generator 0.8.9 -> 0.8.10
h2 0.4.19 -> 0.4.20
hickory-net 0.26.2 -> (none)
hickory-proto 0.26.2 -> (none)
hickory-resolver 0.26.2 -> (none)
hybrid-array 0.4.14 -> 0.4.15
hyper 1.11.1 -> 1.12.0
hyper-rustls 0.27.9 -> 0.27.10
hyper-util 0.1.20 -> 0.1.21
iroh 1.1.0 -> 1.3.0
iroh-base 1.1.0 -> 1.3.0
iroh-dns 1.1.0 -> 1.3.0
iroh-metrics 1.0.1 -> 1.0.2
iroh-relay 1.1.0 -> 1.3.0
js-sys 0.3.105 -> 0.3.106
lazy_static 1.5.0 -> 1.5.1
libc 0.2.189 -> 0.2.190
lock_api 0.4.14 -> (none)
lru 0.18.4 -> 0.18.5
lru-slab 0.1.2 -> 0.1.3
mio 1.2.3 -> 1.2.4
modelpipe 0.8.3 -> 0.8.5
moka 0.12.16 -> (none)
n0-dns-resolver (none) -> 0.1.0
netdev 0.46.2 -> 0.46.3
noq 1.2.0 -> 1.3.0
noq-proto 1.2.0 -> 1.3.0
noq-udp 1.2.0 -> 1.3.0
objc2 0.6.4 -> 0.6.5
parking_lot 0.12.5 -> (none)
parking_lot_core 0.9.12 -> (none)
powerfmt 0.2.0 -> 0.2.1
prefix-trie 0.8.4 -> (none)
rand 0.10.2 -> 0.10.3
redox_syscall 0.5.18 -> (none)
reqwest 0.13.4 -> 0.13.5
resolv-conf 0.7.6 -> (none)
rustix 1.1.4 -> 1.1.5
rustls 0.23.44 -> 0.23.45
rustls-platform-verifier 0.7.0 -> 0.7.1
rustls-platform-verifier-android 0.1.1 -> 0.2.0
scopeguard 1.2.0 -> (none)
serde_spanned 1.1.1 -> 1.1.2
siphasher 1.0.3 -> 1.0.4
smallvec 1.16.0 -> 1.16.2
spki 0.8.0 -> 0.8.1
syn 3.0.5 -> 3.0.6
synstructure 0.13.2 -> 0.14.0
system-configuration 0.7.0 -> 0.8.0
tagptr 0.2.0 -> (none)
textwrap 0.16.2 -> 0.16.4
thiserror 2.0.20 -> 2.0.21
thiserror-impl 2.0.20 -> 2.0.21
tinyvec 1.13.2 -> 1.13.3
tinyvec_macros 0.1.1 -> (none)
tokio-rustls 0.26.5 -> 0.26.6
toml 1.1.5+spec-1.1.0 -> 1.1.7+spec-1.1.0
toml_datetime 1.1.1+spec-1.1.0 -> 1.1.2+spec-1.1.0
toml_edit 0.25.13+spec-1.1.0 -> 0.25.16+spec-1.1.0
toml_parser 1.1.3+spec-1.1.0 -> 1.1.4+spec-1.1.0
toml_writer 1.1.2+spec-1.1.0 -> 1.1.3+spec-1.1.0
unicode-ident 1.0.24 -> 1.0.26
unicode-width (none) -> 0.2.2
uuid 1.26.0 -> (none)
want 0.3.1 -> 0.3.2
wasm-bindgen 0.2.128 -> 0.2.129
wasm-bindgen-futures 0.4.78 -> 0.4.79
wasm-bindgen-macro 0.2.128 -> 0.2.129
wasm-bindgen-macro-support 0.2.128 -> 0.2.129
wasm-bindgen-shared 0.2.128 -> 0.2.129
web-sys 0.3.105 -> 0.3.106
yoke-derive 0.8.2 -> 0.8.4
zerocopy 0.8.56 -> 0.8.62
zerocopy-derive 0.8.56 -> 0.8.62
zerofrom-derive 0.1.7 -> 0.1.8
zeroize 1.9.0 -> 1.9.1

* fix(deps): libc stays at 0.2.189, so both iOS slices of the XCFramework compile again

libc 0.2.190 stopped exposing macOS-only API on iOS (rust-lang/libc#5158).
netdev 0.46.3, underneath iroh by way of netwatch, still uses one of those
items, `in6_ifreq`, on every Apple target, so with 0.2.190 in the lock the
aarch64-apple-ios and aarch64-apple-ios-sim slices fail to compile and the
Apple build and Swift smoke job is red. netdev 0.46.2 has the same code, so
holding netdev back does not help; libc is the release to hold.

Cargo.toml now bounds libc to =0.2.189 on Apple targets, which bounds the
lock everywhere, so a later `cargo update` or Update dependencies run keeps
it. Dependabot ignores libc >= 0.2.190 for the same reason. Both come out
once netdev ships a release that builds for iOS against a newer libc.

---------

Co-authored-by: mmogr <172192206+mmogr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: CI-related items C-cleanup C-testsuite github_actions Pull requests that update GitHub Actions code O-macos O-unix stable-applied This PR has been cherry-picked to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-enable iOS on CI

4 participants