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

Cross-compile using bindgen-cli #429

Merged
merged 1 commit into from
Jun 4, 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
26 changes: 13 additions & 13 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,21 @@ jobs:
matrix:
os: [ ubuntu-22.04 ]
target:
- arm-unknown-linux-gnueabihf
- aarch64-linux-android
- aarch64-unknown-linux-gnu
- i686-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- aarch64-unknown-linux-musl
- arm-linux-androideabi
- arm-unknown-linux-gnueabihf
- armv7-linux-androideabi
- aarch64-linux-android
- powerpc64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- i686-unknown-linux-gnu
- powerpc-unknown-linux-gnu
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- s390x-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -62,11 +63,10 @@ jobs:
run: |
cargo update
cargo update -p clap --precise 4.4.18
- name: Cross-compilation
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'i686-unknown-linux-gnu' || matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
run: cross test -p aws-lc-rs --features unstable --target ${{ matrix.target }}
- name: Cross-compilation w/ bindgen
run: cross test -p aws-lc-rs --release --features bindgen,unstable --target ${{ matrix.target }}
- name: Cross-compilation (build debug)
run: cross build -p aws-lc-rs --features unstable --target ${{ matrix.target }}
- name: Cross-compilation (test release)
run: cross test -p aws-lc-rs --release --features unstable --target ${{ matrix.target }}

aws-lc-rs-ios-aarch64:
if: github.repository_owner == 'aws'
Expand Down
15 changes: 13 additions & 2 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
[build]
dockerfile = "./docker/linux-cross/Dockerfile"
pre-build = [
"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable",
". $HOME/.cargo/env",
"cargo install --force --locked bindgen-cli && mv $HOME/.cargo/bin/bindgen /usr/bin",
"rm -rf $HOME/.cargo"
]


[target.x86_64-pc-windows-gnu]
pre-build = [
"apt-get update && apt-get install --assume-yes nasm clang wget",
"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable",
". $HOME/.cargo/env",
"cargo install --force --locked bindgen-cli && mv $HOME/.cargo/bin/bindgen /usr/bin",
"rm -rf $HOME/.cargo",
"apt-get update && apt-get install --assume-yes nasm wget",
"mkdir -pm755 /etc/apt/keyrings",
"wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources",
"apt install --assume-yes --install-recommends winehq-stable"
"apt install --assume-yes --install-recommends winehq-stable",
]

[build.env]
Expand Down
2 changes: 1 addition & 1 deletion docker/linux-cross/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apt-get update && \
apt-get install --assume-yes --no-install-recommends software-properties-common && \
add-apt-repository --yes ppa:longsleep/golang-backports && \
apt-get update && \
apt-get install --assume-yes --no-install-recommends build-essential cmake golang-go && \
apt-get install --assume-yes --no-install-recommends build-essential cmake golang-go clang && \
git config --global --add safe.directory '*' && \
rm -rf /tmp/*

Expand Down
Loading