[GIT PULL] Add Rust implementation of liburing.h #1668
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: Build test | |
on: | |
# Trigger the workflow on push or pull requests. | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# x86-64 gcc | |
- arch: x86_64 | |
cc_pkg: gcc-x86-64-linux-gnu | |
cxx_pkg: g++-x86-64-linux-gnu | |
cc: x86_64-linux-gnu-gcc | |
cxx: x86_64-linux-gnu-g++ | |
sanitize: 0 | |
cargo_toolchain: x86_64-unknown-linux-gnu | |
# x86-64 gcc asan | |
- arch: x86_64 | |
cc_pkg: gcc-x86-64-linux-gnu | |
cxx_pkg: g++-x86-64-linux-gnu | |
cc: x86_64-linux-gnu-gcc | |
cxx: x86_64-linux-gnu-g++ | |
sanitize: 1 | |
cargo_toolchain: x86_64-unknown-linux-gnu | |
# x86-64 clang | |
- arch: x86_64 | |
cc_pkg: clang | |
cxx_pkg: clang | |
cc: clang | |
cxx: clang++ | |
liburing_extra_flags: -Wshorten-64-to-32 | |
extra_flags: -Wmissing-prototypes -Wstrict-prototypes -Wunreachable-code-loop-increment -Wunreachable-code -Wmissing-variable-declarations -Wextra-semi-stmt | |
sanitize: 0 | |
cargo_toolchain: x86_64-unknown-linux-gnu | |
# x86 (32-bit) gcc | |
- arch: i686 | |
cc_pkg: gcc-i686-linux-gnu | |
cxx_pkg: g++-i686-linux-gnu | |
cc: i686-linux-gnu-gcc | |
cxx: i686-linux-gnu-g++ | |
sanitize: 0 | |
# leave disabled because of this bug in bindgen: | |
# https://github.com/rust-lang/rust-bindgen/issues/2991 | |
# cargo_toolchain: i686-unknown-linux-gnu | |
# aarch64 gcc | |
- arch: aarch64 | |
cc_pkg: gcc-aarch64-linux-gnu | |
cxx_pkg: g++-aarch64-linux-gnu | |
cc: aarch64-linux-gnu-gcc | |
cxx: aarch64-linux-gnu-g++ | |
sanitize: 0 | |
cargo_toolchain: aarch64-unknown-linux-gnu | |
# arm (32-bit) gcc | |
- arch: arm | |
cc_pkg: gcc-arm-linux-gnueabi | |
cxx_pkg: g++-arm-linux-gnueabi | |
cc: arm-linux-gnueabi-gcc | |
cxx: arm-linux-gnueabi-g++ | |
sanitize: 0 | |
cargo_toolchain: arm-unknown-linux-gnueabi | |
# riscv64 | |
- arch: riscv64 | |
cc_pkg: gcc-riscv64-linux-gnu | |
cxx_pkg: g++-riscv64-linux-gnu | |
cc: riscv64-linux-gnu-gcc | |
cxx: riscv64-linux-gnu-g++ | |
sanitize: 0 | |
cargo_toolchain: riscv64gc-unknown-linux-gnu | |
# powerpc64 | |
- arch: powerpc64 | |
cc_pkg: gcc-powerpc64-linux-gnu | |
cxx_pkg: g++-powerpc64-linux-gnu | |
cc: powerpc64-linux-gnu-gcc | |
cxx: powerpc64-linux-gnu-g++ | |
sanitize: 0 | |
cargo_toolchain: powerpc64-unknown-linux-gnu | |
# powerpc | |
- arch: powerpc | |
cc_pkg: gcc-powerpc-linux-gnu | |
cxx_pkg: g++-powerpc-linux-gnu | |
cc: powerpc-linux-gnu-gcc | |
cxx: powerpc-linux-gnu-g++ | |
sanitize: 0 | |
cargo_toolchain: powerpc-unknown-linux-gnu | |
# alpha | |
- arch: alpha | |
cc_pkg: gcc-alpha-linux-gnu | |
cxx_pkg: g++-alpha-linux-gnu | |
cc: alpha-linux-gnu-gcc | |
cxx: alpha-linux-gnu-g++ | |
sanitize: 0 | |
# mips64 | |
- arch: mips64 | |
cc_pkg: gcc-mips64-linux-gnuabi64 | |
cxx_pkg: g++-mips64-linux-gnuabi64 | |
cc: mips64-linux-gnuabi64-gcc | |
cxx: mips64-linux-gnuabi64-g++ | |
sanitize: 0 | |
# mips | |
- arch: mips | |
cc_pkg: gcc-mips-linux-gnu | |
cxx_pkg: g++-mips-linux-gnu | |
cc: mips-linux-gnu-gcc | |
cxx: mips-linux-gnu-g++ | |
sanitize: 0 | |
# hppa | |
- arch: hppa | |
cc_pkg: gcc-hppa-linux-gnu | |
cxx_pkg: g++-hppa-linux-gnu | |
cc: hppa-linux-gnu-gcc | |
cxx: hppa-linux-gnu-g++ | |
sanitize: 0 | |
env: | |
FLAGS: -g -O3 -Wall -Wextra -Werror -Wno-sign-compare ${{matrix.extra_flags}} | |
SANITIZE: ${{matrix.sanitize}} | |
CARGO_TOOLCHAIN: ${{matrix.cargo_toolchain}} | |
# Flags for building sources in src/ dir only. | |
LIBURING_CFLAGS: ${{matrix.liburing_extra_flags}} | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Install Compilers | |
run: | | |
sudo apt-get update -y; | |
sudo apt-get install -y ${{matrix.cc_pkg}} ${{matrix.cxx_pkg}}; | |
- name: Install Rust | |
if: ${{matrix.cargo_toolchain}} | |
run: | | |
sudo apt-get update -y; | |
sudo apt-get install -y curl; | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y; | |
. "$HOME/.cargo/env"; | |
rustup update; | |
rustup update nightly; | |
rustup target add ${{matrix.cargo_toolchain}} --toolchain stable; | |
rustup target add ${{matrix.cargo_toolchain}} --toolchain nightly; | |
rustup component add rust-src --toolchain nightly --target ${{matrix.cargo_toolchain}}; | |
- name: Display compiler versions | |
run: | | |
${{matrix.cc}} --version; | |
${{matrix.cxx}} --version; | |
- name: Build | |
if: ${{matrix.sanitize == '0'}} | |
run: | | |
./configure --cc=${{matrix.cc}} --cxx=${{matrix.cxx}}; | |
make -j$(nproc) V=1 CPPFLAGS="-Werror" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS"; | |
- name: Build | |
if: ${{matrix.sanitize == '1'}} | |
run: | | |
./configure --cc=${{matrix.cc}} --cxx=${{matrix.cxx}} --enable-sanitizer; | |
make -j$(nproc) V=1 CPPFLAGS="-Werror" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS"; | |
- name: Build liburing-rs | |
if: ${{matrix.cargo_toolchain && matrix.sanitize == '0'}} | |
run: | | |
CC=${{matrix.cc}} CXX=${{matrix.cxx}} cargo build --target ${{matrix.cargo_toolchain}}; | |
make -j$(nproc) V=1 CPPFLAGS="-Werror" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" -C test liburing_rs_tests; | |
- name: Build liburing-rs | |
if: ${{matrix.cargo_toolchain && matrix.sanitize == '1'}} | |
run: | | |
CC=${{matrix.cc}} CXX=${{matrix.cxx}} cargo +nightly build --target ${{matrix.cargo_toolchain}} -Zbuild-std --features sanitizers; | |
make -j$(nproc) V=1 CPPFLAGS="-Werror" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" -C test liburing_rs_tests; | |
- name: Test install command | |
run: | | |
sudo make install; |