Skip to content

Commit

Permalink
Use QEMU to test CPUs without AES-NI.
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed Jun 19, 2024
1 parent 94f198e commit 13ddf5c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,14 @@ jobs:
- target: i686-unknown-linux-gnu
host_os: ubuntu-22.04

- target: i686-unknown-linux-gnu
host_os: ubuntu-22.04
cpu_model: Conroe-v1

- target: x86_64-unknown-linux-gnu
host_os: ubuntu-22.04
cpu_model: Conroe-v1

- target: powerpc-unknown-linux-gnu
host_os: ubuntu-22.04

Expand Down Expand Up @@ -638,7 +646,7 @@ jobs:

- if: ${{ !contains(matrix.host_os, 'windows') }}
run: |
RING_COVERAGE=1 mk/cargo.sh +${{ matrix.rust_channel }} test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
RING_CPU_MODEL=${{ matrix.cpu_model }} RING_COVERAGE=1 mk/cargo.sh +${{ matrix.rust_channel }} test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
- uses: briansmith/codecov-codecov-action@v4
with:
Expand Down
10 changes: 10 additions & 0 deletions mk/cargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ qemu_powerpc64le="qemu-ppc64le -L /usr/powerpc64le-linux-gnu"
qemu_riscv64="qemu-riscv64 -L /usr/riscv64-linux-gnu"
qemu_s390x="qemu-s390x -L /usr/s390x-linux-gnu"
qemu_sparc64="qemu-sparc64 -L /usr/sparc64-linux-gnu"
qemu_x86="qemu-i386"
qemu_x86_64="qemu-x86_64"

# Avoid putting the Android tools in `$PATH` because there are tools in this
# directory like `clang` that would conflict with the same-named tools that may
Expand Down Expand Up @@ -110,6 +112,9 @@ case $target in
i686-unknown-linux-gnu)
use_clang=1
export CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=clang-$llvm_version
if [ -n "${RING_CPU_MODEL-}" ]; then
export CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_RUNNER="$qemu_x86 -cpu ${RING_CPU_MODEL}"
fi
;;
i686-unknown-linux-musl)
use_clang=1
Expand Down Expand Up @@ -176,6 +181,11 @@ case $target in
export CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER=sparc64-linux-gnu-gcc
export CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="$qemu_sparc64"
;;
x86_64-unknown-linux-gnu)
if [ -n "${RING_CPU_MODEL-}" ]; then
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="$qemu_x86_64 -cpu ${RING_CPU_MODEL}"
fi
;;
x86_64-unknown-linux-musl)
use_clang=1
# XXX: Work around https://github.com/rust-lang/rust/issues/79555.
Expand Down

0 comments on commit 13ddf5c

Please sign in to comment.