Skip to content

Commit e647065

Browse files
authored
chore: remove x86_64-apple-darwin from CI and tests (#15831)
### What does this PR try to resolve? RFC 3841 has merged, and x86_64-apple-darwin will be demoted to tier-2 in 1.90.0. In Cargo we usually run test against tier-1 platforms, so x86_64-apple-darwin should be removed. Also, that target platform is often the slowest one in CI, we are happy to remove it to save us a couple of minutes. https://rust-lang.github.io/rfcs/3841-demote-x86_64-apple-darwin.html ### How to test and review this PR? Run `cargo test` locally with cross-compile tests enabled, and no regression.
2 parents 1a12cb2 + 9614bc2 commit e647065

File tree

4 files changed

+4
-49
lines changed

4 files changed

+4
-49
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,6 @@ jobs:
143143
os: macos-14
144144
rust: stable
145145
other: x86_64-apple-darwin
146-
- name: macOS x86_64 nightly
147-
os: macos-13
148-
rust: nightly
149-
other: x86_64-apple-ios
150146
- name: macOS aarch64 nightly
151147
os: macos-14
152148
rust: nightly

crates/cargo-test-support/src/cross_compile.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ pub fn alternate() -> &'static str {
3838

3939
/// A possible alternate target-triple to build with.
4040
pub(crate) fn try_alternate() -> Option<&'static str> {
41-
if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
41+
if cfg!(target_os = "macos") {
4242
Some("x86_64-apple-darwin")
43-
} else if cfg!(target_os = "macos") {
44-
Some("x86_64-apple-ios")
4543
} else if cfg!(target_os = "linux") {
4644
Some("i686-unknown-linux-gnu")
4745
} else if cfg!(all(target_os = "windows", target_env = "msvc")) {

src/doc/contrib/src/tests/writing.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,6 @@ The name of the target can be fetched with the [`cross_compile::alternate()`]
132132
function. The name of the host target can be fetched with
133133
[`cargo_test_support::rustc_host()`].
134134

135-
The cross-tests need to distinguish between targets which can *build* versus
136-
those which can actually *run* the resulting executable. Unfortunately, macOS is
137-
currently unable to run an alternate target (Apple removed 32-bit support a
138-
long time ago). For building, `x86_64-apple-darwin` will target
139-
`x86_64-apple-ios` as its alternate. However, the iOS target can only execute
140-
binaries if the iOS simulator is installed and configured. The simulator is
141-
not available in CI, so all tests that need to run cross-compiled binaries are
142-
disabled on CI. If you are running on macOS locally, and have the simulator
143-
installed, then it should be able to run them.
144-
145135
If the test needs to run the cross-compiled binary, then it should have
146136
something like this to exit the test before doing so:
147137

tests/testsuite/utils/cross_compile.rs

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -124,28 +124,12 @@ pub fn disabled() -> bool {
124124
install the necessary libraries.
125125
",
126126
);
127-
} else if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
127+
} else if cfg!(target_os = "macos") {
128128
message.push_str(
129129
"
130130
macOS on aarch64 cross tests to target x86_64-apple-darwin.
131131
This should be natively supported via Xcode, nothing additional besides the
132132
rustup target should be needed.
133-
",
134-
);
135-
} else if cfg!(target_os = "macos") {
136-
message.push_str(
137-
"
138-
macOS on x86_64 cross tests to target x86_64-apple-ios, which requires the iOS
139-
SDK to be installed. This should be included with Xcode automatically. If you
140-
are using the Xcode command line tools, you'll need to install the full Xcode
141-
app (from the Apple App Store), and switch to it with this command:
142-
143-
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
144-
145-
Some cross-tests want to *run* the executables on the host. These tests will
146-
be ignored if this is not possible. On macOS, this means you need an iOS
147-
simulator installed to run these tests. To install a simulator, open Xcode, go
148-
to preferences > Components, and download the latest iOS simulator.
149133
",
150134
);
151135
} else if cfg!(target_os = "windows") {
@@ -202,19 +186,6 @@ pub fn can_run_on_host() -> bool {
202186
if disabled() {
203187
return false;
204188
}
205-
// macos is currently configured to cross compile to x86_64-apple-ios
206-
// which requires a simulator to run. Azure's CI image appears to have the
207-
// SDK installed, but are not configured to launch iOS images with a
208-
// simulator.
209-
if cfg!(target_os = "macos") {
210-
if CAN_RUN_ON_HOST.load(Ordering::SeqCst) {
211-
return true;
212-
} else {
213-
println!("Note: Cannot run on host, skipping.");
214-
return false;
215-
}
216-
} else {
217-
assert!(CAN_RUN_ON_HOST.load(Ordering::SeqCst));
218-
return true;
219-
}
189+
assert!(CAN_RUN_ON_HOST.load(Ordering::SeqCst));
190+
return true;
220191
}

0 commit comments

Comments
 (0)