Skip to content

Commit

Permalink
Update library MSRV to 1.63 and edition to 2021 (#120)
Browse files Browse the repository at this point in the history
1.63 is one year old, and is available in Debian and Ubuntu stable
releases.

Fixes #119.
  • Loading branch information
bgilbert authored Aug 3, 2023
1 parent 058bb1a commit 683188e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 36 deletions.
42 changes: 13 additions & 29 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,58 +19,42 @@ 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
rust: stable
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:
Expand Down
9 changes: 3 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name = "gptman"
version = "1.0.1"
authors = ["Cecile Tonglet <cecile.tonglet@cecton.com>"]
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"
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 683188e

Please sign in to comment.