Skip to content

Misc fixes to build dav1d C sources cleanly (#1454) #1597

Misc fixes to build dav1d C sources cleanly (#1454)

Misc fixes to build dav1d C sources cleanly (#1454) #1597

name: build and test with QEMU
on:
push:
branches:
- 'main'
pull_request:
jobs:
test-on-ubuntu-latest-with-qemu:
strategy:
matrix:
# only test specific parameter pairs, not the cross product
include:
- target: "armv7-unknown-linux-gnueabihf"
linker: "arm-linux-gnueabihf-gcc"
wrapper: "qemu-arm-static"
packages: "g++-arm-linux-gnueabihf libc6-dev-armhf-cross"
# arm feature detection is unstable
# should be the same as rust-toolchain.toml
toolchain: nightly-2025-05-01
- target: "aarch64-unknown-linux-gnu"
linker: "aarch64-linux-gnu-gcc"
wrapper: "qemu-aarch64-static"
packages: "g++-aarch64-linux-gnu libc6-dev-arm64-cross"
toolchain: stable # aarch64 feature detection is stable
- target: "x86_64-unknown-linux-gnu"
linker: "cc"
wrapper: "qemu-x86_64-static -cpu max" # enable AVX512
packages: ""
# NOTE: This appears to work for Ubuntu 22.04 and other systems
# with a recent version of GNU ld (e.g. 2.38) whereas Ubuntu 20.04
# fails with the following linker error: unsupported ISA subset `z'
toolchain: stable # x86_64 feature detection is stable
- target: "riscv64gc-unknown-linux-gnu"
linker: "riscv64-linux-gnu-gcc"
wrapper: "qemu-riscv64-static"
packages: "g++-riscv64-linux-gnu libc6-dev-riscv64-cross"
# riscv64 feature detection is unstable
# should be the same as rust-toolchain.toml
toolchain: nightly-2025-05-01
runs-on: ubuntu-22.04
name: test on ${{ matrix.target }}
steps:
- name: install prerequisites
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: ${{ matrix.packages }} qemu-user-static meson nasm
version: 3.0 # version of cache to load
- name: git checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: install rust toolchain
id: toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
components: clippy
- name: cache rust dependencies
uses: Swatinem/rust-cache@v2
- name: cargo build for ${{ matrix.target }}
run: |
RUSTFLAGS="-C target-feature=+crt-static -C linker=${{ matrix.linker }}" \
cargo +${{ steps.toolchain.outputs.name }} build --release --target ${{ matrix.target }}
- name: Clippy
run: cargo +${{ steps.toolchain.outputs.name }} clippy -- -D warnings
- name: run tests
run: |
.github/workflows/test.sh -t 2 \
-r target/${{ matrix.target }}/release/dav1d \
-s target/${{ matrix.target }}/release/seek_stress \
-w "${{ matrix.wrapper }}"
- name: upload build artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: meson-test-logs-${{ matrix.target }}
path: |
${{ github.workspace }}/build/meson-logs/testlog.txt