-
-
Notifications
You must be signed in to change notification settings - Fork 779
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
Rust 1.48 support broken by resolver
field in packaged Cargo.toml
#2255
Comments
Encountered the same issue in one of my projects. Considering that serde 1.0.142 still worked with rustc 1.48 and seeing that serde 1.0.143 does not, let's take a look at the changes between those two versions: v1.0.142...v1.0.143 |
The serde 1.0.143 crate does not build on this project's current MSRV (rustc 1.48), so it's reverted to the previous version. See <serde-rs/serde#2255> for the corresponding upstream issue.
Looks like this is probably rust-lang/cargo#10954 |
According to that issue its not in stable, though? So presumably whoever does serde uploads needs to just bump the version and do a re-upload using stable cargo? |
I followed up with @dtolnay on twitter DM about this, and his response was that there is no MSRV policy for serde, and thus this is an issue that is not likely to be fixed. I believe this issue can be closed. |
Since serde's own metadata claims to support 1.13+, I'll leave this open until the next serde release is pushed. Should help community members who hit this in the meanwhile. |
Yes, his comment to me, specifically, was:
|
Hmm ... I find that a bit odd. 🤷 Sure, the readme could be argued about. But when even the cargo manifest shows something as rustc 1.13+, only to find out it actually requires something more like rustc 1.50+ when used in a project feels a bit like false advertising to me. So either the readme and manifest should be updated, or the crate should be rebuild with stable cargo which does not have that bug. There even is a dedicated CI job named I am aware that this may sound a bit harsh, especially considering that this issue is boils down to a bug in cargo and not in serde. So the serde developers are not even to blame for this. However, with such an important and widely used crate like serde this could potentially cause trouble for a lot of other projects that depend on serde. In my opinion, deciding not to fix this is not really helpful. So I am still hoping that one of the next serde releases comes with a fix for that - whether its just updating the MSRV or getting rid of that troublesome |
After conversation in Twitter DM re: serde-rs#2255, it became clear that serde does not, in fact, have a specific MSRV policy, but rather strives to be buildable with older rustc as only a practical matter. This led to some confusion from users, as the `rust-version` Cargo.toml tag is often used to communicate a specific MSRV policy. Thus, this PR simply removes references which could be confused for a specific MSRV policy, leaving a comment in CI that the test with older rustc's does not imply a specific policy.
After conversation in Twitter DM re: serde-rs#2255, it became clear that serde does not, in fact, have a specific MSRV policy, but rather strives to be buildable with older rustc as only a practical matter. This led to some confusion from users, as the `rust-version` Cargo.toml tag is often used to communicate a specific MSRV policy. Thus, this PR simply removes references which could be confused for a specific MSRV policy, leaving a comment in CI that the test with older rustc's does not imply a specific policy.
Nix's code hasn't changed. However, Serde accidentally raised its MSRV to 1.51.0 in a patch release, due to a Cargo bug. They don't plan to change it back. Nix does not depend on Serde, but it's used by cargo-hack, which we build as part of our CI process. So we need to either raise our MSRV, or else install a separate toolchain during CI just to build cargo-hack. serde-rs/serde#2255
Where does the |
In Suricata we try to support the Rust versions as they are shipped by the major (Linux) distributions, so Suricata can be packaged. For this reason we maintain a table of OS' that are important to us. Debian 11 (current stable) is the lowest, at Rust version 1.48. I think especially projects that are not pure Rust (like Suricata, which is C+Rust) care more about distro packaging and support, since we know our users do. We're maintaining our table here: https://redmine.openinfosecfoundation.org/issues/4163 (screenshot added for reference) I think would be great if Serde, and all other projects, would define a clear MSRV policy to help users of the crates ecosystem know what to expect. |
Since there's a mismatch between |
Having the same issue, i started getting from today, it was totally working fine couple of weeks back. I have used other versions of rust as well, but nothing was fruitful. |
As said in #2259, the problem should be automatically resolved when the maintainer creates a new release using the nightly toolchain after nightly-2022-08-13 (tomorrow). |
1792: Raise the MSRV to 1.56.1 r=rtzoeller a=asomers Nix's code hasn't changed. However, Serde accidentally raised its MSRV to 1.51.0 in a patch release, due to a Cargo bug. They don't plan to change it back. Nix does not depend on Serde, but it's used by cargo-hack, which we build as part of our CI process. So we need to either raise our MSRV, or else install a separate toolchain during CI just to build cargo-hack. serde-rs/serde#2255 Co-authored-by: Alan Somers <[email protected]>
This has been fixed in 1.0.144: https://docs.rs/crate/serde/1.0.144/source/Cargo.toml |
I'm still very confused as to the MSRV for serde. Should we be looking to rip serde out to get a consistent MSRV, or is the policy going to be made more clear? I admit I'm a bit confused why bother going to the hassle of making serde compile on rustc 1.1X if that's not going to be an MSRV. |
Very good. :)
I think the lesson here is that one can not really uphold a MSRV guarantee in one's own projects without pinning the dependencies down to exact versions via |
This doesn't help libraries, only binary projects. Libraries which, themselves, wish to provide a concrete MSRV policy cannot do so without ensuring their dependencies meet the same MSRV policy. Up until today, as evidenced by the discussion on this bug, many downstream projects of serde provided an MSRV which clearly was not sustainable given serde's MSRV policy (or lack thereof). Hence my request for clarification. The rust languages' attempt to work towards this was, at least in part, the rust-version field in Cargo.toml. Sadly it appears serde set this without actually "supporting" the rust-version in that field. |
I have a failure in PyO3 CI which I can also reproduce locally.
Looking at the unpacked
Cargo.toml
it containsresolver = "1"
- I wonder if thecargo package
process has somehow added this and broken support for older cargo versions?The text was updated successfully, but these errors were encountered: