Skip to content

Miscellaneous documentation cleanups. (#778) #3074

Miscellaneous documentation cleanups. (#778)

Miscellaneous documentation cleanups. (#778) #3074

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@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.63]
include:
- build: stable
os: ubuntu-latest
rust: stable
- build: nightly
os: ubuntu-latest
rust: nightly-2023-07-03
- 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 --cfg criterion
steps:
- uses: actions/checkout@v3
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
- 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
powerpc64le-unknown-linux-gnu
mipsel-unknown-linux-gnu
mips64el-unknown-linux-gnuabi64
armv5te-unknown-linux-gnueabi
s390x-unknown-linux-gnu
arm-linux-androideabi
sparc64-unknown-linux-gnu
sparcv9-sun-solaris
aarch64-linux-android
aarch64-apple-ios
wasm32-wasi
- if: matrix.rust != '1.63'
run: rustup target add 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 --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=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=i686-linux-android --features=all-apis --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=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=aarch64-unknown-linux-gnu --features=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=powerpc64le-unknown-linux-gnu --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=mipsel-unknown-linux-gnu --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=mips64el-unknown-linux-gnuabi64 --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=all-apis --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=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=wasm32-wasi --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-2023-07-03
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 -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 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]
include:
- build: nightly
os: ubuntu-latest
rust: nightly-2023-07-03
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-2023-07-03
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 --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
# Omit --all-targets on gnu_ilp32 because dev-dependency tempfile depends on an older rustix
- run: cargo check -Z build-std --target aarch64-unknown-linux-gnu_ilp32 --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
- 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
test:
name: Test
runs-on: ${{ matrix.os }}
env:
QEMU_BUILD_VERSION: 8.0.2
# Enabling testing of experimental features.
RUSTFLAGS: --cfg rustix_use_experimental_features
strategy:
matrix:
build: [ubuntu, ubuntu-20.04, i686-linux, aarch64-linux, powerpc64le-linux, riscv64-linux, s390x-linux, arm-linux, ubuntu-stable, ubuntu-1.63, i686-linux-stable, aarch64-linux-stable, riscv64-linux-stable, s390x-linux-stable, mipsel-linux-stable, mips64el-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, mipsel-linux-1.63, mips64el-linux-1.63, powerpc64le-linux-1.63, arm-linux-1.63, macos-latest, macos-11, windows, windows-2019]
include:
- build: ubuntu
os: ubuntu-latest
rust: nightly-2023-07-03
- build: ubuntu-20.04
os: ubuntu-20.04
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: mips64el-linux
os: ubuntu-latest
rust: nightly-2023-07-03
target: mips64el-unknown-linux-gnuabi64
gcc_package: gcc-mips64el-linux-gnuabi64
gcc: mips64el-linux-gnuabi64-gcc
qemu: qemu-mips64el
qemu_args: -L /usr/mips64el-linux-gnuabi64
qemu_target: mips64el-linux-user
- build: mipsel-linux
os: ubuntu-latest
rust: nightly-2023-07-03
target: mipsel-unknown-linux-gnu
gcc_package: gcc-mipsel-linux-gnu
gcc: mipsel-linux-gnu-gcc
qemu: qemu-mipsel
qemu_args: -L /usr/mipsel-linux-gnu
qemu_target: mipsel-linux-user
- build: riscv64-linux
os: ubuntu-latest
rust: nightly-2023-07-03
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-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: 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: 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: mips64el-linux-stable
os: ubuntu-latest
rust: stable
target: mips64el-unknown-linux-gnuabi64
gcc_package: gcc-mips64el-linux-gnuabi64
gcc: mips64el-linux-gnuabi64-gcc
qemu: qemu-mips64el
qemu_args: -L /usr/mips64el-linux-gnuabi64
qemu_target: mips64el-linux-user
- build: mipsel-linux-stable
os: ubuntu-latest
rust: stable
target: mipsel-unknown-linux-gnu
gcc_package: gcc-mipsel-linux-gnu
gcc: mipsel-linux-gnu-gcc
qemu: qemu-mipsel
qemu_args: -L /usr/mipsel-linux-gnu
qemu_target: mipsel-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: 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: mips64el-linux-1.63
os: ubuntu-latest
rust: 1.63
target: mips64el-unknown-linux-gnuabi64
gcc_package: gcc-mips64el-linux-gnuabi64
gcc: mips64el-linux-gnuabi64-gcc
qemu: qemu-mips64el
qemu_args: -L /usr/mips64el-linux-gnuabi64
qemu_target: mips64el-linux-user
- build: mipsel-linux-1.63
os: ubuntu-latest
rust: 1.63
target: mipsel-unknown-linux-gnu
gcc_package: gcc-mipsel-linux-gnu
gcc: mipsel-linux-gnu-gcc
qemu: qemu-mipsel
qemu_args: -L /usr/mipsel-linux-gnu
qemu_target: mipsel-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-11
os: macos-11
rust: stable
- build: windows
os: windows-latest
rust: nightly-2023-07-03
- build: windows-2019
os: windows-2019
rust: nightly-2023-07-03
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.63 compatibility.
if: matrix.rust == '1.63'
run: |
cargo update --package=dashmap --precise 5.4.0
- 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, powerpc64le-linux, mips64el-linux, mipsel-linux, riscv64-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: mips64el-linux
os: ubuntu-latest
rust: stable
target: mips64el-unknown-linux-gnuabi64
gcc_package: gcc-mips64el-linux-gnuabi64
gcc: mips64el-linux-gnuabi64-gcc
qemu: qemu-mips64el
qemu_args: -L /usr/mips64el-linux-gnuabi64
qemu_target: mips64el-linux-user
- build: mipsel-linux
os: ubuntu-latest
rust: stable
target: mipsel-unknown-linux-gnu
gcc_package: gcc-mipsel-linux-gnu
gcc: mipsel-linux-gnu-gcc
qemu: qemu-mipsel
qemu_args: -L /usr/mipsel-linux-gnu
qemu_target: mipsel-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: 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: 8.0.2
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-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, mipsel-linux, mips64el-linux]
include:
- 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: mips64el-linux
os: ubuntu-latest
rust: nightly-2023-07-03
target: mips64el-unknown-linux-gnuabi64
gcc_package: gcc-mips64el-linux-gnuabi64
gcc: mips64el-linux-gnuabi64-gcc
qemu: qemu-mips64el
qemu_args: -L /usr/mips64el-linux-gnuabi64
qemu_target: mips64el-linux-user
- build: mipsel-linux
os: ubuntu-latest
rust: nightly-2023-07-03
target: mipsel-unknown-linux-gnu
gcc_package: gcc-mipsel-linux-gnu
gcc: mipsel-linux-gnu-gcc
qemu: qemu-mipsel
qemu_args: -L /usr/mipsel-linux-gnu
qemu_target: mipsel-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
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_RUSTFLAGS: --cfg rustix_use_experimental_asm
CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_RUSTFLAGS: --cfg rustix_use_experimental_asm
QEMU_BUILD_VERSION: 8.0.2
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-apis --release --workspace -- --nocapture
env:
RUST_BACKTRACE: full