Skip to content

Commit

Permalink
Add CI for testing x86_64-pc-windows-gnu (#386)
Browse files Browse the repository at this point in the history
* Add CI for testing x86_64-pc-windows-gnu

* Fix GH job condition
  • Loading branch information
justsmth authored Apr 16, 2024
1 parent 7c9b0db commit c487b7b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,20 @@ jobs:
target: x86_64-apple-ios
- name: Build for `x86_64-apple-ios`
run: cargo build -p aws-lc-rs --target x86_64-apple-ios --features bindgen

aws-lc-rs-windows-mingw:
if: github.repository_owner == 'aws'
name: x86_64-pc-windows-gnu
runs-on: windows-latest
steps:
- uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: stable
target: x86_64-pc-windows-gnu
- name: Test on `x86_64-pc-windows-gnu`
run: cargo test -p aws-lc-rs --target x86_64-pc-windows-gnu --features bindgen
8 changes: 8 additions & 0 deletions aws-lc-fips-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ fn test_ninja_command() -> bool {
|| test_command("ninja-build".as_ref(), &["--version".as_ref()]).status
}

fn test_nasm_command() -> bool {
test_command("nasm".as_ref(), &["-version".as_ref()]).status
}

fn find_cmake_command() -> Option<&'static OsStr> {
if test_command("cmake3".as_ref(), &["--version".as_ref()]).status {
Some("cmake3".as_ref())
Expand Down Expand Up @@ -195,6 +199,10 @@ impl crate::Builder for CmakeBuilder {
eprintln!("Missing dependency: perl is required for FIPS.");
missing_dependency = true;
}
if target_os() == "windows" && target_arch() == "x86_64" && !test_nasm_command() {
eprintln!("Missing dependency: nasm is required for FIPS.");
missing_dependency = true;
}
if let Some(cmake_cmd) = find_cmake_command() {
env::set_var("CMAKE", cmake_cmd);
} else {
Expand Down
8 changes: 8 additions & 0 deletions aws-lc-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ pub(crate) struct CmakeBuilder {
output_lib_type: OutputLibType,
}

fn test_nasm_command() -> bool {
test_command("nasm".as_ref(), &["-version".as_ref()]).status
}

fn find_cmake_command() -> Option<&'static OsStr> {
if test_command("cmake3".as_ref(), &["--version".as_ref()]).status {
Some("cmake3".as_ref())
Expand Down Expand Up @@ -149,6 +153,10 @@ impl crate::Builder for CmakeBuilder {
eprintln!("Missing dependency: cmake");
missing_dependency = true;
};
if target_os() == "windows" && target_arch() == "x86_64" && !test_nasm_command() {
eprintln!("Missing dependency: nasm");
missing_dependency = true;
}

if missing_dependency {
return Err("Required build dependency is missing. Halting build.".to_owned());
Expand Down

0 comments on commit c487b7b

Please sign in to comment.