Skip to content

Test that uploaded crates can be parsed by all supported Cargo versions #580

@cuviper

Description

@cuviper

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 like cargo 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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-infrastructure 📡C-enhancement ✨Category: Adding new behavior or a change to the way an existing feature works

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions