Skip to content

Commit

Permalink
Bump MSRV to 1.66
Browse files Browse the repository at this point in the history
toml_edit requires it.

```
error: package `toml_edit v0.19.15` cannot be built because it requires rustc 1.66.0 or newer, while the currently active rustc version is 1.65.0
```
  • Loading branch information
taiki-e committed Sep 8, 2023
1 parent 7c51206 commit 3f383d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "cargo-hack"
version = "0.6.5"
edition = "2021"
rust-version = "1.65"
rust-version = "1.66"

This comment has been minimized.

Copy link
@epage

epage Sep 8, 2023

Contributor

Why not check-in a lockfile?

This comment has been minimized.

Copy link
@taiki-e

taiki-e Sep 8, 2023

Author Owner

I'm intentionally not committing lockfile.
Long explanations can be found here (bin) and here (lib), but I think it's important that the documentation about MSRV doesn't lie even if the user uses that crate in the default way (cargo install <crate> (bin) or adding <crate> = "<latest>" to Cargo.toml (lib)).

cargo-hack/.gitignore

Lines 2 to 4 in 3f383d6

# There is binary in the workspace, but intentionally not committing lockfile.
# See https://github.com/taiki-e/cargo-llvm-cov/pull/152#issuecomment-1107055622 for more.
Cargo.lock

This comment has been minimized.

Copy link
@epage

epage Sep 8, 2023

Contributor

I'd recommend reconsidering this

  • If anything is yanked, your project can't build
  • If you want the MSRV to "never lie" then that is impossible because any time a new dependency comes out, it will then be wrong. MSRV is not about every possible version but that a set of versions exist
  • On error, cargo will now recommend using --locked which will let people get past other problems which was specifically added to help with MSRV above
  • We are actively working to improve the MSRV experience
  • RenovateBot, while it has its flaws, is a lot better than Dependabot. Check out my configuration for a bin workspace and checkout example PRs

This comment has been minimized.

Copy link
@taiki-e

taiki-e Sep 8, 2023

Author Owner
  • If anything is yanked, your project can't build

No. As described in the issue I linked, cargo publishes the lockfile even if it is not committed, so yanking doesn't prevent users from building.

  • If you want the MSRV to "never lie" then that is impossible because any time a new dependency comes out, it will then be wrong. MSRV is not about every possible version but that a set of versions exist

Personally, I think MSRV (as documented at the time of release) should be considered the minimum version that can be built when using the latest dependencies at the time of the release of that version.

It's okay to break if a dependency updates MSRV after release (although I need to bump MSRV like in this commit). Users can use --locked to build with the latest dependencies at the time of the release of that version.

As far as I know, that is the best we can actually guarantee at this time, and I want to guarantee that as much as possible.

Well, as I said in the second issue I linked, this is not best from a maintenance cost point of view, so I wouldn't actively recommend this method to others.

license = "Apache-2.0 OR MIT"
repository = "https://github.com/taiki-e/cargo-hack"
keywords = ["cargo", "subcommand", "testing"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ fields of [`cargo metadata`][cargo-metadata].*
cargo +stable install cargo-hack --locked
```

*Compiler support: requires rustc 1.65+*
*Compiler support: requires rustc 1.66+*

cargo-hack is usually runnable with Cargo versions older than the Rust version
required for installation (e.g., `cargo +1.31 hack check`). Currently, to run
Expand Down

0 comments on commit 3f383d6

Please sign in to comment.