Skip to content

Commit d2484a4

Browse files
committed
[TRY] Use windows-11-arm for the aarch64-pc-windows-msvc target
- Edit `macro_trailing_commas` to enable tests in all architectures
1 parent 8e04d6c commit d2484a4

File tree

2 files changed

+59
-25
lines changed

2 files changed

+59
-25
lines changed

.github/workflows/main.yml

+12-7
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
- tuple: i686-pc-windows-msvc
115115
os: windows-2025
116116
- tuple: aarch64-pc-windows-msvc
117-
os: windows-2025
117+
os: windows-11-arm
118118
- tuple: x86_64-pc-windows-gnu
119119
os: windows-2025
120120
# - tuple: i686-pc-windows-gnu
@@ -192,10 +192,6 @@ jobs:
192192
tuple: aarch64-apple-ios-macabi
193193
os: macos-15
194194
norun: true # https://github.com/rust-lang/stdarch/issues/1206
195-
- target:
196-
tuple: aarch64-pc-windows-msvc
197-
os: windows-2025
198-
norun: true
199195

200196
steps:
201197
- uses: actions/checkout@v4
@@ -204,15 +200,24 @@ jobs:
204200
run: |
205201
rustup update nightly --no-self-update
206202
rustup default nightly
203+
shell: bash
204+
if: matrix.target.os != 'windows-11-arm'
205+
- name: Install Rust for `windows-11-arm` runners
206+
run: |
207+
curl https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
208+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
209+
shell: bash
210+
if: matrix.target.os == 'windows-11-arm'
211+
207212
- run: rustup target add ${{ matrix.target.tuple }}
213+
shell: bash
208214
if: matrix.build_std == ''
209215
- run: |
210216
rustup component add rust-src
211217
echo "CARGO_UNSTABLE_BUILD_STD=std" >> $GITHUB_ENV
218+
shell: bash
212219
if: matrix.build_std != ''
213220
214-
- run: cargo generate-lockfile
215-
216221
# Configure some env vars based on matrix configuration
217222
- run: echo "PROFILE=--profile=${{matrix.profile}}" >> $GITHUB_ENV
218223
shell: bash

crates/std_detect/tests/macro_trailing_commas.rs

+47-18
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,30 @@
99
target_arch = "powerpc",
1010
target_arch = "powerpc64",
1111
target_arch = "s390x",
12+
target_arch = "riscv32",
13+
target_arch = "riscv64",
14+
target_arch = "loongarch64"
1215
),
1316
feature(stdarch_internal)
1417
)]
1518
#![cfg_attr(target_arch = "arm", feature(stdarch_arm_feature_detection))]
16-
#![cfg_attr(target_arch = "aarch64", feature(stdarch_aarch64_feature_detection))]
17-
#![cfg_attr(target_arch = "powerpc", feature(stdarch_powerpc_feature_detection))]
18-
#![cfg_attr(target_arch = "powerpc64", feature(stdarch_powerpc_feature_detection))]
19+
#![cfg_attr(
20+
any(target_arch = "aarch64", target_arch = "arm64ec"),
21+
feature(stdarch_aarch64_feature_detection)
22+
)]
23+
#![cfg_attr(
24+
any(target_arch = "powerpc", target_arch = "powerpc64"),
25+
feature(stdarch_powerpc_feature_detection)
26+
)]
1927
#![cfg_attr(target_arch = "s390x", feature(stdarch_s390x_feature_detection))]
20-
#![allow(clippy::unwrap_used, clippy::use_debug, clippy::print_stdout)]
28+
#![cfg_attr(
29+
any(target_arch = "riscv32", target_arch = "riscv64"),
30+
feature(stdarch_riscv_feature_detection)
31+
)]
32+
#![cfg_attr(
33+
target_arch = "loongarch64",
34+
feature(stdarch_loongarch_feature_detection)
35+
)]
2136

2237
#[cfg(any(
2338
target_arch = "arm",
@@ -28,51 +43,65 @@
2843
target_arch = "powerpc",
2944
target_arch = "powerpc64",
3045
target_arch = "s390x",
46+
target_arch = "riscv32",
47+
target_arch = "riscv64",
48+
target_arch = "loongarch64"
3149
))]
3250
#[macro_use]
3351
extern crate std_detect;
3452

3553
#[test]
36-
#[cfg(all(target_arch = "arm", any(target_os = "linux", target_os = "android")))]
37-
fn arm_linux() {
54+
#[cfg(target_arch = "arm")]
55+
fn arm() {
3856
let _ = is_arm_feature_detected!("neon");
3957
let _ = is_arm_feature_detected!("neon",);
4058
}
4159

4260
#[test]
43-
#[cfg(all(
44-
target_arch = "aarch64",
45-
any(target_os = "linux", target_os = "android")
46-
))]
47-
fn aarch64_linux() {
61+
#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
62+
fn aarch64() {
4863
let _ = is_aarch64_feature_detected!("fp");
4964
let _ = is_aarch64_feature_detected!("fp",);
5065
}
5166

5267
#[test]
53-
#[cfg(all(target_arch = "powerpc", target_os = "linux"))]
54-
fn powerpc_linux() {
68+
#[cfg(target_arch = "loongarch64")]
69+
fn loongarch64() {
70+
let _ = is_loongarch_feature_detected!("lsx");
71+
let _ = is_loongarch_feature_detected!("lsx",);
72+
}
73+
74+
#[test]
75+
#[cfg(target_arch = "powerpc")]
76+
fn powerpc() {
5577
let _ = is_powerpc_feature_detected!("altivec");
5678
let _ = is_powerpc_feature_detected!("altivec",);
5779
}
5880

5981
#[test]
60-
#[cfg(all(target_arch = "powerpc64", target_os = "linux"))]
61-
fn powerpc64_linux() {
82+
#[cfg(target_arch = "powerpc64")]
83+
fn powerpc64() {
6284
let _ = is_powerpc64_feature_detected!("altivec");
6385
let _ = is_powerpc64_feature_detected!("altivec",);
6486
}
6587

6688
#[test]
67-
#[cfg(all(target_arch = "s390x", target_os = "linux"))]
68-
fn s390x_linux() {
89+
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
90+
fn riscv() {
91+
let _ = is_riscv_feature_detected!("zk");
92+
let _ = is_riscv_feature_detected!("zk",);
93+
}
94+
95+
#[test]
96+
#[cfg(target_arch = "s390x")]
97+
fn s390x() {
6998
let _ = is_s390x_feature_detected!("vector");
7099
let _ = is_s390x_feature_detected!("vector",);
71100
}
72101

73102
#[test]
74103
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
75-
fn x86_all() {
104+
fn x86() {
76105
let _ = is_x86_feature_detected!("sse");
77106
let _ = is_x86_feature_detected!("sse",);
78107
}

0 commit comments

Comments
 (0)