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

crate home MSRV bumped in "compatible version" #14944

Closed
tisonkun opened this issue Dec 17, 2024 · 15 comments
Closed

crate home MSRV bumped in "compatible version" #14944

tisonkun opened this issue Dec 17, 2024 · 15 comments
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@tisonkun
Copy link

tisonkun commented Dec 17, 2024

Problem

error: rustc 1.80.0 is not supported by the following package:
  home@0.5.11 requires rustc 1.81

I have this dependency in cargo.toml:

home = "0.5.9"

Such breaking changes deserve 0.6.0.

Steps

Image

Possible Solution(s)

yank 0.5.11 and release 0.6.0

Notes

No response

Version


@tisonkun tisonkun added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Dec 17, 2024
@tisonkun tisonkun changed the title MSRV bumped in "compatible version" crate home MSRV bumped in "compatible version" Dec 17, 2024
@tisonkun
Copy link
Author

cc @ehuss

@epage
Copy link
Contributor

epage commented Dec 17, 2024

MSRV bumps are generally recognized as minor, not major changes, see https://doc.rust-lang.org/nightly/cargo/reference/semver.html#env-new-rust

@epage
Copy link
Contributor

epage commented Dec 17, 2024

We previously discussed this in #13270. Per that discussion, I'm closing this.

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Dec 17, 2024
@tisonkun
Copy link
Author

tisonkun commented Dec 17, 2024

MSRV bumps are generally recognized as minor, not major changes, see https://doc.rust-lang.org/nightly/cargo/reference/semver.html#env-new-rust

This is reasonable, while I'd ask a bit details on cargo's mechanism.

When I specify "foo = 1.2", will it gets auto resolved to 1.3.x? That is, when I specify "home = 0.5.9", it could be resolved to "home = 0.5.11". But if we specify "foo = 1.2", it would only resolves to 1.2.x?

If so, then "minor changes" means different things in these two situations.

@tisonkun
Copy link
Author

That said, you can bump MSRV when bump 1.2 to 1.3, and build won't break with the most common dependency string. But from 0.5.9 to 0.5.11 does.

@tisonkun
Copy link
Author

I see https://doc.rust-lang.org/nightly/cargo/reference/resolver.html#semver-compatibility

bitflags = "1.1"  # meaning `>=1.1.0,<2.0.0`

Then I'm fine with Rust's definition now .. let me see how to get used to it.

@epage
Copy link
Contributor

epage commented Dec 17, 2024

foo = "1.2" means foo = ">=1.2.0,<2.0.0".

Build environment changes are not usually included in semver in Rust. If not, Rust itself would be on v20 or so with glibc, AndroidNDK, Linux Kernel, etc changes. Foundational crates like serde could never change their MSRV. Builds would be slower due to the duplication of dependencies. Users with higher MSRV can be stuck on old, buggy, less featureful versions of their transitive deps because one dep has a lower MSRV.

In 1.84 we'll have an opt-in MSRV-aware resolver. You can have it generate your lockfile and than use whatever version of Cargo you want.

@tisonkun
Copy link
Author

In 1.84 we'll have an opt-in MSRV-aware resolver. You can have it generate your lockfile and than use whatever version of Cargo you want.

Cool! Is there a tracking issue I can watch on?

@weihanglo
Copy link
Member

This was stabilized in 1.83 in #14639.

Hum… the version here seems wrong, @epage ?

@epage
Copy link
Contributor

epage commented Dec 17, 2024

Missed that one

@Ari-suhyeon
Copy link

The sudden version restriction is causing problems with my builds too.
The problem is that it's not easy to find which crate has which dependencies...
Debug works fine, release doesn't.
Does anyone know how to fix it?

@weihanglo
Copy link
Member

The problem is that it's not easy to find which crate has which dependencies...

cargo tree -i home could help.
See https://doc.rust-lang.org/nightly/cargo/reference/features.html#inspecting-resolved-features.

Does anyone know how to fix it?

cargo update home --precise 0.5.9. See also harryfei/which-rs#103 (comment)

@Ari-suhyeon
Copy link

I don't use the home crate directly.
Of course I have used the cargo tree -i home command, but it only specifies home v0.5.9.
I use polars and kube-rs, and those crates also specify v0.5.9.
I am building docker, and the image uses FROM rust:1.78.0-slim.

@Ari-suhyeon
Copy link

I've identified the cause.
(The dependency was created because kube-client and polars are using home crate)
When I do a Docker build, the Cargo.lock file doesn't exist, so you create it and build it.
In the existing Cargo.lock file on my local PC, the home version was specified as '0.5.9', so it worked fine, but when I built without the lock file, it was changed to '0.5.11' and the lock file was created.
It seems that 0.5.9 and 0.5.11 are compatible according to SemVer compatibility, so it changes to 0.5.11.
https://doc.rust-lang.org/cargo/reference/resolver.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

4 participants