Test and fix iOS#5158
Conversation
2d10ab7 to
f222bd7
Compare
| 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( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Sometimes people open issues/PRs to fix iOS/App store builds but we'd need to go through PRs/issues to find the users. ^^'
There was a problem hiding this comment.
I filed GuillaumeGomez/sysinfo#1679, leaving the thread unresolved for reviewers to see.
f222bd7 to
5d33927
Compare
| if: matrix.cargo-apple-runner | ||
| uses: taiki-e/install-action@0631aa6515c7d545823c67cfae7ef4fc7f490154 # v2.81.8 | ||
| with: | ||
| tool: cargo-apple-runner |
There was a problem hiding this comment.
Unsure if this is how you'll want this to be installed?
| - target: aarch64-apple-ios-sim | ||
| os: macos-26 | ||
| cargo-apple-runner: true | ||
| simulator: "iPhone 17" | ||
| env: { CARGO_TARGET_AARCH64_APPLE_IOS_SIM_RUNNER: cargo-apple-runner } |
There was a problem hiding this comment.
We could add tests for tvOS, watchOS and visionOS here too, if you'd like?
5d33927 to
3297d7a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
9edcebb to
999db32
Compare
| # ctest's own tests don't work on Apple devices, since these don't have | ||
| # host tooling such as `rustc` or a C compiler. | ||
| *ios|tvos|watchos|visionos*) cmd="$cmd --workspace --exclude ctest" ;; |
There was a problem hiding this comment.
Alternatively we could cfg_attr(..., ignore = "...")-gate everything in ctest/tests/basic.rs, but I went with this because it seemed easier to maintain (and ctest doesn't need to work on iOS, so there's not really a reason to unit test it either).
This comment has been minimized.
This comment has been minimized.
These are not available on iOS, tvOS, watchOS and visionOS.
999db32 to
0598978
Compare
0598978 to
4bfdbd8
Compare
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 untilsysinfohas gotten a release with this fixed, and wait until said release has gotten more popular.Fixes #1054.
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target aarch64-apple-ios-sim);especially relevant for platforms that may not be checked in CI