Skip to content

Commit

Permalink
Rollup merge of rust-lang#125226 - madsmtm:fix-mac-catalyst-tests, r=…
Browse files Browse the repository at this point in the history
…workingjubilee

Make more of the test suite run on Mac Catalyst

Combined with rust-lang#125225, the only failing parts of the test suite are in `tests/rustdoc-js`, `tests/rustdoc-js-std` and `tests/debuginfo`. Tested with:
```console
./x test --target=aarch64-apple-ios-macabi library/std
./x test --target=aarch64-apple-ios-macabi --skip=tests/rustdoc-js --skip=tests/rustdoc-js-std --skip=tests/debuginfo tests
```

Will probably put up a PR later to enable _running_ on (not just compiling for) Mac Catalyst in CI, though not sure where exactly I should do so? `src/ci/github-actions/jobs.yml`?

Note that I've deliberately _not_ enabled stack overflow handlers on iOS/tvOS/watchOS/visionOS (see rust-lang#25872), but rather just skipped those tests, as it uses quite a few APIs that I'd be weary about getting rejected by the App Store (note that Swift doesn't do it on those platforms either).

r? ``@workingjubilee``

CC ``@thomcc``

``@rustbot`` label O-ios O-apple
  • Loading branch information
jieyouxu authored May 29, 2024
2 parents 565dce2 + 3170156 commit 1aaf0a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion std/src/fs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@ fn metadata_access_times() {
assert_eq!(check!(a.modified()), check!(a.modified()));
assert_eq!(check!(b.accessed()), check!(b.modified()));

if cfg!(target_os = "macos") || cfg!(target_os = "windows") {
if cfg!(target_vendor = "apple") || cfg!(target_os = "windows") {
check!(a.created());
check!(b.created());
}
Expand Down
8 changes: 8 additions & 0 deletions std/src/sys/pal/unix/stack_overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,14 @@ mod imp {
}
}

// This is intentionally not enabled on iOS/tvOS/watchOS/visionOS, as it uses
// several symbols that might lead to rejections from the App Store, namely
// `sigaction`, `sigaltstack`, `sysctlbyname`, `mmap`, `munmap` and `mprotect`.
//
// This might be overly cautious, though it is also what Swift does (and they
// usually have fewer qualms about forwards compatibility, since the runtime
// is shipped with the OS):
// <https://github.com/apple/swift/blob/swift-5.10-RELEASE/stdlib/public/runtime/CrashHandlerMacOS.cpp>
#[cfg(not(any(
target_os = "linux",
target_os = "freebsd",
Expand Down

0 comments on commit 1aaf0a9

Please sign in to comment.