Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upProposal: Add a `minimal-rust-version` flag to crates manifest #2751
Comments
This comment has been minimized.
This comment has been minimized.
|
I would suggest using a more generic term than |
This comment has been minimized.
This comment has been minimized.
|
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! |
This comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
|
Ah right now we don't have a Cargo-specific RFC repo it'd just be in the standard rust-lang/rfcs repo |
Ryman
referenced this issue
Nov 14, 2016
Closed
Extending accepted metadata is a potential backcompat hazard #3291
This comment has been minimized.
This comment has been minimized.
gnzlbg
commented
Nov 18, 2016
|
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. |
NikVolf
referenced this issue
Mar 15, 2017
Merged
Detect rust compiler version in Parity build script, closes 4742 #4907
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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. |
carols10cents
closed this
Sep 25, 2017
This comment has been minimized.
This comment has been minimized.
ehsanul
commented
Feb 21, 2018
|
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 |
dns2utf8 commentedMay 29, 2016
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-versionfor 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