-
Notifications
You must be signed in to change notification settings - Fork 108
Add Windows CI #1284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add Windows CI #1284
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ba56e8f
Remove MSVC Check
afonso360 481484c
Windows MinGW & MSVC Matrix CI
afonso360 1878ca6
Disable JIT Tests for windows
afonso360 01d3e1a
Disable failing windows CI tests
afonso360 8072dec
Drop abi cafe patch
afonso360 738dd2b
Windows CI Cache
afonso360 cd8becb
Disable some ABI tests on MinGW
afonso360 e96badc
Disable some rand tests on MinGW
afonso360 a83ec3b
Ignore rand tests
afonso360 4edf145
Use target triple artifact names
afonso360 6909219
Prefix artifact names with `cg_clif`
afonso360 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,56 +122,87 @@ jobs: | |
name: cg_clif-${{ runner.os }}-cross-x86_64-mingw | ||
path: cg_clif.tar.xz | ||
|
||
build_windows: | ||
runs-on: windows-latest | ||
windows: | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 60 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# Native Windows build with MSVC | ||
- os: windows-latest | ||
# cross-compile from Windows to Windows MinGW | ||
- os: windows-latest | ||
env: | ||
TARGET_TRIPLE: x86_64-pc-windows-gnu | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
#- name: Cache cargo installed crates | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: ~/.cargo/bin | ||
# key: ${{ runner.os }}-cargo-installed-crates | ||
|
||
#- name: Cache cargo registry and index | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: | | ||
# ~/.cargo/registry | ||
# ~/.cargo/git | ||
# key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
#- name: Cache cargo target dir | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: target | ||
# key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }} | ||
- name: Cache cargo installed crates | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cargo/bin | ||
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-installed-crates | ||
|
||
- name: Cache cargo registry and index | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Cache cargo target dir | ||
uses: actions/cache@v2 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }} | ||
|
||
- name: Set MinGW as the default toolchain | ||
if: matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu' | ||
run: rustup set default-host x86_64-pc-windows-gnu | ||
|
||
- name: Prepare dependencies | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "User" | ||
git config --global core.autocrlf false | ||
rustup set default-host x86_64-pc-windows-gnu | ||
rustc y.rs -o y.exe -g | ||
./y.exe prepare | ||
|
||
- name: Build without unstable features | ||
env: | ||
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }} | ||
# This is the config rust-lang/rust uses for builds | ||
run: ./y.rs build --no-unstable-features | ||
|
||
- name: Build | ||
#name: Test | ||
run: ./y.rs build --sysroot none | ||
|
||
- name: Test | ||
run: | | ||
# Enable backtraces for easier debugging | ||
#$Env:RUST_BACKTRACE=1 | ||
$Env:RUST_BACKTRACE=1 | ||
|
||
# Reduce amount of benchmark runs as they are slow | ||
#$Env:COMPILE_RUNS=2 | ||
#$Env:RUN_RUNS=2 | ||
$Env:COMPILE_RUNS=2 | ||
$Env:RUN_RUNS=2 | ||
|
||
# Enable extra checks | ||
#$Env:CG_CLIF_ENABLE_VERIFIER=1 | ||
|
||
./y.exe build | ||
$Env:CG_CLIF_ENABLE_VERIFIER=1 | ||
|
||
# WIP Disable some tests | ||
|
||
# This fails due to some weird argument handling by hyperfine, not an actual regression | ||
# more of a build system issue | ||
(Get-Content config.txt) -replace '(bench.simple-raytracer)', '# $1' | Out-File config.txt | ||
|
||
# This fails with a different output than expected | ||
(Get-Content config.txt) -replace '(test.regex-shootout-regex-dna)', '# $1' | Out-File config.txt | ||
|
||
./y.exe test | ||
|
||
- name: Package prebuilt cg_clif | ||
# don't use compression as xzip isn't supported by tar on windows and bzip2 hangs | ||
|
@@ -180,5 +211,5 @@ jobs: | |
- name: Upload prebuilt cg_clif | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: cg_clif-${{ runner.os }} | ||
name: cg_clif-${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }} | ||
path: cg_clif.tar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
patches/0001-abi-cafe-Disable-some-test-on-x86_64-pc-windows-gnu.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From 2b15fee2bb5fd14e34c7e17e44d99cb34f4c555d Mon Sep 17 00:00:00 2001 | ||
From: Afonso Bordado <[email protected]> | ||
Date: Tue, 27 Sep 2022 07:55:17 +0100 | ||
Subject: [PATCH] Disable some test on x86_64-pc-windows-gnu | ||
|
||
--- | ||
src/report.rs | 6 ++++++ | ||
1 file changed, 6 insertions(+) | ||
|
||
diff --git a/src/report.rs b/src/report.rs | ||
index eeec614..f582867 100644 | ||
--- a/src/report.rs | ||
+++ b/src/report.rs | ||
@@ -48,6 +48,12 @@ pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl | ||
// | ||
// THIS AREA RESERVED FOR VENDORS TO APPLY PATCHES | ||
|
||
+ // x86_64-pc-windows-gnu has some broken i128 tests that aren't disabled by default | ||
+ if cfg!(all(target_os = "windows", target_env = "gnu")) && test.test_name == "ui128" { | ||
+ result.run = Link; | ||
+ result.check = Pass(Link); | ||
+ } | ||
+ | ||
// END OF VENDOR RESERVED AREA | ||
// | ||
// | ||
-- | ||
2.30.1.windows.1 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
From eea3bbaed34ab210868c324219a862a9d5f4681c Mon Sep 17 00:00:00 2001 | ||
From: Afonso Bordado <[email protected]> | ||
Date: Tue, 27 Sep 2022 08:13:58 +0100 | ||
Subject: [PATCH] Disable rand tests on mingw | ||
|
||
--- | ||
rand_distr/src/pareto.rs | 2 ++ | ||
rand_distr/tests/value_stability.rs | 4 ++++ | ||
2 files changed, 6 insertions(+) | ||
|
||
diff --git a/rand_distr/src/pareto.rs b/rand_distr/src/pareto.rs | ||
index 217899ed9a..5f8e2c9bbb 100644 | ||
--- a/rand_distr/src/pareto.rs | ||
+++ b/rand_distr/src/pareto.rs | ||
@@ -107,6 +107,8 @@ mod tests { | ||
} | ||
|
||
#[test] | ||
+ // This is broken on x86_64-pc-windows-gnu presumably due to a broken powf implementation | ||
+ #[cfg(not(all(target_os = "windows", target_env = "gnu")))] | ||
afonso360 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
fn value_stability() { | ||
fn test_samples<F: Float + core::fmt::Debug, D: Distribution<F>>( | ||
distr: D, zero: F, expected: &[F], | ||
diff --git a/rand_distr/tests/value_stability.rs b/rand_distr/tests/value_stability.rs | ||
index 192ba748b7..10c6ac24f6 100644 | ||
--- a/rand_distr/tests/value_stability.rs | ||
+++ b/rand_distr/tests/value_stability.rs | ||
@@ -72,6 +72,8 @@ fn unit_disc_stability() { | ||
} | ||
|
||
#[test] | ||
+// This is broken on x86_64-pc-windows-gnu | ||
+#[cfg(not(all(target_os = "windows", target_env = "gnu")))] | ||
fn pareto_stability() { | ||
test_samples(213, Pareto::new(1.0, 1.0).unwrap(), &[ | ||
1.0423688f32, 2.1235929, 4.132709, 1.4679428, | ||
@@ -143,6 +145,8 @@ fn inverse_gaussian_stability() { | ||
} | ||
|
||
#[test] | ||
+// This is broken on x86_64-pc-windows-gnu | ||
+#[cfg(not(all(target_os = "windows", target_env = "gnu")))] | ||
fn gamma_stability() { | ||
// Gamma has 3 cases: shape == 1, shape < 1, shape > 1 | ||
test_samples(223, Gamma::new(1.0, 5.0).unwrap(), &[ | ||
-- | ||
2.30.1.windows.1 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.