From 4574d8751a63500faed7dc4407aa0514cc5d59eb Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Fri, 3 Apr 2026 16:19:47 +0100 Subject: [PATCH] Specify the minimum supported Rust version --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ Cargo.toml | 2 ++ README.md | 4 ++++ cpp/Cargo.toml | 1 + cpp/README.md | 4 ++++ 5 files changed, 43 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c2c2cd5..b8363bca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,38 @@ jobs: cargo vet --version cargo vet --locked + msrv: + strategy: + matrix: + os: + - windows-2025 + - ubuntu-24.04 + + runs-on: ${{ matrix.os }} + + env: + EXPECTED_MSRV: "1.89" + + steps: + - uses: actions/checkout@v6 + + - uses: actions/cache@v5 + id: cache-cargo + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-msrv-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Install Rust v${{ env.EXPECTED_MSRV }} + run: rustup install ${{ env.EXPECTED_MSRV }} + + - name: Run cargo build using Rust v${{ env.EXPECTED_MSRV }} + run: cargo +${{ env.EXPECTED_MSRV }} build --package libloot --package libloot-cpp + rust: strategy: matrix: diff --git a/Cargo.toml b/Cargo.toml index 62408bb1..402b3f24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ version.workspace = true repository.workspace = true edition.workspace = true license.workspace = true +rust-version.workspace = true [dependencies] crc32fast = "1" @@ -43,6 +44,7 @@ repository = "https://github.com/loot/libloot.git" edition = "2024" license = "GPL-3.0-or-later" categories = ["games"] +rust-version = "1.89" # Deny some rustc lints that are allow-by-default. [workspace.lints.rust] diff --git a/README.md b/README.md index 9bc70e74..bd708f1b 100644 --- a/README.md +++ b/README.md @@ -86,3 +86,7 @@ The tests can then be run using: ``` cargo test ``` + +## Minimum supported Rust version + +The minimum supported Rust version is `1.89`. This may change at any time, but there is a CI job to check that it does not change unexpectedly. diff --git a/cpp/Cargo.toml b/cpp/Cargo.toml index 33619803..44ed3156 100644 --- a/cpp/Cargo.toml +++ b/cpp/Cargo.toml @@ -6,6 +6,7 @@ version.workspace = true repository.workspace = true edition.workspace = true license.workspace = true +rust-version.workspace = true [dependencies] cxx = { version = "1.0.192", features = ["c++17"] } diff --git a/cpp/README.md b/cpp/README.md index 697fb481..df39bfaf 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -83,3 +83,7 @@ To package the build: ``` cpack --config build/CPackConfig.cmake -C RelWithDebInfo ``` + +## Minimum supported Rust version + +The minimum supported Rust version is `1.89`. This may change at any time, but there is a CI job to check that it does not change unexpectedly.