diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d0d9bfc..c6b909e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,10 +19,9 @@ jobs: - ubuntu-latest - windows-latest - macos-latest - - macos-11 rust: - stable - - 1.46.0 # lib MSRV + - msrv - 1.64.0 # cli MSRV include: - os: ubuntu-latest @@ -30,47 +29,32 @@ jobs: lint: 1 - rust: stable rust-args: --all-features - - rust: 1.46.0 - old-cargo-compat: 1 - rust: 1.64.0 rust-args: --all-features - exclude: - # rust < 1.54 does not work on macos >= 12: - # https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20How.20can.20I.20fix.20Rust.201.2E53.2E0.20or.20earlier.20to.20run.20on.20macOS.2012.2E6.3F/near/299263887 - - os: macos-latest - rust: 1.46.0 - - os: macos-11 - rust: stable - - os: macos-11 - rust: 1.64.0 runs-on: ${{ matrix.os }} steps: - name: Checkout source uses: actions/checkout@v2 + - name: Select Rust version + shell: bash + run: | + RUST_VER="${{ matrix.rust }}" + if [ "$RUST_VER" = msrv ]; then + RUST_VER=$(cargo metadata --format-version 1 --no-deps | \ + jq -r '.packages[0].rust_version') + echo "MSRV: $RUST_VER" + fi + echo "RUST_VER=$RUST_VER" >> $GITHUB_ENV + - uses: actions-rs/toolchain@v1 with: - toolchain: ${{ matrix.rust }} + toolchain: ${{ env.RUST_VER }} default: true override: true - uses: Swatinem/rust-cache@v1 - - name: Compatibility fixes for older versions of cargo - if: matrix.old-cargo-compat - run: | - # If we're testing with Rust < 1.60, cargo won't be able to find - # the clap version specified in Cargo.lock, so remove the lockfile. - # This is safe because applications that only use us as a library - # will also ignore our Cargo.lock. - # https://users.rust-lang.org/t/optional-dependencies-and-msrv/82151 - cargo update -p clap --precise 3.2.25 - # Downgrade the following crates because they require edition 2021 - cargo update -p serde --precise 1.0.156 - cargo update -p thiserror --precise 1.0.39 - cargo update -p quote --precise 1.0.30 - cargo update -p proc-macro2 --precise 1.0.65 - - name: cargo test uses: actions-rs/cargo@v1 with: diff --git a/Cargo.toml b/Cargo.toml index 8818f26..014afc5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,8 @@ name = "gptman" version = "1.0.1" authors = ["Cecile Tonglet "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" +rust-version = "1.63" description = "A GPT manager that allows you to copy partitions from one disk to another" repository = "https://github.com/rust-disk-partition-management/gptman" homepage = "https://github.com/rust-disk-partition-management/gptman" @@ -33,11 +34,7 @@ pad = { version = "0.1", optional = true } unicode-width = { version = "0.1.8", optional = true } linefeed = { version = "0.6.0", optional = true } rand = { version = "0.8", optional = true } -# We don't actually support clap 3. But cargo < 1.60 ignores clap versions -# >= 4, and our MSRV is lower than that when the CLI is disabled. Ensure -# older cargo can find _some_ clap version so it won't fail. -# https://users.rust-lang.org/t/optional-dependencies-and-msrv/82151 -clap = { version = ">= 3, < 5", optional = true, features = ["derive", "wrap_help"] } +clap = { version = "4", optional = true, features = ["derive", "wrap_help"] } count-zeroes = { version = "0.2.0", optional = true } [features] diff --git a/README.md b/README.md index 963b878..171e380 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![Rust](https://github.com/rust-disk-partition-management/gptman/actions/workflows/rust.yml/badge.svg) [![Latest Version](https://img.shields.io/crates/v/gptman.svg)](https://crates.io/crates/gptman) -![Rust 1.46+](https://img.shields.io/badge/rust-1.46%2B-orange.svg) +![Rust 1.63+](https://img.shields.io/badge/rust-1.63%2B-orange.svg) ![License](https://img.shields.io/crates/l/gptman) [![Docs.rs](https://docs.rs/gptman/badge.svg)](https://docs.rs/gptman) [![LOC](https://tokei.rs/b1/github/rust-disk-partition-management/gptman)](https://github.com/rust-disk-partition-management/gptman)