Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit dd5163a

Browse files
authored
Unrolled build for rust-lang#125226
Rollup merge of rust-lang#125226 - madsmtm:fix-mac-catalyst-tests, r=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
2 parents da159eb + e6b9bb7 commit dd5163a

File tree

48 files changed

+120
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+120
-100
lines changed

library/std/src/fs/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ fn metadata_access_times() {
14311431
assert_eq!(check!(a.modified()), check!(a.modified()));
14321432
assert_eq!(check!(b.accessed()), check!(b.modified()));
14331433

1434-
if cfg!(target_os = "macos") || cfg!(target_os = "windows") {
1434+
if cfg!(target_vendor = "apple") || cfg!(target_os = "windows") {
14351435
check!(a.created());
14361436
check!(b.created());
14371437
}

library/std/src/sys/pal/unix/stack_overflow.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,14 @@ mod imp {
491491
}
492492
}
493493

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

src/bootstrap/src/utils/dylib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
pub fn dylib_path_var() -> &'static str {
66
if cfg!(target_os = "windows") {
77
"PATH"
8-
} else if cfg!(target_os = "macos") {
8+
} else if cfg!(target_vendor = "apple") {
99
"DYLD_LIBRARY_PATH"
1010
} else if cfg!(target_os = "haiku") {
1111
"LIBRARY_PATH"

src/tools/compiletest/src/header.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
747747
"ignore-aarch64",
748748
"ignore-aarch64-unknown-linux-gnu",
749749
"ignore-android",
750+
"ignore-apple",
750751
"ignore-arm",
751752
"ignore-avr",
752753
"ignore-beta",
@@ -829,7 +830,6 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
829830
"ignore-x32",
830831
"ignore-x86",
831832
"ignore-x86_64",
832-
"ignore-x86_64-apple-darwin",
833833
"ignore-x86_64-unknown-linux-gnu",
834834
"incremental",
835835
"known-bug",
@@ -876,6 +876,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
876876
"only-32bit",
877877
"only-64bit",
878878
"only-aarch64",
879+
"only-apple",
879880
"only-arm",
880881
"only-avr",
881882
"only-beta",

src/tools/compiletest/src/header/cfg.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ pub(super) fn parse_cfg_name_directive<'a>(
159159
message: "when the architecture is part of the Thumb family"
160160
}
161161

162+
condition! {
163+
name: "apple",
164+
condition: config.target.contains("apple"),
165+
message: "when the target vendor is Apple"
166+
}
167+
162168
// Technically the locally built compiler uses the "dev" channel rather than the "nightly"
163169
// channel, even though most people don't know or won't care about it. To avoid confusion, we
164170
// treat the "dev" channel as the "nightly" channel when processing the directive.

src/tools/compiletest/src/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn get_lib_name(lib: &str, aux_type: AuxType) -> Option<String> {
9898
AuxType::Lib => Some(format!("lib{}.rlib", lib)),
9999
AuxType::Dylib => Some(if cfg!(windows) {
100100
format!("{}.dll", lib)
101-
} else if cfg!(target_os = "macos") {
101+
} else if cfg!(target_vendor = "apple") {
102102
format!("lib{}.dylib", lib)
103103
} else {
104104
format!("lib{}.so", lib)

src/tools/compiletest/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl PathBufExt for PathBuf {
5757
pub fn dylib_env_var() -> &'static str {
5858
if cfg!(windows) {
5959
"PATH"
60-
} else if cfg!(target_os = "macos") {
60+
} else if cfg!(target_vendor = "apple") {
6161
"DYLD_LIBRARY_PATH"
6262
} else if cfg!(target_os = "haiku") {
6363
"LIBRARY_PATH"

src/tools/tidy/src/issues.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,6 @@ ui/issues/issue-33687.rs
21222122
ui/issues/issue-33770.rs
21232123
ui/issues/issue-3389.rs
21242124
ui/issues/issue-33941.rs
2125-
ui/issues/issue-33992.rs
21262125
ui/issues/issue-34047.rs
21272126
ui/issues/issue-34074.rs
21282127
ui/issues/issue-34209.rs

src/tools/tidy/src/ui_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::path::{Path, PathBuf};
1515
const ENTRY_LIMIT: u32 = 900;
1616
// FIXME: The following limits should be reduced eventually.
1717

18-
const ISSUES_ENTRY_LIMIT: u32 = 1676;
18+
const ISSUES_ENTRY_LIMIT: u32 = 1674;
1919

2020
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2121
"rs", // test source files

tests/assembly/stack-protector/stack-protector-heuristics-effect.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ revisions: all strong basic none missing
22
//@ assembly-output: emit-asm
3-
//@ ignore-macos slightly different policy on stack protection of arrays
3+
//@ ignore-apple slightly different policy on stack protection of arrays
44
//@ ignore-msvc stack check code uses different function names
55
//@ ignore-nvptx64 stack protector is not supported
66
//@ ignore-wasm32-bare
@@ -17,12 +17,9 @@
1717
// See comments on https://github.com/rust-lang/rust/issues/114903.
1818

1919
#![crate_type = "lib"]
20-
2120
#![allow(incomplete_features)]
22-
2321
#![feature(unsized_locals, unsized_fn_params)]
2422

25-
2623
// CHECK-LABEL: emptyfn:
2724
#[no_mangle]
2825
pub fn emptyfn() {

0 commit comments

Comments
 (0)