-
Notifications
You must be signed in to change notification settings - Fork 636
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
Test that uploaded crates can be parsed by all supported Cargo versions #580
Comments
I'm sort of surprised that this is so much of an issue, this basically means that we can't fix bugs in Cargo? |
That seems a rather extreme slippery-slope conclusion. Taking a step back, to what extent does crates.io expect to allow usage by older Cargo? |
I guess put another way, let's say we want to close this issue as solved. Older cargo had a bug where it can't parse I'm all for supporting as many versions of Cargo as possible, but I don't think it should hold us back. Upgrading cargo isn't suppose to be hard, just a |
I don't have a problem with having fixed that bug in Cargo. The problem I see is that crates.io started publishing data that older Cargo can't handle, and we didn't realize it. And in this case, the effect is so nasty that even older crates that used to work fine are now made inaccessible just by having a newer version with this incompatible syntax. So at a minimum, I'm asking for testing so we know before something breaks. From there, we can make deliberate choices about it. Maybe we raise the minimum bar for Cargo versions, but do so knowingly. Maybe it doesn't have to break at all, but some compatibility path can be added, like moving the new functionality to a new API version. It all depends on the nature of the change.
This is only true in the Wild West of a pre-distro Rust ecosystem. The continued success of Rust also means |
There was also the addition of quoted keys to TOML recently which is used for some cargo features. This however only prevents use of versions of crates that use them with older cargo rather than breaking the crate regardless of the version used like the issue that prompted this. This would however be detected by automatic testing of crates' Cargo.toml, and I think doing that would produce a large number of failures for use of new cargo features. |
I see a few issues here:
I think there should be another crates.io issue for 1, this issue should be for 2, and someone should start an RFC for 3 (i'm not necessarily volunteering, but i'm not NOT volunteering either) What do yinz think? |
@TechnoMancer hmm, that's a good argument that I'm not quite targeting this at the right place. It would be somewhat OK, though not desirable, if some new syntax of @carols10cents I think I agree with your breakdown, yes. In 2 I'd like to see compatibility testing of crates.io itself. Your 3 is a bigger question, yes. However, I made a casual comment about this in the context of roadmap 1.0 crates, that Cargo isn't even there, and I was corrected that |
@carols10cents your strategy sounds good to me. I'd also echo what @cuviper said in that while Cargo does not literally declare itself as 1.0.0 it's practically infeasible to introduce breaking changes to it now anyway. |
@cuviper @carols10cents re: LTS, this is something the core team has long been interested in. If either of you are up for writing an RFC, I'd be glad to help mentor! |
This hasn't been active in a long time: Is it still an issue? Also, could someone with permissions change the title so that it's more searchable? - Test that uploaded crates can be parsed by all supported Cargo
+ Test that uploaded crates can be parsed by all supported Cargo versions Thanks! |
since there hasn't been any real activity on this for five years and cargo has passed the 1.0 version bump I will close this issue now. from what I've seen so far the cargo team is quite diligent on avoiding breaking changes to the toml files these days. |
I think this deserves clarification:
That came from rust-lang/cargo#5083 to close rust-lang/cargo#4211. So this was motivated by a "1.0" perception of stability for the CLI, but wasn't a material change in itself. The tool was de facto stable already. |
As noted in this urlo thread, Cargo <= 0.8 can't parse dependencies with pre-release version requirements, e.g. serde 0.9.0 requires
serde_derive = "0.9.0-rc4"
, and this goes so far as to prevent such crates from being used at all, not even its older versions, not even if a new version is published and the one with the pre-release requirement is yanked.I don't know if there's anything that can be done for that case at this point, but it would be nice to prevent similar accidents from happening in the future. AIUI, it's generally the intent that the
Cargo.toml
format should remain compatible with old Cargo, at least for parsing, even if that old Cargo wouldn't understand some of the fields. So I think it would be a good idea for crates.io to do a sanity check on uploaded crates, perhaps something likecargo generate-lockfile
using whatever baseline cargo version we still want to support in the ecosystem.(It's understood that not all crates can build/test with older rustc/cargo, especially given the existence of crates using nightly-only features.)
The text was updated successfully, but these errors were encountered: