Skip to content
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

Fix i686-pc-windows-gnu external bindgen #621

Merged
merged 3 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}`
Expand Down
39 changes: 35 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion aws-lc-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading