From f136e0601dcebbff900c3a2f8f438fe2762e1f2c Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Tue, 9 Apr 2024 14:25:45 +0200 Subject: [PATCH] Update MSRV following `rust-toolchain.toml` (#12455) Also update the `rust-version` in `Cargo.toml` following the update to `rust-toolchain.toml` in #12258 Added a CI check to verify any future PRs trying to update one will also have to update the other. (using `std-lib-and-python-virtualenv` job as this already includes a fresh `nu` binary for a little toml munching script) --- .github/workflows/check-msrv.nu | 12 ++++++++++++ .github/workflows/ci.yml | 3 +++ Cargo.toml | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check-msrv.nu diff --git a/.github/workflows/check-msrv.nu b/.github/workflows/check-msrv.nu new file mode 100644 index 0000000000..f0c92fea11 --- /dev/null +++ b/.github/workflows/check-msrv.nu @@ -0,0 +1,12 @@ +let toolchain_spec = open rust-toolchain.toml | get toolchain.channel +let msrv_spec = open Cargo.toml | get package.rust-version + +# This check is conservative in the sense that we use `rust-toolchain.toml`'s +# override to ensure that this is the upper-bound for the minimum supported +# rust version +if $toolchain_spec != $msrv_spec { + print -e "Mismatching rust compiler versions specified in `Cargo.toml` and `rust-toolchain.toml`" + print -e $"Cargo.toml: ($msrv_spec)" + print -e $"rust-toolchain.toml: ($toolchain_spec)" + exit 1 +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98a93d3ad3..05dc2310b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,6 +130,9 @@ jobs: - name: Standard library tests run: nu -c 'use crates/nu-std/testing.nu; testing run-tests --path crates/nu-std' + - name: Ensure that Cargo.toml MSRV and rust-toolchain.toml use the same version + run: nu .github/workflows/check-msrv.nu + - name: Setup Python uses: actions/setup-python@v5 with: diff --git a/Cargo.toml b/Cargo.toml index c3f94d48a2..827ff07514 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ homepage = "https://www.nushell.sh" license = "MIT" name = "nu" repository = "https://github.com/nushell/nushell" -rust-version = "1.74.1" +rust-version = "1.75.0" version = "0.92.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html