-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Proposal: Add a minimal-rust-version
flag to crates manifest
#2751
Comments
I would suggest using a more generic term than |
Thanks for the report! This has been brought up a few times before (#1214, #837, #1044, #967), but I'm not sure enough has changed to work with this just yet. Right now it would basically amount in a fancy error message indicating "this compiler won't work", and it wouldn't really be used for anything else. That is, you specifically don't have a guarantee that the crate actually builds and works on any version of Rust, you'd just have to test and find out. This could perhaps one day affect resolution as well where if you are targeting Rust < 1.4 then you wouldn't accidentally pick up crates which explicitly require > 1.4, but even then there are no guarantees as all crates may not be annotated as such. Overall I suspect that we'd want to flesh this out in an RFC (or something similar) before adding this to Cargo. Concretely, I'd want to see if we can get any hard guarantees from this, as that would definitely help justify an implementation! |
I read the other issues and the essence there is to fix the compiler version. The same could happen with a upper and a lower bounary. Since the rust compiler guaranties it will be able to compile anthing since 1.0 newer compilers should allways be able to compile old code. Atleast in the 1.X.Y releases. I am thinking about writing an RFC, would that be a regular rust RFC or a cargo RFC? |
Ah right now we don't have a Cargo-specific RFC repo it'd just be in the standard rust-lang/rfcs repo |
Quoting from #3298: It would be nice for those working with particular snapshots of nightly if it would be possible to fix the toolchain in the Cargo.toml file, e.g., something like:
and if cargo would use rustup to get the appropriate toolchain.
This is true for the stable release channel only, but some crates require nightly, and some crates require specific nightly versions. |
This hasn't had a lot of activity recently. But one example of where this would be helpful can be found here: sharkdp/fd#43. The fd project specifies a minimum rust version in the README. But if someone fails to read that, it isn't obvious from the compile error that the problem is they need a newer version of rustc. Just having a better error message if someone tries to compile with an older version of rustc would be useful. It would also be nice to show on crates.io which rust version is required for a crate. |
There have been a number of RFCs on this issue, none of which have been merged yet:
Given that it's clear this request needs an RFC, I'm going to close this issue. |
All of those RFCs are now closed and I couldn't find any others that are still open. There is this related one that's open, but seems to be about cargo versioning, not rust versioning: rust-lang/rfcs#2182 |
@ehsanul the current RFC is rust-lang/rfcs#2495 |
Hi all
Rust is introducing new keywords every now and then. Up until now the community just upgraded to the latest compiler within days, but this will change as soon as the compiler is installed with the package manager of the users distro.
Currently there seem to be only two distros providing a package for rust:
I propose a
minimal-rust-version
for the manifest to guard against scenarios like this:Crate A with version 1.3.0 would like to add a new feature, e.g.
#[deprecated]
What do you think?
Regards
dns2utf8
The text was updated successfully, but these errors were encountered: