Skip to content

Commit

Permalink
gha: test cross-compilation to other arches
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
  • Loading branch information
cyphar committed Oct 17, 2024
1 parent eb2fbcd commit 8421d66
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,40 @@ jobs:
toolchain: ${{ env.RUST_MSRV }}
- run: cargo check --workspace --all-features --all-targets

check-cross:
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- arm-unknown-linux-gnueabi
- arm-unknown-linux-gnueabihf
- armv7-unknown-linux-gnueabihf
- i686-unknown-linux-gnu
- loongarch64-unknown-linux-gnu
- loongarch64-unknown-linux-musl
- powerpc-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- sparc64-unknown-linux-gnu
- s390x-unknown-linux-gnu
name: cargo check (${{ matrix.target }})
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
# TODO: Should we use MSRV for this?
targets: ${{ matrix.target }}
- name: cargo check --target=${{ matrix.target }}
run: >-
cargo check --target=${{ matrix.target }} --workspace --all-features --all-targets
- name: cargo build --target=${{ matrix.target }}
run: >-
cargo build --target=${{ matrix.target }} --release --all-features
rustdoc:
name: cargo doc
runs-on: ubuntu-latest
Expand Down Expand Up @@ -132,6 +166,7 @@ jobs:
needs:
- check
- check-msrv
- check-cross
- rustdoc
- test
- examples
Expand All @@ -155,6 +190,7 @@ jobs:
needs:
- check
- check-msrv
- check-cross
- rustdoc
- test
- examples
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- python bindings: add `Root.creat_raw` to create a new file and wrap it in a
raw `WrappedFd` (os opposed to `Root.creat` which returns an `os.fdopen`).

### Fixes ###
- multiarch: we now build correctly on 32-bit architectures as well as
architectures that have unsigned char. We also have CI jobs that verify that
builds work on a fairly large number of architectures (all relevant tier-1
and tier-2-with-host-tools architectures). If there is an architecture you
would like us to add to the build matrix and it is well-supported by `rustc`,
feel free to open an issue or PR!

### Changed ###
- syscalls: switch to rustix for most of our syscall wrappers to simplify how
much code we have for wrapper raw syscalls. This also lets us build on
Expand Down

0 comments on commit 8421d66

Please sign in to comment.