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

msrv 1.65.0 doesn't work #427

Closed
eric-seppanen opened this issue Dec 20, 2024 · 5 comments · Fixed by #430
Closed

msrv 1.65.0 doesn't work #427

eric-seppanen opened this issue Dec 20, 2024 · 5 comments · Fixed by #430

Comments

@eric-seppanen
Copy link
Contributor

Individual crates advertise rust-version = 1.65.0.

However, russh-sftp = "2.0.5" has dependencies that won't build on 1.65.0, e.g. flurry:

error[E0658]: use of unstable library feature 'build_hasher_simple_hash_one'
   --> /home/eric/.cargo/registry/src/github.com-1ecc6299db9ec823/flurry-0.5.0/src/lib.rs:288:5
    |
288 | /     fn hash_one<T: std::hash::Hash>(&self, x: T) -> u64
289 | |     where
290 | |         Self: Sized,
291 | |     {
292 | |         self.0.hash_one(x)
293 | |     }
    | |_____^

russsh-> russh-sftp 2.0.5 -> flurry 0.5 and all 0.5.x versions of flurry require at least rust 1.71.

I also don't see anything in CI that tests that the msrv works. It's very hard to guarantee a reliable msrv without automated checks.

@EpicEric
Copy link
Contributor

Current MSRV was 1.79.0 from my tests, although I have yet to run a tool like cargo-msrv to confirm.

@eric-seppanen
Copy link
Contributor Author

The problem with testing this in CI is you have to get a Cargo.lock that brings in minimally-old versions of dependencies, but many crates don't accurately advertise their msrv, or have latent bugs where their Cargo.toml requires some dependency version 1.0.0 but they accidentally used features that only exist in dependency version 1.0.3. (#419 is an example of this, actually).

In the future this may get easier when the Cargo "msrv-aware resolver" is stable. Right now I don't know if there's a faster way than manually fiddling with dependency versions until you either get something that compiles, or you reach a dead end like I did above.

@ericseppanen
Copy link
Contributor

I ran some experiments using cargo minimal-versions and found that the current msrv is 1.79, but it could go as low as 1.75 if the NonZero<usize> is changed to NonZeroUsize.

There are a number of dependency declarations that need to be fixed for cargo minimal-versions to run; I'll send those as a separate PR. There is one dependency (home) that needs a manual downgrade to run on older toolchains, but it might be possible to make an automated check. It would probably have some maintenance overhead, as running cargo minimal-versions also requires cargo hack and a nightly toolchain.

@Eugeny Eugeny mentioned this issue Dec 21, 2024
@Eugeny
Copy link
Owner

Eugeny commented Dec 21, 2024

@eric-seppanen I've managed to get MSRV back to 1.65 in #430 and add CI check - excluding example dependencies (russh-sftp) and WASM, which require 1.73

The crates per se will compile under 1.65, however the full workspace will require 1.73+

@Eugeny
Copy link
Owner

Eugeny commented Dec 21, 2024

I've ended up having to abandon the effort to lower the full-workspace MSRV due to the ratatui examples - not that it matters in the end

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 a pull request may close this issue.

4 participants