diff --git a/.github/workflows/cross.yml b/.github/workflows/cross.yml index 05d5a5beb1f..62ae1c6eb89 100644 --- a/.github/workflows/cross.yml +++ b/.github/workflows/cross.yml @@ -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 diff --git a/aws-lc-fips-sys/builder/cmake_builder.rs b/aws-lc-fips-sys/builder/cmake_builder.rs index fc6207f6a77..8d155008ff4 100644 --- a/aws-lc-fips-sys/builder/cmake_builder.rs +++ b/aws-lc-fips-sys/builder/cmake_builder.rs @@ -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()) @@ -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 { diff --git a/aws-lc-sys/builder/cmake_builder.rs b/aws-lc-sys/builder/cmake_builder.rs index 60874c8ad00..665e78283d9 100644 --- a/aws-lc-sys/builder/cmake_builder.rs +++ b/aws-lc-sys/builder/cmake_builder.rs @@ -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()) @@ -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());