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

Cargo versioning #2182

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@joshtriplett
Copy link
Member

joshtriplett commented Oct 19, 2017

Rendered

RFC co-authored by myself and @wycats, and pre-reviewed by @alexcrichton.

@withoutboats

This comment has been minimized.

Copy link
Contributor

withoutboats commented Oct 19, 2017

To summarize the RFC as I understand it: the idea is that cargo can figure out your minimum version requirements based on what features of cargo are necessary to compile it, and that it will then record it in the index entry for your crate. This will then influence error messages and version resolution. The user interface doesn't need to change to support this (that is, you don't specify a minimum version in your Cargo.toml).

Is that right?

@bryteise

This comment has been minimized.

Copy link

bryteise commented Oct 19, 2017

Would it be possible to allow an optional cargo version number if crate authors want to be able to enforce they will be using other newer features of cargo but currently do not?

@joshtriplett

This comment has been minimized.

Copy link
Member Author

joshtriplett commented Oct 19, 2017

@withoutboats Correct. This is best-effort, and if the schemas turn out to be incorrect we can fix bugs in them.

@bryteise Perhaps, though the default Cargo.toml should not include a version number. But I think the reverse seems more important: "don't let me use any features from Cargo newer than this". Again, best-effort, but useful as a local development complement to a good CI system.

@Ericson2314

This comment has been minimized.

Copy link
Contributor

Ericson2314 commented Feb 5, 2018

Sorry to take so long to get to this. This is generally quite good, but I am also a bit wary of no manual recourse in Cargo.toml files themselves. In particular, the tentative ideas about non-registry dependencies:

For crates obtained via alternate registries or directly from version control or filesystem paths, Cargo may attempt to use the schema provided by crates.io-index to parse the Cargo.toml file and distinguish types of errors, but may have to continue and warn rather than stopping with an error.

seem sub-par. crates.io access for non-crates.io deps seems likely to cause confusion, non-determinism, and annoyance when there is no internet access. An optional schema version in Cargo.toml circumnavigates the any need for such heuristics.

@Ericson2314

This comment has been minimized.

Copy link
Contributor

Ericson2314 commented Feb 5, 2018

N.B. haskell/cabal#4899 is the plan for schema versions for Cabal. Their situation is more awkward because Cabal files are a non-standard syntax, in addition to schema within that syntax, but I'd thought i'd still link for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.