diff --git a/.github/workflows/fips.yml b/.github/workflows/fips.yml index 48869c0b45f..e398d0c30db 100644 --- a/.github/workflows/fips.yml +++ b/.github/workflows/fips.yml @@ -58,7 +58,7 @@ jobs: fail-fast: false matrix: rust: [ stable ] - os: [ windows-2019, windows-2022 ] + os: [ windows-2019, windows-latest ] args: - --all-targets --features fips,unstable - --all-targets --features fips,bindgen,unstable diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index a09175e0577..f956b495c2c 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -57,3 +57,36 @@ jobs: working-directory: ./aws-lc-rs run: | ./scripts/run-rustls-integration.sh + + sys-crate-tests: + if: github.repository == 'aws/aws-lc-rs' + name: sys crate tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-12, macos-13-xlarge, windows-latest ] + features: [ aws-lc-sys, aws-lc-fips-sys ] + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - uses: dtolnay/rust-toolchain@stable + id: toolchain + - name: Set Rust toolchain override + run: rustup override set ${{ steps.toolchain.outputs.name }} + - name: Install NASM on Windows + if: runner.os == 'Windows' + uses: ilammy/setup-nasm@v1 + - name: Setup Go >=v1.18 + uses: actions/setup-go@v4 + with: + go-version: '>=1.18' + - name: Install ninja-build tool + uses: seanmiddleditch/gha-setup-ninja@v4 + - name: Run cargo test + working-directory: ./sys-testing + run: cargo test --features ${{ matrix.features }} --no-default-features + - name: Run cargo run + working-directory: ./sys-testing + run: cargo run --features ${{ matrix.features }} --no-default-features diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8fe825688d0..d203fa777fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,29 +14,6 @@ env: RUST_NIGHTLY_TOOLCHAIN: nightly jobs: - sys-crate-tests: - if: github.repository == 'aws/aws-lc-rs' - name: sys crate tests - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest, macos-12 ] - features: [ aws-lc-sys, aws-lc-fips-sys ] - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - uses: dtolnay/rust-toolchain@stable - id: toolchain - - name: Set Rust toolchain override - run: rustup override set ${{ steps.toolchain.outputs.name }} - - name: Run cargo test - working-directory: ./sys-testing - run: cargo test --features ${{ matrix.features }} --no-default-features - - name: Run cargo run - working-directory: ./sys-testing - run: cargo run --features ${{ matrix.features }} --no-default-features aws-lc-rs-test: if: github.repository == 'aws/aws-lc-rs' diff --git a/aws-lc-fips-sys/builder/cmake_builder.rs b/aws-lc-fips-sys/builder/cmake_builder.rs index 7363c44cd60..47b794c3f0d 100644 --- a/aws-lc-fips-sys/builder/cmake_builder.rs +++ b/aws-lc-fips-sys/builder/cmake_builder.rs @@ -162,8 +162,10 @@ impl CmakeBuilder { let script_path = self.manifest_dir.join("builder").join("printenv.bat"); let result = test_command(script_path.as_os_str(), &[]); if !result.status { + eprintln!("{}", result.output); return Err("Failed to run vccarsall.bat.".to_owned()); } + eprintln!("{}", result.output); let lines = result.output.lines(); for line in lines { if let Some((var, val)) = line.split_once('=') { diff --git a/aws-lc-fips-sys/builder/printenv.bat b/aws-lc-fips-sys/builder/printenv.bat index 2060f5c4699..424b1c95297 100644 --- a/aws-lc-fips-sys/builder/printenv.bat +++ b/aws-lc-fips-sys/builder/printenv.bat @@ -1,7 +1,44 @@ @echo off +setlocal EnableDelayedExpansion + +set "TOP_DIR=%ProgramFiles(x86)%\Microsoft Visual Studio" for /f "usebackq tokens=* delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do ( - set "VS_PATH=%%i" + set "TOP_DIR=%%i" + echo VS Installation: "!TOP_DIR!" + if exist "!TOP_DIR!\VC\Auxiliary\Build\vcvarsall.bat" ( + set "VS_PATH=!TOP_DIR!\VC\Auxiliary\Build\" + echo FOUND in Installation: "!VS_PATH!" + goto FoundVS + ) + goto SearchVS +) + +echo Visual Studio installation not found using vswhere. Searching in default directories... + +:SearchVS +for /R "%TOP_DIR%" %%a in (vcvarsall.bat) do ( + if exist "%%~fa" ( + set "VS_PATH=%%~dpa" + echo FOUND: "!VS_PATH!" + goto FoundVS + ) ) -call "%VS_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 +echo vcvarsall.bat not found. +goto End + +:FoundVS +call "!VS_PATH!vcvarsall.bat" x64 +if !ERRORLEVEL! neq 0 ( + echo Failed to set Visual Studio environment variables. + echo PATH: "!VS_PATH!vcvarsall.bat" + goto End +) +echo Visual Studio environment variables set for x64. + +set +endlocal +exit /b 0 -set \ No newline at end of file +:End +endlocal +exit /b 1