diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index e128a267..885464a9 100644 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -61,3 +61,29 @@ jobs: with: name: bcachefs-tools-rpm path: rpmbuild + + msrv: + name: bcachefs-tools-msrv + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Disable initramfs update + run: sudo sed -i 's/yes/no/g' /etc/initramfs-tools/update-initramfs.conf + - name: Disable man-db update + run: sudo rm -f /var/lib/man-db/auto-update + - name: Install build-deps + run: | + sudo apt-get update && sudo apt-get -y install pkg-config libaio-dev libblkid-dev \ + libkeyutils-dev liblz4-dev libsodium-dev liburcu-dev libzstd-dev \ + uuid-dev zlib1g-dev valgrind libudev-dev python3-docutils libclang-dev + - name: Extract MSRV + run: | + MSRV=$(cargo metadata --format-version 1 --no-deps --manifest-path rust-src/Cargo.toml | + jq -r '.packages[] | select(.name == "bcachefs-rust") | .rust_version') + echo "MSRV=$MSRV" >> $GITHUB_ENV + - name: Install Rust ${{ env.MSRV }} toolchain + run: | + rustup install --profile minimal ${{ env.MSRV }} + - name: Make + run: | + CARGO_TOOLCHAIN_VERSION=${{ env.MSRV }} make -j`nproc` diff --git a/INSTALL.md b/INSTALL.md index 94b28770..370fb8df 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -16,7 +16,7 @@ Build dependencies: * zlib1g In addition a recent Rust toolchain is required (rustc, cargo), either by using -[rustup](https://rustup.rs/) or make sure to use a distribution where rustc (>=1.64) +[rustup](https://rustup.rs/) or make sure to use a distribution where rustc (>=1.65) is available. Debian (Bullseye or later) and Ubuntu (20.04 or later): you can install these with diff --git a/Makefile b/Makefile index c77c0c51..fea4ef0d 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,11 @@ CFLAGS+=-std=gnu11 -O2 -g -MMD -Wall -fPIC \ $(EXTRA_CFLAGS) LDFLAGS+=$(CFLAGS) $(EXTRA_LDFLAGS) -CARGO_ARGS= +ifdef CARGO_TOOLCHAIN_VERSION + CARGO_TOOLCHAIN = +$(CARGO_TOOLCHAIN_VERSION) +endif + +CARGO_ARGS=${CARGO_TOOLCHAIN} CARGO=cargo $(CARGO_ARGS) CARGO_PROFILE=release # CARGO_PROFILE=debug diff --git a/rust-src/Cargo.toml b/rust-src/Cargo.toml index 92a3853f..444f0cf9 100644 --- a/rust-src/Cargo.toml +++ b/rust-src/Cargo.toml @@ -3,6 +3,7 @@ name = "bcachefs-rust" version = "0.3.1" authors = ["Yuxuan Shui ", "Kayla Firestack "] edition = "2018" +rust-version = "1.65" [lib] crate-type = ["staticlib"]