Skip to content

Make it possible to use Path and friends on wasip2 without the so named feature #5416

Make it possible to use Path and friends on wasip2 without the so named feature

Make it possible to use Path and friends on wasip2 without the so named feature #5416

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
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-2025-06-23, 1.63]
include:
- build: stable
os: ubuntu-latest
rust: stable
- build: nightly-2025-06-23
os: ubuntu-latest
rust: nightly-2025-06-23
- build: 1.63
os: ubuntu-latest
rust: 1.63
env:
# -D warnings is commented out in our install-rust action; re-add it here.
RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths --cfg criterion
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
- name: Use specific dependency versions for Rust 1.63 compatibility.
if: matrix.rust == '1.63'
run: |
cargo update --package=dashmap --precise 5.4.0
cargo update --package=regex --precise=1.9.0
cargo update --package=half --precise=2.2.1
cargo update --package=flate2 --precise=1.0.35
cargo update --package=textwrap --precise=0.16.1
cargo update --package=once_cell --precise=1.20.3
cargo update --package=parking_lot --precise=0.12.3
cargo update --package=parking_lot_core --precise=0.9.10
cargo update --package=lock_api --precise=0.4.12
cargo update --package=rayon --precise=1.10.0
cargo update --package=rayon-core --precise=1.12.1
cargo update --package=windows-sys@0.61.0 --precise=0.60.2
- 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
riscv64gc-unknown-linux-gnu
aarch64-unknown-linux-gnu
aarch64-unknown-linux-musl
powerpc-unknown-linux-gnu
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
i686-pc-windows-msvc
- if: matrix.rust != '1.63'
run: >
rustup target add
wasm32-wasip1
wasm32-wasip2
x86_64-unknown-fuchsia
- if: matrix.rust == '1.63'
run: rustup target add x86_64-fuchsia
- run: cargo check --workspace --release -vv --all-targets
- run: cargo check --workspace --release -vv --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --features=use-libc,all-apis --all-targets
- run: cargo check --workspace --release -vv --features=linux_latest,all-apis --all-targets
- run: cargo check --workspace --release -vv --target=aarch64-linux-android --all-targets
- run: cargo check --workspace --release -vv --target=x86_64-unknown-linux-musl --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=x86_64-unknown-linux-musl --features=use-libc,all-apis --all-targets
- run: cargo check --workspace --release -vv --target=x86_64-unknown-linux-gnux32 --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=x86_64-linux-android --features=use-libc,net,std,alloc,event,fs,mm,param,pipe,use-libc-auxv,libc_errno --all-targets
- run: cargo check --workspace --release -vv --target=i686-linux-android --features=use-libc,net,std,alloc,event,fs,mm,param,pipe,use-libc-auxv,libc_errno --all-targets
- run: cargo check --workspace --release -vv --target=x86_64-apple-darwin --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=x86_64-unknown-freebsd --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=x86_64-unknown-netbsd --features=all-apis --all-targets
- if: matrix.rust != '1.63'
run: cargo check --workspace --release -vv --target=wasm32-wasip1 --features=all-apis
- if: matrix.rust != '1.63'
run: cargo check --workspace --release -vv --target=wasm32-wasip2 --features=all-apis
- if: matrix.rust != '1.63'
run: cargo check --workspace --release -vv --target=x86_64-unknown-fuchsia --features=all-apis --all-targets
- if: matrix.rust == '1.63'
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 --all-targets
- run: cargo check --workspace --release -vv --target=i686-unknown-linux-gnu --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=i686-unknown-linux-musl --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=i686-unknown-linux-musl --features=use-libc,all-apis --all-targets
- run: cargo check --workspace --release -vv --target=wasm32-unknown-emscripten --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=riscv64gc-unknown-linux-gnu --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=riscv64gc-unknown-linux-gnu --features=linux_latest,all-apis --all-targets
- run: cargo check --workspace --release -vv --target=aarch64-unknown-linux-gnu --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=aarch64-unknown-linux-gnu --features=linux_latest,all-apis --all-targets
- run: cargo check --workspace --release -vv --target=aarch64-unknown-linux-musl --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=aarch64-unknown-linux-musl --features=use-libc,all-apis --all-targets
- run: cargo check --workspace --release -vv --target=powerpc-unknown-linux-gnu --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=powerpc64le-unknown-linux-gnu --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=armv5te-unknown-linux-gnueabi --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=s390x-unknown-linux-gnu --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=arm-linux-androideabi --features=use-libc,net,std,alloc,event,fs,mm,param,pipe,use-libc-auxv,libc_errno --all-targets
- run: cargo check --workspace --release -vv --target=sparc64-unknown-linux-gnu --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=sparcv9-sun-solaris --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=aarch64-apple-ios --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=aarch64-linux-android --features=use-libc,net,std,alloc,event,fs,mm,param,pipe,use-libc-auxv,libc_errno --all-targets
- run: cargo check --workspace --release -vv --target=i686-pc-windows-msvc --features=all-apis --all-targets
check_no_default_features:
name: Check --no-default-features
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [nightly-2025-06-23]
include:
- build: nightly-2025-06-23
os: ubuntu-latest
rust: nightly-2025-06-23
env:
# -D warnings is commented out in our install-rust action; re-add it here.
RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
- run: cargo check --workspace --release --no-default-features -vv
- run: cargo check --workspace --release --no-default-features --features use-libc -vv
- run: cargo check --workspace --release --no-default-features --features all-apis -vv
- run: cargo check --workspace --release --no-default-features --features all-apis,use-libc -vv
- run: cargo check --workspace --release --no-default-features --features all-apis,alloc -vv
- run: cargo check --workspace --release --no-default-features --features all-apis,use-libc,alloc -vv
- run: cargo check --workspace --release --no-default-features --features time -vv
- run: cargo check --workspace --release --no-default-features --features time,use-libc -vv
- run: rustup component add rust-src
- run: cargo check --workspace --release --no-default-features --target=i686-unknown-linux-gnu -Zbuild-std -vv
check_nightly:
name: Check nightly-only targets
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [nightly-2025-06-23]
include:
- build: nightly-2025-06-23
os: ubuntu-latest
rust: nightly-2025-06-23
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ matrix.rust }}
- run: >
rustup target add
x86_64-unknown-redox
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=thumbv7neon-unknown-linux-gnueabihf --features=all-apis
check_tier3:
name: Check selected Tier 3 platforms
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [nightly-2025-06-23]
include:
- build: nightly-2025-06-23
os: ubuntu-latest
rust: nightly-2025-06-23
steps:
- uses: actions/checkout@v4
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 --cfg criterion
- 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
- run: cargo check -Z build-std --target armv7-unknown-freebsd --all-targets --features=all-apis
- run: cargo check -Z build-std --target aarch64-unknown-linux-gnu_ilp32 --all-targets --features=all-apis
- run: cargo check -Z build-std --target x86_64-unknown-haiku --all-targets --features=all-apis
# Temporarily disable due to build errors on nightly.
# - run: cargo check -Z build-std --target x86_64-uwp-windows-msvc --all-targets --features=all-apis
- run: cargo check -Z build-std --target=riscv32imc-esp-espidf --features=all-apis
- run: cargo check -Z build-std --target=aarch64-unknown-nto-qnx710 --features=all-apis
- run: cargo check -Z build-std --target=x86_64-pc-nto-qnx710 --features=all-apis
- run: cargo check -Z build-std --target=armv6k-nintendo-3ds --all-features
- run: cargo check -Z build-std --target=armv7-sony-vita-newlibeabihf --features=all-apis
# Temporarily disable due to build errors on nightly.
# - run: cargo check -Z build-std --target=powerpc64-ibm-aix --features=all-apis
- run: cargo check -Z build-std --target=mipsel-unknown-linux-gnu --features=all-apis
- run: cargo check -Z build-std --target=mips64el-unknown-linux-gnuabi64 --features=all-apis
- run: cargo check -Z build-std --target=powerpc-unknown-linux-musl --features=all-apis
- run: cargo check -Z build-std --target=powerpc64le-unknown-linux-musl --features=all-apis
- run: cargo check -Z build-std --target=armv7k-apple-watchos --features=all-apis
test:
name: Test
runs-on: ${{ matrix.os }}
env:
QEMU_BUILD_VERSION: 9.2.0
# Enabling testing of experimental features.
RUSTFLAGS: --cfg rustix_use_experimental_features
strategy:
matrix:
build: [ubuntu, ubuntu-22.04, i686-linux, aarch64-linux, powerpc-linux, powerpc64le-linux, riscv64-linux, s390x-linux, arm-linux, ubuntu-stable, i686-linux-stable, aarch64-linux-stable, riscv64-linux-stable, s390x-linux-stable, powerpc-linux-stable, powerpc64le-linux-stable, arm-linux-stable, ubuntu-1.63, i686-linux-1.63, aarch64-linux-1.63, riscv64-linux-1.63, s390x-linux-1.63, powerpc64le-linux, powerpc64le-linux-1.63, arm-linux-1.63, macos-latest, macos-13, windows, musl]
include:
- build: ubuntu
os: ubuntu-latest
rust: nightly-2025-06-23
- build: ubuntu-22.04
os: ubuntu-22.04
rust: nightly-2025-06-23
- build: i686-linux
os: ubuntu-latest
rust: nightly-2025-06-23
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-2025-06-23
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: powerpc-linux
os: ubuntu-latest
rust: nightly-2025-06-23
target: powerpc-unknown-linux-gnu
gcc_package: gcc-powerpc-linux-gnu
gcc: powerpc-linux-gnu-gcc
qemu: qemu-ppc
qemu_args: -L /usr/powerpc-linux-gnu
qemu_target: ppc-linux-user
- build: powerpc64le-linux
os: ubuntu-latest
rust: nightly-2025-06-23
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: riscv64-linux
os: ubuntu-latest
rust: nightly-2025-06-23
target: riscv64gc-unknown-linux-gnu
gcc_package: gcc-riscv64-linux-gnu
gcc: riscv64-linux-gnu-gcc
qemu: qemu-riscv64
qemu_args: -L /usr/riscv64-linux-gnu
qemu_target: riscv64-linux-user
- build: s390x-linux
os: ubuntu-latest
rust: nightly-2025-06-23
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-2025-06-23
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: riscv64-linux-stable
os: ubuntu-latest
rust: stable
target: riscv64gc-unknown-linux-gnu
gcc_package: gcc-riscv64-linux-gnu
gcc: riscv64-linux-gnu-gcc
qemu: qemu-riscv64
qemu_args: -L /usr/riscv64-linux-gnu
qemu_target: riscv64-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: powerpc-linux-stable
os: ubuntu-latest
rust: stable
target: powerpc-unknown-linux-gnu
gcc_package: gcc-powerpc-linux-gnu
gcc: powerpc-linux-gnu-gcc
qemu: qemu-ppc
qemu_args: -L /usr/powerpc-linux-gnu
qemu_target: ppc-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: ubuntu-1.63
os: ubuntu-latest
rust: 1.63
- build: i686-linux-1.63
os: ubuntu-latest
rust: 1.63
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-1.63
os: ubuntu-latest
rust: 1.63
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: riscv64-linux-1.63
os: ubuntu-latest
rust: 1.63
target: riscv64gc-unknown-linux-gnu
gcc_package: gcc-riscv64-linux-gnu
gcc: riscv64-linux-gnu-gcc
qemu: qemu-riscv64
qemu_args: -L /usr/riscv64-linux-gnu
qemu_target: riscv64-linux-user
- build: s390x-linux-1.63
os: ubuntu-latest
rust: 1.63
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: powerpc-linux-1.63
os: ubuntu-latest
rust: 1.63
target: powerpc-unknown-linux-gnu
gcc_package: gcc-powerpc-linux-gnu
gcc: powerpc-linux-gnu-gcc
qemu: qemu-ppc
qemu_args: -L /usr/powerpc-linux-gnu
qemu_target: ppc-linux-user
- build: powerpc64le-linux-1.63
os: ubuntu-latest
rust: 1.63
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-1.63
os: ubuntu-latest
rust: 1.63
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-13
os: macos-13
rust: stable
- build: windows
os: windows-latest
rust: nightly-2025-06-23
- build: musl
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v4
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@v4
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 libglib2.0-dev
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
patch -p1 < $GITHUB_WORKSPACE/ci/aarch64-o-largefile.patch
patch -p1 < $GITHUB_WORKSPACE/ci/tcgets2-tcsets2.patch
patch -p1 < $GITHUB_WORKSPACE/ci/tiocgsid.patch
patch -p1 < $GITHUB_WORKSPACE/ci/more-sockopts.patch
patch -p1 < $GITHUB_WORKSPACE/ci/pidfd-open.patch
patch -p1 < $GITHUB_WORKSPACE/ci/select-setsize.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.63 compatibility.
if: matrix.rust == '1.63'
run: |
cargo update --package=dashmap --precise 5.4.0
cargo update --package=regex --precise=1.9.0
cargo update --package=half --precise=2.2.1
cargo update --package=flate2 --precise=1.0.35
cargo update --package=textwrap --precise=0.16.1
cargo update --package=once_cell --precise=1.20.3
cargo update --package=parking_lot --precise=0.12.3
cargo update --package=parking_lot_core --precise=0.9.10
cargo update --package=lock_api --precise=0.4.12
cargo update --package=rayon --precise=1.10.0
cargo update --package=rayon-core --precise=1.12.1
cargo update --package=windows-sys@0.61.0 --precise=0.60.2
- run: |
cargo test --verbose --features=all-apis --release --workspace -- --nocapture
env:
RUST_BACKTRACE: full
MACOSX_DEPLOYMENT_TARGET: 10.7
MACOSX_SDK_VERSION: 10.7
test_use_libc:
name: Test use-libc
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [ubuntu, i686-linux, aarch64-linux, powerpc-linux, powerpc64le-linux, riscv64-linux, s390x-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: powerpc-linux
os: ubuntu-latest
rust: stable
target: powerpc-unknown-linux-gnu
gcc_package: gcc-powerpc-linux-gnu
gcc: powerpc-linux-gnu-gcc
qemu: qemu-ppc
qemu_args: -L /usr/powerpc-linux-gnu
qemu_target: ppc-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: riscv64-linux
os: ubuntu-latest
rust: stable
target: riscv64gc-unknown-linux-gnu
gcc_package: gcc-riscv64-linux-gnu
gcc: riscv64-linux-gnu-gcc
qemu: qemu-riscv64
qemu_args: -L /usr/riscv64-linux-gnu
qemu_target: riscv64-linux-user
- build: s390x-linux
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: 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 -D elided-lifetimes-in-paths
QEMU_BUILD_VERSION: 9.2.0
steps:
- uses: actions/checkout@v4
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@v4
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 libglib2.0-dev
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
patch -p1 < $GITHUB_WORKSPACE/ci/aarch64-o-largefile.patch
patch -p1 < $GITHUB_WORKSPACE/ci/tcgets2-tcsets2.patch
patch -p1 < $GITHUB_WORKSPACE/ci/tiocgsid.patch
patch -p1 < $GITHUB_WORKSPACE/ci/more-sockopts.patch
patch -p1 < $GITHUB_WORKSPACE/ci/pidfd-open.patch
patch -p1 < $GITHUB_WORKSPACE/ci/select-setsize.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-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: [powerpc-linux, powerpc64le-linux, s390x-linux]
include:
- build: powerpc-linux
os: ubuntu-latest
rust: nightly-2025-06-23
target: powerpc-unknown-linux-gnu
gcc_package: gcc-powerpc-linux-gnu
gcc: powerpc-linux-gnu-gcc
qemu: qemu-ppc
qemu_args: -L /usr/powerpc-linux-gnu
qemu_target: ppc-linux-user
- build: powerpc64le-linux
os: ubuntu-latest
rust: nightly-2025-06-23
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-2025-06-23
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
env:
# -D warnings is commented out in our install-rust action; re-add it here.
RUSTFLAGS: --cfg rustix_use_experimental_asm -D warnings -D elided-lifetimes-in-paths
RUSTDOCFLAGS: --cfg rustix_use_experimental_asm
CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUSTFLAGS: --cfg rustix_use_experimental_asm
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUSTFLAGS: --cfg rustix_use_experimental_asm
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUSTFLAGS: --cfg rustix_use_experimental_asm
QEMU_BUILD_VERSION: 9.2.0
steps:
- uses: actions/checkout@v4
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@v4
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 libglib2.0-dev
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
patch -p1 < $GITHUB_WORKSPACE/ci/aarch64-o-largefile.patch
patch -p1 < $GITHUB_WORKSPACE/ci/tcgets2-tcsets2.patch
patch -p1 < $GITHUB_WORKSPACE/ci/tiocgsid.patch
patch -p1 < $GITHUB_WORKSPACE/ci/more-sockopts.patch
patch -p1 < $GITHUB_WORKSPACE/ci/pidfd-open.patch
patch -p1 < $GITHUB_WORKSPACE/ci/select-setsize.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-apis --release --workspace -- --nocapture
env:
RUST_BACKTRACE: full