-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Test and fix iOS #5158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Test and fix iOS #5158
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -240,6 +240,11 @@ jobs: | |
| # FIXME(ppc): SIGILL running tests, see | ||
| # https://github.com/rust-lang/libc/pull/4254#issuecomment-2636288713 | ||
| # - target: powerpc-unknown-linux-gnu | ||
| - 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 } | ||
| runs-on: ${{ matrix.os && matrix.os || 'ubuntu-26.04' }} | ||
| timeout-minutes: 25 | ||
| env: | ||
|
|
@@ -261,6 +266,16 @@ jobs: | |
| jq -r 'to_entries | map("\(.key)=\(.value|tostring)") | .[]' >>$GITHUB_ENV | ||
| shell: bash | ||
|
|
||
| - name: Install `cargo-apple-runner` | ||
| if: matrix.cargo-apple-runner | ||
| uses: taiki-e/install-action@0631aa6515c7d545823c67cfae7ef4fc7f490154 # v2.81.8 | ||
| with: | ||
| tool: cargo-apple-runner | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unsure if this is how you'll want this to be installed?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be best to put this into a dockerfile, like we do for Android and other emulated targets. All of the env/install/launch can live there, and it will be easier for anyone to run locally |
||
|
|
||
| - name: Start simulator | ||
| if: matrix.simulator | ||
| run: xcrun simctl boot "${{ matrix.simulator }}" | ||
|
|
||
| - name: Run natively | ||
| if: runner.os != 'Linux' | ||
| run: ./ci/run.sh ${{ matrix.target }} | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -209,6 +209,9 @@ fn test_apple(target: &str) { | |
| assert!(target.contains("apple")); | ||
| let x86_64 = target.contains("x86_64"); | ||
| let i686 = target.contains("i686"); | ||
| let macos = target.contains("darwin") || target.contains("macos"); | ||
| let tvos = target.contains("tvos"); | ||
| let watchos = target.contains("watchos"); | ||
|
|
||
| let mut cfg = ctest_cfg(); | ||
|
|
||
|
|
@@ -236,27 +239,29 @@ fn test_apple(target: &str) { | |
| "ifaddrs.h", | ||
| "langinfo.h", | ||
| "libgen.h", | ||
| "libproc.h", | ||
| (macos, "libproc.h"), | ||
| "limits.h", | ||
| "locale.h", | ||
| "mach/mach.h", | ||
| "malloc/malloc.h", | ||
| "net/bpf.h", | ||
| "net/dlil.h", | ||
| (macos, "net/bpf.h"), | ||
| (macos, "net/dlil.h"), | ||
| "net/if.h", | ||
| "net/if_arp.h", | ||
| (macos, "net/if_arp.h"), | ||
| "net/if_dl.h", | ||
| "net/if_mib.h", | ||
| "net/if_utun.h", | ||
| (macos, "net/if_mib.h"), | ||
| (macos, "net/if_utun.h"), | ||
| "net/if_var.h", | ||
| "net/ndrv.h", | ||
| "net/route.h", | ||
| (macos, "net/ndrv.h"), | ||
| (macos, "net/route.h"), | ||
| "netdb.h", | ||
| "netinet/if_ether.h", | ||
| (macos, "netinet/if_ether.h"), | ||
| "netinet/in.h", | ||
| "netinet/ip.h", | ||
| "netinet/tcp.h", | ||
| "netinet/udp.h", | ||
| "netinet6/in6_var.h", | ||
| "netinet6/scope6_var.h", | ||
| (macos, "netinet6/in6_var.h"), | ||
| "os/clock.h", | ||
| "os/lock.h", | ||
| "os/signpost.h", | ||
|
|
@@ -287,20 +292,20 @@ fn test_apple(target: &str) { | |
| "sys/file.h", | ||
| "sys/ioctl.h", | ||
| "sys/ipc.h", | ||
| "sys/kern_control.h", | ||
| (macos, "sys/kern_control.h"), | ||
| "sys/mman.h", | ||
| "sys/mount.h", | ||
| "sys/proc_info.h", | ||
| "sys/ptrace.h", | ||
| (macos, "sys/proc_info.h"), | ||
| (macos, "sys/ptrace.h"), | ||
| "sys/quota.h", | ||
| "sys/random.h", | ||
| (macos, "sys/random.h"), | ||
| "sys/resource.h", | ||
| "sys/sem.h", | ||
| "sys/shm.h", | ||
| "sys/socket.h", | ||
| "sys/stat.h", | ||
| "sys/statvfs.h", | ||
| "sys/sys_domain.h", | ||
| (macos, "sys/sys_domain.h"), | ||
| "sys/sysctl.h", | ||
| "sys/time.h", | ||
| "sys/times.h", | ||
|
|
@@ -321,7 +326,7 @@ fn test_apple(target: &str) { | |
| "utmpx.h", | ||
| "wchar.h", | ||
| "xlocale.h", | ||
| (x86_64, "crt_externs.h"), | ||
| "crt_externs.h", | ||
| ); | ||
|
|
||
| cfg.skip_struct(move |s| { | ||
|
|
@@ -377,6 +382,26 @@ fn test_apple(target: &str) { | |
| "close" if x86_64 => true, | ||
| // FIXME(1.0): std removed libresolv support: https://github.com/rust-lang/rust/pull/102766 | ||
| "res_init" => true, | ||
| // Marked available everywhere, but the `sys/random.h` header only | ||
| // exists on the macOS SDK. | ||
| // FIXME(madsmtm): Filed as FB23000895. | ||
| "getentropy" => !macos, | ||
| // Prohibited on iOS, tvOS, watchOS and visionOS. | ||
| // FIXME(madsmtm): Perhaps we should just not expose this symbol? | ||
| "system" => !macos, | ||
| // Marked unavailable on iOS, tvOS, watchOS and visionOS. | ||
| // FIXME(madsmtm): Perhaps we should just not expose these symbols? | ||
| "pthread_jit_write_protect_np" | ||
| | "pthread_jit_write_protect_supported_np" | ||
| | "pthread_jit_write_with_callback_np" | ||
| | "pthread_jit_write_freeze_callbacks_np" | ||
| | "gethostuuid" => !macos, | ||
| // Marked as unavailable on tvOS and watchOS. | ||
| // FIXME(madsmtm): Perhaps we should just not expose this symbol? | ||
|
Comment on lines
+385
to
+400
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be good to have some place to discuss and figure this out, could you make an issue and put the issue number in the fixmes?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would probably be good to mark all of these deprecated on the relevant targets and link users to that issue. But that can be a followup. |
||
| "execl" | "execle" | "execlp" | "execv" | "execve" | "execvp" | "execvP" | "fork" | ||
| | "sigaltstack" | "syscall" | "daemon" | "brk" | "sbrk" | "task_set_info" | ||
| | "exchangedata" => tvos || watchos, | ||
| ident if ident.starts_with("posix_spawn") => tvos || watchos, | ||
| _ => false, | ||
| } | ||
| }); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add tests for tvOS, watchOS and visionOS here too, if you'd like?
View changes since the review