Backport patches to 0.35 #3443
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: ./.github/actions/install-rust | |
with: | |
toolchain: stable | |
- run: cargo fmt --all -- --check | |
check: | |
name: Check | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [stable, nightly, 1.48] | |
include: | |
- build: stable | |
os: ubuntu-latest | |
rust: stable | |
- build: nightly | |
os: ubuntu-latest | |
rust: nightly | |
- build: 1.48 | |
os: ubuntu-latest | |
rust: 1.48 | |
env: | |
# -D warnings is commented out in our install-rust action; re-add it here. | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: ./.github/actions/install-rust | |
with: | |
toolchain: ${{ matrix.rust }} | |
- run: > | |
rustup target add | |
x86_64-unknown-linux-musl | |
x86_64-unknown-linux-gnux32 | |
x86_64-linux-android | |
i686-linux-android | |
x86_64-apple-darwin | |
x86_64-unknown-freebsd | |
x86_64-unknown-netbsd | |
x86_64-unknown-illumos | |
i686-unknown-linux-gnu | |
i686-unknown-linux-musl | |
wasm32-unknown-emscripten | |
aarch64-unknown-linux-gnu | |
aarch64-unknown-linux-musl | |
powerpc64le-unknown-linux-gnu | |
armv5te-unknown-linux-gnueabi | |
s390x-unknown-linux-gnu | |
arm-linux-androideabi | |
sparc64-unknown-linux-gnu | |
sparcv9-sun-solaris | |
aarch64-linux-android | |
aarch64-apple-ios | |
- if: matrix.rust != '1.48' | |
run: rustup target add x86_64-unknown-fuchsia | |
- if: matrix.rust == '1.48' | |
run: rustup target add x86_64-fuchsia | |
- name: Install cross-compilation tools | |
run: | | |
set -ex | |
sudo apt-get update | |
sudo apt-get install -y gcc-i686-linux-gnu gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi musl-tools | |
- name: Use specific dependency versions for Rust 1.48 compatibility. | |
if: matrix.rust == '1.48' | |
run: | | |
cargo update --package=once_cell --precise 1.14.0 | |
cargo update --package=tempfile --precise=3.3.0 | |
- run: cargo check --workspace --release -vv | |
- run: cargo check --workspace --release -vv --features=all-apis | |
- run: cargo check --workspace --release -vv --features=use-libc,all-apis | |
- run: cargo check --workspace --release -vv --target=aarch64-linux-android | |
- run: cargo check --workspace --release -vv --target=x86_64-unknown-linux-musl --features=all-apis | |
- run: cargo check --workspace --release -vv --target=x86_64-unknown-linux-musl --features=use-libc,all-apis | |
- run: cargo check --workspace --release -vv --target=x86_64-unknown-linux-gnux32 --features=all-apis | |
- run: cargo check --workspace --release -vv --target=x86_64-linux-android --features=all-apis | |
- run: cargo check --workspace --release -vv --target=i686-linux-android --features=all-apis | |
- run: cargo check --workspace --release -vv --target=x86_64-apple-darwin --features=all-apis | |
- run: cargo check --workspace --release -vv --target=x86_64-unknown-freebsd --features=all-apis | |
- run: cargo check --workspace --release -vv --target=x86_64-unknown-netbsd --features=all-apis | |
- if: matrix.rust != '1.48' | |
run: cargo check --workspace --release -vv --target=x86_64-unknown-fuchsia --features=all-apis --all-targets | |
- if: matrix.rust == '1.48' | |
run: cargo check --workspace --release -vv --target=x86_64-fuchsia --features=all-apis --all-targets | |
- run: cargo check --workspace --release -vv --target=x86_64-unknown-illumos --features=all-apis | |
- run: cargo check --workspace --release -vv --target=i686-unknown-linux-gnu --features=all-apis | |
- run: cargo check --workspace --release -vv --target=i686-unknown-linux-musl --features=all-apis | |
- run: cargo check --workspace --release -vv --target=i686-unknown-linux-musl --features=use-libc,all-apis | |
- run: cargo check --workspace --release -vv --target=wasm32-unknown-emscripten --features=all-apis | |
- run: cargo check --workspace --release -vv --target=riscv64gc-unknown-linux-gnu --features=all-apis | |
- run: cargo check --workspace --release -vv --target=aarch64-unknown-linux-gnu --features=all-apis | |
- run: cargo check --workspace --release -vv --target=aarch64-unknown-linux-musl --features=all-apis | |
- run: cargo check --workspace --release -vv --target=aarch64-unknown-linux-musl --features=use-libc,all-apis | |
- run: cargo check --workspace --release -vv --target=powerpc64le-unknown-linux-gnu --features=all-apis | |
- run: cargo check --workspace --release -vv --target=armv5te-unknown-linux-gnueabi --features=all-apis | |
- run: cargo check --workspace --release -vv --target=s390x-unknown-linux-gnu --features=all-apis | |
- run: cargo check --workspace --release -vv --target=arm-linux-androideabi --features=all-apis | |
- run: cargo check --workspace --release -vv --target=sparc64-unknown-linux-gnu --features=all-apis | |
- run: cargo check --workspace --release -vv --target=sparcv9-sun-solaris --features=all-apis | |
- run: cargo check --workspace --release -vv --target=aarch64-apple-ios --features=all-apis | |
- run: cargo check --workspace --release -vv --target=aarch64-linux-android --features=all-apis | |
check_no_default_features: | |
name: Check --no-default-features | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [nightly] | |
include: | |
- build: nightly | |
os: ubuntu-latest | |
rust: nightly | |
env: | |
# -D warnings is commented out in our install-rust action; re-add it here. | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: ./.github/actions/install-rust | |
with: | |
toolchain: ${{ matrix.rust }} | |
- run: cargo check --workspace --release --no-default-features --features all-apis -vv | |
check_nightly: | |
name: Check nightly-only targets | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [nightly] | |
include: | |
- build: nightly | |
os: ubuntu-latest | |
rust: nightly | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: ./.github/actions/install-rust | |
with: | |
toolchain: ${{ matrix.rust }} | |
- run: > | |
rustup target add | |
x86_64-unknown-redox | |
wasm32-wasi | |
thumbv7neon-unknown-linux-gnueabihf | |
- run: cargo check --workspace --release -vv --target=x86_64-unknown-redox --features=all-apis | |
- run: cargo check --workspace --release -vv --target=wasm32-wasi --features=all-apis | |
- run: cargo check --workspace --release -vv --target=thumbv7neon-unknown-linux-gnueabihf --features=all-apis | |
check_tier3: | |
name: Check selected Tier 3 platforms | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [nightly] | |
include: | |
- build: nightly | |
os: ubuntu-latest | |
rust: nightly | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: ./.github/actions/install-rust | |
with: | |
toolchain: ${{ matrix.rust }} | |
env: | |
# See the comments in the libc crate | |
RUSTFLAGS: -A improper_ctypes_definitions | |
- run: rustup component add rust-src | |
- run: cargo check -Z build-std --target x86_64-unknown-openbsd --all-targets --features=all-apis | |
- run: cargo check -Z build-std --target mips64-openwrt-linux-musl --all-targets --features=all-apis | |
- run: cargo check -Z build-std --target x86_64-unknown-dragonfly --all-targets --features=all-apis | |
- run: cargo check -Z build-std --target sparc-unknown-linux-gnu --all-targets --features=all-apis | |
# Omit --all-targets on haiku because not all the tests build yet. | |
- run: cargo check -Z build-std --target x86_64-unknown-haiku --features=all-apis | |
# x86_64-uwp-windows-msvc isn't currently working. | |
#- run: cargo check -Z build-std --target x86_64-uwp-windows-msvc --all-targets --features=all-apis | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
env: | |
QEMU_BUILD_VERSION: 7.0.0 | |
strategy: | |
matrix: | |
build: [ubuntu, i686-linux, aarch64-linux, powerpc64le-linux, s390x-linux, arm-linux, ubuntu-stable, i686-linux-stable, aarch64-linux-stable, s390x-linux-stable, powerpc64le-linux-stable, arm-linux-stable, macos-latest, macos-10.15, windows, windows-2019] | |
include: | |
- build: ubuntu | |
os: ubuntu-latest | |
rust: nightly-2023-07-03 | |
- build: i686-linux | |
os: ubuntu-latest | |
rust: nightly-2023-07-03 | |
target: i686-unknown-linux-gnu | |
gcc_package: gcc-i686-linux-gnu | |
gcc: i686-linux-gnu-gcc | |
libc_package: libc-dev-i386-cross | |
- build: aarch64-linux | |
os: ubuntu-latest | |
rust: nightly-2023-07-03 | |
target: aarch64-unknown-linux-gnu | |
gcc_package: gcc-aarch64-linux-gnu | |
gcc: aarch64-linux-gnu-gcc | |
qemu: qemu-aarch64 | |
qemu_args: -L /usr/aarch64-linux-gnu | |
qemu_target: aarch64-linux-user | |
- build: powerpc64le-linux | |
os: ubuntu-latest | |
rust: nightly-2023-07-03 | |
target: powerpc64le-unknown-linux-gnu | |
gcc_package: gcc-powerpc64le-linux-gnu | |
gcc: powerpc64le-linux-gnu-gcc | |
qemu: qemu-ppc64le | |
qemu_args: -L /usr/powerpc64le-linux-gnu | |
qemu_target: ppc64le-linux-user | |
- build: s390x-linux | |
os: ubuntu-latest | |
rust: nightly-2023-07-03 | |
target: s390x-unknown-linux-gnu | |
gcc_package: gcc-s390x-linux-gnu | |
gcc: s390x-linux-gnu-gcc | |
qemu: qemu-s390x | |
qemu_args: -L /usr/s390x-linux-gnu | |
qemu_target: s390x-linux-user | |
- build: arm-linux | |
os: ubuntu-latest | |
rust: nightly-2023-07-03 | |
target: armv5te-unknown-linux-gnueabi | |
gcc_package: gcc-arm-linux-gnueabi | |
gcc: arm-linux-gnueabi-gcc | |
qemu: qemu-arm | |
qemu_args: -L /usr/arm-linux-gnueabi | |
qemu_target: arm-linux-user | |
- build: ubuntu-stable | |
os: ubuntu-latest | |
rust: stable | |
- build: i686-linux-stable | |
os: ubuntu-latest | |
rust: stable | |
target: i686-unknown-linux-gnu | |
gcc_package: gcc-i686-linux-gnu | |
gcc: i686-linux-gnu-gcc | |
libc_package: libc-dev-i386-cross | |
- build: aarch64-linux-stable | |
os: ubuntu-latest | |
rust: stable | |
target: aarch64-unknown-linux-gnu | |
gcc_package: gcc-aarch64-linux-gnu | |
gcc: aarch64-linux-gnu-gcc | |
qemu: qemu-aarch64 | |
qemu_args: -L /usr/aarch64-linux-gnu | |
qemu_target: aarch64-linux-user | |
- build: s390x-linux-stable | |
os: ubuntu-latest | |
rust: stable | |
target: s390x-unknown-linux-gnu | |
gcc_package: gcc-s390x-linux-gnu | |
gcc: s390x-linux-gnu-gcc | |
qemu: qemu-s390x | |
qemu_args: -L /usr/s390x-linux-gnu | |
qemu_target: s390x-linux-user | |
- build: powerpc64le-linux-stable | |
os: ubuntu-latest | |
rust: stable | |
target: powerpc64le-unknown-linux-gnu | |
gcc_package: gcc-powerpc64le-linux-gnu | |
gcc: powerpc64le-linux-gnu-gcc | |
qemu: qemu-ppc64le | |
qemu_args: -L /usr/powerpc64le-linux-gnu | |
qemu_target: ppc64le-linux-user | |
- build: arm-linux-stable | |
os: ubuntu-latest | |
rust: stable | |
target: armv5te-unknown-linux-gnueabi | |
gcc_package: gcc-arm-linux-gnueabi | |
gcc: arm-linux-gnueabi-gcc | |
qemu: qemu-arm | |
qemu_args: -L /usr/arm-linux-gnueabi | |
qemu_target: arm-linux-user | |
- build: macos-latest | |
os: macos-latest | |
rust: stable | |
- build: macos-10.15 | |
os: macos-10.15 | |
rust: stable | |
- build: windows | |
os: windows-latest | |
rust: nightly | |
- build: windows-2019 | |
os: windows-2019 | |
rust: nightly | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: ./.github/actions/install-rust | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: Configure Cargo target | |
run: | | |
echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV | |
rustup target add ${{ matrix.target }} | |
if: matrix.target != '' | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ runner.tool_cache }}/qemu | |
key: qemu-${{ matrix.target }}-${{ env.QEMU_BUILD_VERSION }}-patched | |
if: matrix.target != '' && matrix.os == 'ubuntu-latest' | |
- name: Install cross-compilation tools | |
run: | | |
set -ex | |
sudo apt-get update | |
sudo apt-get install -y ${{ matrix.gcc_package }} ninja-build | |
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g') | |
echo CARGO_TARGET_${upcase}_LINKER=${{ matrix.gcc }} >> $GITHUB_ENV | |
if: matrix.gcc_package != '' && matrix.os == 'ubuntu-latest' | |
- name: Install cross-compilation libraries | |
run: | | |
set -ex | |
sudo apt-get update | |
sudo apt-get install -y ${{ matrix.libc_package }} | |
if: matrix.libc_package != '' && matrix.os == 'ubuntu-latest' | |
- name: Install qemu | |
run: | | |
set -ex | |
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g') | |
echo CARGO_TARGET_${upcase}_RUNNER=${{ runner.tool_cache }}/qemu/bin/${{ matrix.qemu }} ${{ matrix.qemu_args }} >> $GITHUB_ENV | |
# See if qemu is already in the cache | |
if [ -f ${{ runner.tool_cache }}/qemu/bin/${{ matrix.qemu }} ]; then | |
exit 0 | |
fi | |
# Download and build qemu from source since the most recent release is | |
# way faster at arm emulation than the current version github actions' | |
# ubuntu image uses. Disable as much as we can to get it to build | |
# quickly. | |
cd | |
curl https://download.qemu.org/qemu-$QEMU_BUILD_VERSION.tar.xz | tar xJf - | |
cd qemu-$QEMU_BUILD_VERSION | |
patch -p1 < $GITHUB_WORKSPACE/ci/translate-errno.patch | |
patch -p1 < $GITHUB_WORKSPACE/ci/getsockopt-timeouts.patch | |
patch -p1 < $GITHUB_WORKSPACE/ci/s390x-stat-have-nsec.patch | |
./configure --target-list=${{ matrix.qemu_target }} --prefix=${{ runner.tool_cache }}/qemu --disable-tools --disable-slirp --disable-fdt --disable-capstone --disable-docs | |
ninja -C build install | |
if: matrix.qemu != '' && matrix.os == 'ubuntu-latest' | |
- name: Use specific dependency versions for Rust 1.48 compatibility. | |
if: matrix.rust == '1.48' | |
run: | | |
cargo update --package=once_cell --precise 1.14.0 | |
cargo update --package=tempfile --precise=3.3.0 | |
- run: | | |
# Run the tests. | |
cargo test --verbose --features=all-impls,all-apis --release --workspace -- --nocapture | |
env: | |
RUST_BACKTRACE: full | |
- run: | | |
cargo check --features=all-impls,all-apis | |
test_use_libc: | |
name: Test use-libc | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [ubuntu, i686-linux, aarch64-linux, powerpc64le-linux, arm-linux] | |
include: | |
- build: ubuntu | |
os: ubuntu-latest | |
rust: stable | |
- build: i686-linux | |
os: ubuntu-latest | |
rust: stable | |
target: i686-unknown-linux-gnu | |
gcc_package: gcc-i686-linux-gnu | |
gcc: i686-linux-gnu-gcc | |
libc_package: libc-dev-i386-cross | |
- build: aarch64-linux | |
os: ubuntu-latest | |
rust: stable | |
target: aarch64-unknown-linux-gnu | |
gcc_package: gcc-aarch64-linux-gnu | |
gcc: aarch64-linux-gnu-gcc | |
qemu: qemu-aarch64 | |
qemu_args: -L /usr/aarch64-linux-gnu | |
qemu_target: aarch64-linux-user | |
- build: powerpc64le-linux | |
os: ubuntu-latest | |
rust: stable | |
target: powerpc64le-unknown-linux-gnu | |
gcc_package: gcc-powerpc64le-linux-gnu | |
gcc: powerpc64le-linux-gnu-gcc | |
qemu: qemu-ppc64le | |
qemu_args: -L /usr/powerpc64le-linux-gnu | |
qemu_target: ppc64le-linux-user | |
- build: arm-linux | |
os: ubuntu-latest | |
rust: stable | |
target: armv7-unknown-linux-gnueabihf | |
gcc_package: gcc-arm-linux-gnueabihf | |
gcc: arm-linux-gnueabihf-gcc | |
qemu: qemu-arm | |
qemu_args: -L /usr/arm-linux-gnueabihf | |
qemu_target: arm-linux-user | |
env: | |
# -D warnings is commented out in our install-rust action; re-add it here. | |
RUSTFLAGS: -D warnings | |
QEMU_BUILD_VERSION: 7.0.0 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: ./.github/actions/install-rust | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: Configure Cargo target | |
run: | | |
echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV | |
rustup target add ${{ matrix.target }} | |
if: matrix.target != '' | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ runner.tool_cache }}/qemu | |
key: qemu-${{ matrix.target }}-${{ env.QEMU_BUILD_VERSION }}-patched | |
if: matrix.target != '' && matrix.os == 'ubuntu-latest' | |
- name: Install cross-compilation tools | |
run: | | |
set -ex | |
sudo apt-get update | |
sudo apt-get install -y ${{ matrix.gcc_package }} ninja-build | |
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g') | |
echo CARGO_TARGET_${upcase}_LINKER=${{ matrix.gcc }} >> $GITHUB_ENV | |
if: matrix.gcc_package != '' && matrix.os == 'ubuntu-latest' | |
- name: Install cross-compilation libraries | |
run: | | |
set -ex | |
sudo apt-get update | |
sudo apt-get install -y ${{ matrix.libc_package }} | |
if: matrix.libc_package != '' && matrix.os == 'ubuntu-latest' | |
- name: Install qemu | |
run: | | |
set -ex | |
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g') | |
echo CARGO_TARGET_${upcase}_RUNNER=${{ runner.tool_cache }}/qemu/bin/${{ matrix.qemu }} ${{ matrix.qemu_args }} >> $GITHUB_ENV | |
# See if qemu is already in the cache | |
if [ -f ${{ runner.tool_cache }}/qemu/bin/${{ matrix.qemu }} ]; then | |
exit 0 | |
fi | |
# Download and build qemu from source since the most recent release is | |
# way faster at arm emulation than the current version github actions' | |
# ubuntu image uses. Disable as much as we can to get it to build | |
# quickly. | |
cd | |
curl https://download.qemu.org/qemu-$QEMU_BUILD_VERSION.tar.xz | tar xJf - | |
cd qemu-$QEMU_BUILD_VERSION | |
patch -p1 < $GITHUB_WORKSPACE/ci/translate-errno.patch | |
patch -p1 < $GITHUB_WORKSPACE/ci/getsockopt-timeouts.patch | |
patch -p1 < $GITHUB_WORKSPACE/ci/s390x-stat-have-nsec.patch | |
./configure --target-list=${{ matrix.qemu_target }} --prefix=${{ runner.tool_cache }}/qemu --disable-tools --disable-slirp --disable-fdt --disable-capstone --disable-docs | |
ninja -C build install | |
if: matrix.qemu != '' && matrix.os == 'ubuntu-latest' | |
- run: | | |
cargo test --verbose --features=use-libc,all-impls,all-apis --release --workspace -- --nocapture | |
env: | |
RUST_BACKTRACE: full | |
test_rustix_use_experimental_asm: | |
name: Test rustix_use_experimental_asm | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [powerpc64le-linux] | |
include: | |
- build: powerpc64le-linux | |
os: ubuntu-latest | |
rust: nightly | |
target: powerpc64le-unknown-linux-gnu | |
gcc_package: gcc-powerpc64le-linux-gnu | |
gcc: powerpc64le-linux-gnu-gcc | |
qemu: qemu-ppc64le | |
qemu_args: -L /usr/powerpc64le-linux-gnu | |
qemu_target: ppc64le-linux-user | |
env: | |
# -D warnings is commented out in our install-rust action; re-add it here. | |
RUSTFLAGS: --cfg rustix_use_experimental_asm -D warnings | |
RUSTDOCFLAGS: --cfg rustix_use_experimental_asm | |
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUSTFLAGS: --cfg rustix_use_experimental_asm | |
QEMU_BUILD_VERSION: 7.0.0 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: ./.github/actions/install-rust | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: Configure Cargo target | |
run: | | |
echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV | |
rustup target add ${{ matrix.target }} | |
if: matrix.target != '' | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ runner.tool_cache }}/qemu | |
key: qemu-${{ matrix.target }}-${{ env.QEMU_BUILD_VERSION }}-patched | |
if: matrix.target != '' && matrix.os == 'ubuntu-latest' | |
- name: Install cross-compilation tools | |
run: | | |
set -ex | |
sudo apt-get update | |
sudo apt-get install -y ${{ matrix.gcc_package }} ninja-build | |
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g') | |
echo CARGO_TARGET_${upcase}_LINKER=${{ matrix.gcc }} >> $GITHUB_ENV | |
if: matrix.gcc_package != '' && matrix.os == 'ubuntu-latest' | |
- name: Install cross-compilation libraries | |
run: | | |
set -ex | |
sudo apt-get update | |
sudo apt-get install -y ${{ matrix.libc_package }} | |
if: matrix.libc_package != '' && matrix.os == 'ubuntu-latest' | |
- name: Install qemu | |
run: | | |
set -ex | |
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g') | |
echo CARGO_TARGET_${upcase}_RUNNER=${{ runner.tool_cache }}/qemu/bin/${{ matrix.qemu }} ${{ matrix.qemu_args }} >> $GITHUB_ENV | |
# See if qemu is already in the cache | |
if [ -f ${{ runner.tool_cache }}/qemu/bin/${{ matrix.qemu }} ]; then | |
exit 0 | |
fi | |
# Download and build qemu from source since the most recent release is | |
# way faster at arm emulation than the current version github actions' | |
# ubuntu image uses. Disable as much as we can to get it to build | |
# quickly. | |
cd | |
curl https://download.qemu.org/qemu-$QEMU_BUILD_VERSION.tar.xz | tar xJf - | |
cd qemu-$QEMU_BUILD_VERSION | |
patch -p1 < $GITHUB_WORKSPACE/ci/translate-errno.patch | |
patch -p1 < $GITHUB_WORKSPACE/ci/getsockopt-timeouts.patch | |
patch -p1 < $GITHUB_WORKSPACE/ci/s390x-stat-have-nsec.patch | |
./configure --target-list=${{ matrix.qemu_target }} --prefix=${{ runner.tool_cache }}/qemu --disable-tools --disable-slirp --disable-fdt --disable-capstone --disable-docs | |
ninja -C build install | |
if: matrix.qemu != '' && matrix.os == 'ubuntu-latest' | |
- run: | | |
cargo test --verbose --features=all-impls,all-apis --release --workspace -- --nocapture | |
env: | |
RUST_BACKTRACE: full |