-
Notifications
You must be signed in to change notification settings - Fork 953
Consider supporting MSRV in rustup #1484
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
Comments
This ^^^ |
Will rustup respect the minimum Rust version RFC that was recently approved? If so, I think that would address my main use case. |
I had not seen that RFC, no right now "no" but it looks very interesting. If you're sure that would make the most sense, then I think I'll retitle this issue "Consider supporting MSRV in rustup" so we can work out what, if anything, rustup can usefully do to make this possible. |
Now that Cargo supports The problem I'd like to solve is: It's hard to ensure you're actually testing MSRV on CI. Currently, the best way seems to be to have a CI pipeline which hard-codes what the MSRV is, and either manually verify, or write custom automation, to verify that the CI pipeline's rust version is in sync with the crate's For me, the goal here would be that CI can run So in this example: [package]
rust-version = "1.54.0"
# ... running A complication here is that workspaces may have different MSRV versions, and some crates in the workspace may not set an MSRV; if we take the serde repo as an example; as of commit d6de911855d1cc0ad13f87503a79d40dc4490442 it is a workspace with the following Cargo.toml files:
Probably the correct thing to do here is for
cc @epage who seems to be thinking about this at the moment. |
I am concerned that this mixes the concerns of Rustup and Cargo. To properly honour this, Rustup would need to understand how to parse the full workspace and to understand that field as Cargo would - this seems like it'd result in Rustup needing to use the cargo crate to achieve that; which is a huge huge new dependency for rustup. I'm not saying this isn't possible, but I am wondering how sensible it would be to do it this way. I'd also like to get @rbtcollins and @ehuss involved in this discussion as both are more immediately on the coal-face as it were. |
To expand on @kinnison's comment
Keep in mind the solution would also need to include installing the MSRV toolchain before having the proxies reference it. |
I think this should be a cargo feature. Resolve the toolchain needed for msrv testing then invoke cargo +version .... Itself. |
Doing this in cargo has its own challenges
|
We have a similar problem: We ship our tools as source archive in Python. For platforms without binary, the user's Python package manager unpacks this and calls (through a wrapper) |
@konstin I don't think that it is currently possible, and it sounds at least somewhat like what the OP is talking about. I don't think we could make it implicit the way it's done in I also don't think this could work for nightlies, which have potential for both backwards and forwards incompatibility. For stable release I guess we could make it opt-in explicitly, but it seems like a weird use case -- if I understand correctly, users that have newer toolchains installed but not as the default which seems pretty niche? Can you give a plausible/common example case where someone would want this? |
As I was re-catching up on this thread, I wanted to give an update on
For this use case, I recommend using |
I don't think its about "newer toolchains are installed but non-default" but "user has rustup but hasn't run I feel like a first step for this would be to have no Cargo integration but a |
Okay, but that seems to lean on rustup's current but, let's say, looked down upon behavior for implicitly installing toolchains. Until we have a clear resolution for that, I don't think it makes sense to work on this? (My current favorite syntax would be that people could opt in by specifying |
See comment below.
Original post:
Currently I commit
rust-toolchain
files for most of my projects so that I and contributors have less manual work to do (check README, run commands, etc). It works well in combination with the RLS too.That said, the same way that exact semver bounds in Cargo.toml create many duplicated deps in builds, my observation of having had this habit for a while is that I end up with many more rust toolchains installed than I really need to work on all of my projects. Many of the older toolchains are pinned at a specific stable version -- not because I didn't want to support newer stable releases, but because I wanted to make sure that contributors are building with at least a particular minimum version.
My instinct here is to propose that adding a
+
to the end of a toolchain specifier will allow rustup to satisfy the toolchain requirement with the provided version or any newer version from the same release channel (nightly-foo-+ will only give newer nightlies, 1.28.0+ will only give newer stables).I haven't discussed this with anyone before, so I'm very open to the idea that this proposal misses important needs and would love to hear feedback on the idea. A quick search of the issue tracker didn't turn up any previous discussions, please forgive me if I'm retreading old ground!
The text was updated successfully, but these errors were encountered: