Skip to content

Commit bf53fa6

Browse files
authored
Expand raw-dylib testing (#3287)
1 parent 4442770 commit bf53fa6

File tree

8 files changed

+388
-56
lines changed

8 files changed

+388
-56
lines changed

.github/workflows/raw-dylib.yml

Lines changed: 360 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/raw_dylib.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

crates/samples/components/json_validator_client/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn main() {
44
}
55

66
println!("cargo:rerun-if-changed=src/client.cpp");
7-
println!("cargo:rustc-link-lib=windows.0.52.0");
7+
println!("cargo:rustc-link-lib=onecoreuap");
88

99
cc::Build::new()
1010
.cpp(true)

crates/samples/components/json_validator_winrt_client_cpp/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn main() {
44
}
55

66
println!("cargo:rerun-if-changed=src/client.cpp");
7-
println!("cargo:rustc-link-lib=windows.0.52.0");
7+
println!("cargo:rustc-link-lib=onecoreuap");
88

99
let include = std::env::var("OUT_DIR").unwrap();
1010

crates/tests/winrt/composable_client/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ fn main() {
44
}
55

66
println!("cargo:rerun-if-changed=src/interop.cpp");
7+
println!("cargo:rustc-link-lib=onecoreuap");
78

89
windows_bindgen::bindgen([
910
"--in",

crates/tests/winrt/constructors_client/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ fn main() {
44
}
55

66
println!("cargo:rerun-if-changed=src/interop.cpp");
7+
println!("cargo:rustc-link-lib=onecoreuap");
78

89
windows_bindgen::bindgen([
910
"--in",

crates/tests/winrt/noexcept/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn main() {
77
let metadata_dir = format!("{}\\System32\\WinMetadata", env!("windir"));
88
let mut command = std::process::Command::new("midlrt.exe");
99
println!("cargo:rerun-if-changed=src/interop.cpp");
10-
println!("cargo:rustc-link-lib=windows.0.52.0");
10+
println!("cargo:rustc-link-lib=onecoreuap");
1111

1212
command.args([
1313
"/winrt",

crates/tools/yml/src/main.rs

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
use std::fmt::Write;
22

33
fn main() {
4-
test_yml();
4+
test_yml("test", false);
5+
test_yml("raw-dylib", true);
56
clippy_yml();
67
no_default_features_yml();
78
}
89

9-
fn test_yml() {
10-
let mut yml = r"name: test
10+
fn test_yml(name: &str, raw_dylib: bool) {
11+
let mut yml = format!(
12+
r"name: {name}
1113
1214
on:
1315
pull_request:
@@ -17,7 +19,21 @@ on:
1719
- 'web/**'
1820
branches:
1921
- master
22+
"
23+
);
2024

25+
if raw_dylib {
26+
write!(
27+
&mut yml,
28+
r"
29+
env:
30+
RUSTFLAGS: --cfg windows_raw_dylib
31+
"
32+
)
33+
.unwrap();
34+
}
35+
36+
write!(&mut yml, r"
2137
jobs:
2238
check:
2339
runs-on: windows-2022
@@ -54,14 +70,14 @@ jobs:
5470
- name: Checkout
5571
uses: actions/checkout@v4
5672
- name: Update toolchain
57-
run: rustup update --no-self-update ${{ matrix.version }} && rustup default ${{ matrix.version }}-${{ matrix.host }}
73+
run: rustup update --no-self-update ${{{{ matrix.version }}}} && rustup default ${{{{ matrix.version }}}}-${{{{ matrix.host }}}}
5874
- name: Add toolchain target
59-
run: rustup target add ${{ matrix.target }}
75+
run: rustup target add ${{{{ matrix.target }}}}
6076
- name: Install fmt
6177
run: rustup component add rustfmt
6278
- name: Fix environment
6379
uses: ./.github/actions/fix-environment"
64-
.to_string();
80+
).unwrap();
6581

6682
// This unrolling is required since "cargo test --all" consumes too much memory for the GitHub hosted runners
6783
// and the occasional "cargo clean" is required to avoid running out of disk space in the same runners.
@@ -98,7 +114,7 @@ jobs:
98114
)
99115
.unwrap();
100116

101-
std::fs::write(".github/workflows/test.yml", yml.as_bytes()).unwrap();
117+
std::fs::write(format!(".github/workflows/{name}.yml"), yml.as_bytes()).unwrap();
102118
}
103119

104120
fn clippy_yml() {

0 commit comments

Comments
 (0)