Skip to content

Commit 0dab31a

Browse files
authored
Fix aarch64-pc-windows-msvc (#6868)
1 parent 991ee61 commit 0dab31a

File tree

14 files changed

+57
-14
lines changed

14 files changed

+57
-14
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ jobs:
8888
target: x86_64-pc-windows-msvc
8989
kind: native
9090

91+
# Windows
92+
- name: Windows aarch64
93+
os: windows-2022
94+
target: aarch64-pc-windows-msvc
95+
kind: native
96+
9197
# MacOS
9298
- name: MacOS x86_64
9399
os: macos-14

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

naga/fuzz/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = ["Automatically generated"]
55
publish = false
66
edition = "2018"
77
license = "MIT OR Apache-2.0"
8+
build = "build.rs"
89

910
[package.metadata]
1011
cargo-fuzz = true
@@ -19,6 +20,9 @@ path = ".."
1920
version = "23.0.0"
2021
features = ["arbitrary", "spv-in", "wgsl-in", "glsl-in"]
2122

23+
[build-dependencies]
24+
cfg_aliases.workspace = true
25+
2226
[[bin]]
2327
name = "spv_parser"
2428
path = "fuzz_targets/spv_parser.rs"

naga/fuzz/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
cfg_aliases::cfg_aliases! {
3+
enable_fuzzing: { not(any(target_arch = "wasm32", target_os = "ios", all(windows, target_arch = "aarch64"))) },
4+
}
5+
}

naga/fuzz/fuzz_targets/glsl_parser.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#![no_main]
2-
#[cfg(not(any(target_arch = "wasm32", target_os = "ios")))]
1+
#![cfg_attr(enable_fuzzing, no_main)]
2+
3+
#[cfg(enable_fuzzing)]
34
mod fuzz {
45
use arbitrary::Arbitrary;
56
use libfuzzer_sys::fuzz_target;
@@ -47,3 +48,6 @@ mod fuzz {
4748
let _result = parser.parse(&options.into(), &source);
4849
});
4950
}
51+
52+
#[cfg(not(enable_fuzzing))]
53+
fn main() {}

naga/fuzz/fuzz_targets/ir.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#![no_main]
2-
#[cfg(not(any(target_arch = "wasm32", target_os = "ios")))]
1+
#![cfg_attr(enable_fuzzing, no_main)]
2+
3+
#[cfg(enable_fuzzing)]
34
mod fuzz {
45
use libfuzzer_sys::fuzz_target;
56

@@ -12,3 +13,6 @@ mod fuzz {
1213
let _result = validator.validate(&module);
1314
});
1415
}
16+
17+
#[cfg(not(enable_fuzzing))]
18+
fn main() {}

naga/fuzz/fuzz_targets/spv_parser.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#![no_main]
2-
#[cfg(not(any(target_arch = "wasm32", target_os = "ios")))]
1+
#![cfg_attr(enable_fuzzing, no_main)]
2+
3+
#[cfg(enable_fuzzing)]
34
mod fuzz {
45
use libfuzzer_sys::fuzz_target;
56
use naga::front::spv::{Frontend, Options};
@@ -10,3 +11,6 @@ mod fuzz {
1011
let _result = Frontend::new(data.into_iter(), &options).parse();
1112
});
1213
}
14+
15+
#[cfg(not(enable_fuzzing))]
16+
fn main() {}

naga/fuzz/fuzz_targets/wgsl_parser.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#![no_main]
2-
#[cfg(not(any(target_arch = "wasm32", target_os = "ios")))]
1+
#![cfg_attr(enable_fuzzing, no_main)]
2+
3+
#[cfg(enable_fuzzing)]
34
mod fuzz {
45
use libfuzzer_sys::fuzz_target;
56
use naga::front::wgsl::Frontend;
@@ -9,3 +10,6 @@ mod fuzz {
910
let _result = Frontend::new().parse(&data);
1011
});
1112
}
13+
14+
#[cfg(not(enable_fuzzing))]
15+
fn main() {}

wgpu-hal/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,18 @@ windows = { workspace = true, optional = true }
165165
bit-set = { workspace = true, optional = true }
166166
range-alloc = { workspace = true, optional = true }
167167
gpu-allocator = { workspace = true, optional = true }
168-
mach-dxcompiler-rs = { workspace = true, optional = true }
169168
# For core macros. This crate is also reexported as windows::core.
170169
windows-core = { workspace = true, optional = true }
171170

172171
# backend: Gles
173172
glutin_wgl_sys = { workspace = true, optional = true }
174173

174+
# This doesn't support aarch64. See https://github.com/gfx-rs/wgpu/issues/6860.
175+
#
176+
# ⚠️ Keep in sync with static_dxc cfg in build.rs and cfg_alias in `wgpu` crate ⚠️
177+
[target.'cfg(all(windows, not(target_arch = "aarch64")))'.dependencies]
178+
mach-dxcompiler-rs = { workspace = true, optional = true }
179+
175180
[target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies]
176181
# backend: Metal
177182
block = { workspace = true, optional = true }

wgpu-hal/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ fn main() {
1010
dx12: { all(target_os = "windows", feature = "dx12") },
1111
gles: { all(feature = "gles") },
1212
metal: { all(any(target_os = "ios", target_os = "macos"), feature = "metal") },
13-
vulkan: { all(not(target_arch = "wasm32"), feature = "vulkan") }
13+
vulkan: { all(not(target_arch = "wasm32"), feature = "vulkan") },
14+
// ⚠️ Keep in sync with target.cfg() definition in Cargo.toml and cfg_alias in `wgpu` crate ⚠️
15+
static_dxc: { all(target_os = "windows", feature = "static-dxc", not(target_arch = "aarch64")) }
1416
}
1517
}

0 commit comments

Comments
 (0)