Skip to content

Commit 731456f

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 201d2a1 commit 731456f

File tree

2 files changed

+43
-21
lines changed

2 files changed

+43
-21
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 7 deletions
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

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
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
)]
@@ -28,51 +31,65 @@
2831
target_arch = "powerpc",
2932
target_arch = "powerpc64",
3033
target_arch = "s390x",
34+
target_arch = "riscv32",
35+
target_arch = "riscv64",
36+
target_arch = "loongarch64"
3137
))]
3238
#[macro_use]
3339
extern crate std_detect;
3440

3541
#[test]
36-
#[cfg(all(target_arch = "arm", any(target_os = "linux", target_os = "android")))]
37-
fn arm_linux() {
42+
#[cfg(target_arch = "arm")]
43+
fn arm() {
3844
let _ = is_arm_feature_detected!("neon");
3945
let _ = is_arm_feature_detected!("neon",);
4046
}
4147

4248
#[test]
43-
#[cfg(all(
44-
target_arch = "aarch64",
45-
any(target_os = "linux", target_os = "android")
46-
))]
47-
fn aarch64_linux() {
49+
#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
50+
fn aarch64() {
4851
let _ = is_aarch64_feature_detected!("fp");
4952
let _ = is_aarch64_feature_detected!("fp",);
5053
}
5154

5255
#[test]
53-
#[cfg(all(target_arch = "powerpc", target_os = "linux"))]
54-
fn powerpc_linux() {
56+
#[cfg(target_arch = "loongarch64")]
57+
fn loongarch64() {
58+
let _ = is_loongarch_feature_detected!("lsx");
59+
let _ = is_loongarch_feature_detected!("lsx",);
60+
}
61+
62+
#[test]
63+
#[cfg(target_arch = "powerpc")]
64+
fn powerpc() {
5565
let _ = is_powerpc_feature_detected!("altivec");
5666
let _ = is_powerpc_feature_detected!("altivec",);
5767
}
5868

5969
#[test]
60-
#[cfg(all(target_arch = "powerpc64", target_os = "linux"))]
61-
fn powerpc64_linux() {
70+
#[cfg(target_arch = "powerpc64")]
71+
fn powerpc64() {
6272
let _ = is_powerpc64_feature_detected!("altivec");
6373
let _ = is_powerpc64_feature_detected!("altivec",);
6474
}
6575

6676
#[test]
67-
#[cfg(all(target_arch = "s390x", target_os = "linux"))]
68-
fn s390x_linux() {
77+
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
78+
fn riscv() {
79+
let _ = is_riscv_feature_detected!("zk");
80+
let _ = is_riscv_feature_detected!("zk",);
81+
}
82+
83+
#[test]
84+
#[cfg(target_arch = "s390x")]
85+
fn s390x() {
6986
let _ = is_s390x_feature_detected!("vector");
7087
let _ = is_s390x_feature_detected!("vector",);
7188
}
7289

7390
#[test]
7491
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
75-
fn x86_all() {
92+
fn x86() {
7693
let _ = is_x86_feature_detected!("sse");
7794
let _ = is_x86_feature_detected!("sse",);
7895
}

0 commit comments

Comments
 (0)