From 6b403d1f856d382868901056ec043ec2a1211389 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Thu, 5 Dec 2024 09:24:42 -0500 Subject: [PATCH 1/3] Fix i686-pc-windows-gnu exernal bindgen --- aws-lc-sys/builder/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aws-lc-sys/builder/main.rs b/aws-lc-sys/builder/main.rs index 5e8279bd531..094b1fed615 100644 --- a/aws-lc-sys/builder/main.rs +++ b/aws-lc-sys/builder/main.rs @@ -760,7 +760,9 @@ fn invoke_external_bindgen( let sym_prefix: String; let mut bindgen_params = vec![]; if let Some(prefix_str) = prefix { - sym_prefix = if target_os().to_lowercase() == "macos" || target_os().to_lowercase() == "ios" + sym_prefix = if target_os().to_lowercase() == "macos" + || target_os().to_lowercase() == "ios" + || (target_os().to_lowercase() == "windows" && target_arch() == "x86") { format!("_{prefix_str}_") } else { From 660a7c1302dcf36fea2fe7af14a463892d108e67 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Thu, 5 Dec 2024 09:54:40 -0500 Subject: [PATCH 2/3] Test more external bindgen Windows targets --- .github/workflows/tests.yml | 39 +++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4d6ac440c00..cef8909b7c5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -267,21 +267,19 @@ jobs: build-env-external-bindgen-test: if: github.repository_owner == 'aws' - name: aws-lc-rs FIPS - External bindgen test + name: aws-lc-rs - External bindgen test (${{ matrix.os }}) runs-on: ${{ matrix.os }} env: AWS_LC_SYS_EXTERNAL_BINDGEN: 1 strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-13, macos-14-xlarge, windows-latest ] + os: [ ubuntu-latest, macos-13, macos-14-xlarge ] steps: - uses: actions/checkout@v4 with: submodules: 'recursive' - uses: dtolnay/rust-toolchain@stable - - if: ${{ matrix.os == 'windows-latest' }} - uses: ilammy/setup-nasm@v1 - name: Install bindgen-cli run: cargo install --locked bindgen-cli - name: Remove bindings @@ -291,6 +289,39 @@ jobs: - name: Run cargo test run: cargo test --tests -p aws-lc-rs --no-default-features --features aws-lc-sys + build-env-external-bindgen-windows-test: + if: github.repository_owner == 'aws' + name: aws-lc-rs - External bindgen test (${{ matrix.target }}) + runs-on: windows-latest + env: + AWS_LC_SYS_EXTERNAL_BINDGEN: 1 + strategy: + fail-fast: false + matrix: + target: [ 'i686-pc-windows-gnu', 'i686-pc-windows-msvc', 'x86_64-pc-windows-msvc', 'x86_64-pc-windows-gnu' ] + steps: + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + - uses: dtolnay/rust-toolchain@stable + with: + target: ${{ matrix.target }} + - uses: ilammy/setup-nasm@v1 + - name: Install bindgen-cli + run: cargo install --locked bindgen-cli + - name: Remove bindings + run: | + rm ./aws-lc-sys/src/x86_64* + rm ./aws-lc-sys/src/aarch64* + rm ./aws-lc-sys/src/i686* + - if: ${{ matrix.target == 'i686-pc-windows-gnu' }} + name: Install mingw + uses: bwoodsend/setup-winlibs-action@v1 + with: + architecture: i686 + - name: Run cargo test + run: cargo test --tests -p aws-lc-rs --no-default-features --features aws-lc-sys --target ${{ matrix.target }} + build-env-fips-static-test: if: github.repository_owner == 'aws' name: aws-lc-rs build-env-fips-static-test From c034102d063842e471c511e0c709bfd30bc62479 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Thu, 5 Dec 2024 10:16:52 -0500 Subject: [PATCH 3/3] Fix internal bindgen test for i686-pc-windows-gnu --- .github/workflows/cross.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cross.yml b/.github/workflows/cross.yml index c6cd7d112b1..e3c3b1c3aa6 100644 --- a/.github/workflows/cross.yml +++ b/.github/workflows/cross.yml @@ -183,9 +183,7 @@ jobs: matrix: target: - 'x86_64-pc-windows-gnu' - # TODO: Fails in GitHub CI. Appears to be related to bindgen. - # .../base.h:61:10: fatal error: 'stdlib.h' file not found - # - 'i686-pc-windows-gnu' + - 'i686-pc-windows-gnu' steps: - uses: ilammy/setup-nasm@v1 - uses: actions/checkout@v4 @@ -196,6 +194,11 @@ jobs: with: toolchain: stable target: ${{ matrix.target }} + - if: ${{ matrix.target == 'i686-pc-windows-gnu' }} + name: Install mingw + uses: bwoodsend/setup-winlibs-action@v1 + with: + architecture: i686 - name: Debug Test on `${{ matrix.target }}` run: cargo test -p aws-lc-rs --target ${{ matrix.target }} --features bindgen - name: Release test on `${{ matrix.target }}`