Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: bump MSRV to 1.65.0 #171

Merged
merged 1 commit into from
May 12, 2023
Merged

build: bump MSRV to 1.65.0 #171

merged 1 commit into from
May 12, 2023

Conversation

joshka
Copy link
Member

@joshka joshka commented May 9, 2023

The latest version of the time crate requires Rust 1.65.0

cargo +1.64.0-x86_64-apple-darwin test --no-default-features \
  --features serde,crossterm,all-widgets --lib --tests --examples
error: package `time v0.3.21` cannot be built because it requires rustc
1.65.0 or newer, while the currently active rustc version is 1.64.0

The calendar widget added a dependency on time v0.3.11 (though a quick check suggests that 0.3.9 compiles, I'm unsure if the later bug fixes are notable for ratatui. Regardless, the dependency requirement is satisfied by any version later than 0.3.11. Later versions require rust 1.65.0, so our MSRV is 1.65.0.

I don't think there's an obvious way to only specify a MSRV for a specific set of features (i.e. 1.59 if you're not using termwiz/calendar), though perhaps we leave this as 1.59, and create a specific 1.59 test in the ci that doesn't test calendar and termwiz. I'm not certain I know why we'd do that (ping @rhysd for input on what the reason for supporting 1.59 was in #85

I'm a rust noob, so my experience with the impact of choosing an MSRV is limited. I've seen a few libraries that state a policy of supporting stable minus 2 version, which seems reasonable on the face of it. If we took that approach, we'd go with 1.67 which was released Jan (26 2023). But we only "need" to go to 1.65 for now.

@sophacles
Copy link
Contributor

Re: failures - I didn't know numeric types had From<bool> now!

Re msrv and dependencies and how they interact - that's still open and ongoing discussion: rust-lang/cargo#9930

I think bumping this is fine, probably a good idea to make clippy happy at the same time.

The latest version of the time crate requires Rust 1.65.0

```
cargo +1.64.0-x86_64-apple-darwin test --no-default-features \
  --features serde,crossterm,all-widgets --lib --tests --examples
error: package `time v0.3.21` cannot be built because it requires rustc
1.65.0 or newer, while the currently active rustc version is 1.64.0
```

Also fixes several clippy warnings added in 1.63/1.65. Although these
have been since moved to nursery / pedantic, it doesn't hurt to fix
these issues as part of this change:

- https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq (nursery)
- https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if (pedantic)
@joshka
Copy link
Member Author

joshka commented May 9, 2023

Pushed clippy fixes (and added the following to the commit):

Also fixes several clippy warnings added in 1.63/1.65. Although these have been since moved to nursery / pedantic, it doesn't hurt to fix these issues as part of this

README.md Show resolved Hide resolved
@orhun
Copy link
Member

orhun commented May 11, 2023

Interestingly enough, when I run cargo-msrv it says the MSRV is 1.60.0.

However if I run cargo msrv -- cargo check --features all-widgets then the MSRV is 1.63.0

cap

For some reason, I get different results from this PR. Is there any other way to validate?

@joshka
Copy link
Member Author

joshka commented May 11, 2023

For some reason, I get different results from this PR. Is there any other way to validate?

Yep, run cargo update - the time crate is at 0.3.21 which requires rust 1.65.0.

❯ cargo msrv -- cargo check --all-features
Fetching index
Determining the Minimum Supported Rust Version (MSRV) for toolchain x86_64-apple-darwin
Using check command cargo check --all-features

Check for toolchain '1.63.0-x86_64-apple-darwin' failed with:
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ error: package `time-core v0.1.1` cannot be built because it requires rustc 1.65.0 or newer, while the currently active rustc version is    │
│ 1.63.0                                                                                                                                      │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Check for toolchain '1.66.1-x86_64-apple-darwin' succeeded

Check for toolchain '1.64.0-x86_64-apple-darwin' failed with:
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ error: package `time v0.3.21` cannot be built because it requires rustc 1.65.0 or newer, while the currently active rustc version is 1.64.0 │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Check for toolchain '1.65.0-x86_64-apple-darwin' succeeded
   Finished The MSRV is: 1.65.0   ████████████████████████████████████████████████████████████████████████████████████████████████████ 00:00:06

@orhun
Copy link
Member

orhun commented May 12, 2023

Yep, run cargo update - the time crate is at 0.3.21 which requires rust 1.65.0.

Good point! I got 1.65.0 as MSRV now.

@orhun orhun changed the title build: bump MSRV to 1.65 build: bump MSRV to 1.65.0 May 12, 2023
@orhun orhun merged commit 1cc405d into ratatui:main May 12, 2023
@joshka joshka deleted the chore-msrv branch July 4, 2023 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants