-
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
Extract rust-version as rust constraint from cargo.toml if present #26314
Comments
There is another source for a potential rust constraint. rustup is a rust version manager and supports a rust-toolchain file which lets maintainers change which version of
I expect that not all maintainers with a I'm leaving this note here as I'm unsure if you'd prefer to keep this in one Issue or split it to a separate issue. |
My assumptions had been that:
When it comes to rust-version, we shouldn't "bump" it by default, certainly not to latest. This would immediately make the library less compatible for downstream users, and potentially should even be considered a breaking change. Note: in the JS ecosystem, libraries usually do a major semver release when they drop support for older versions of Node. It might be useful though for Renovate to bump rust-version to the earliest supported version of Rust, if that's a thing? e.g. like in Node, v16 is now unsupported so v18 is the earliest supported version. Next, we need to think what to do with these rust versions. For rustup, I think that's easy - that's the version we should install/use when running For |
Depending on the domain, application authors have little reason to set
We generally recommend against that in Rust (semver guidelines).
At this time, the Rust Project only supports the latest toolchain release. For anything else, they are expected to either upgrade or get support (ie backporting security fixes) from their vendor (like Ferrocene)
I agree though I would fallback to using The question remains as for what to do with dependencies without a
We do want to explore finding good fallbacks for In both cases, the benefit of matching what we eventually stabilize (the end goal of the RFC) is that users will get a consistent experience which will make it more predictable. |
This makes sense to me. As an application developer supporting multiple language versions adds work but no additional functionality.
I don't think the Rust ecosystem can consider itself genuinely semver-compliant though if minor releases can knowingly break things. I don't mind, but I think the Node.js ecosystem has it right here.
There seems like there should be a difference between "we won't backport features or fixes" versus "the instant we release a new version, the old ones are EOL". In software it's useful to know when you're running EOL software, but if users get ominous warnings about a Rust version which was perfect 10 seconds earlier then it will numb them to start ignoring all such warnings. Anyway, it does seem like Renovate should bump Rust version in package files or rust toolchains by default, if that's the way the Rust ecosystem works? (unlike Go, where it would annoy people)
Does the following make sense? In case both rust-toolchain and rust-version are present, which should we use? I would think it might happen for libraries where:
The does rust-version mean "version X or later" while rust-toolchain means "exactly this version"? Ultimately for Renovate, we just want to end up with a "constraint" which tells us "this project needs dependencies satisfying this constraint".
What does "most compatible" mean?
|
There are a lot of opinions on the updating of Rust versions in package files and rust toolchain files such that it likely shouldn't be updated by default.
Sorry, that should just read "Any compatible" |
Personally, I would prefer Renovate to just search for Either way, (and this is from the perspective of a user that doesn't know much about the internals of Renovate), it would be useful to have very explicit information about this. Something like "The minimum supported Rust version in Cargo.toml was increased from 1.60 to 1.70 to allow upgrading If this information is provided somehow, the workflow could look like this (which would be quite nice IMO):
Unrelated: There's a significant number of projects (usually bigger ones) that have an explicit "MSRV policy" (e.g. "support at least the last 6 months of Rust releases"). Not sure if it's reasonably possible to account for something like this. |
There are two elements to an MSRV policy
Usually the community is focused on one or the other and sometimes people try to use a grace period to emulate support for a fixed version with mixed results. So figuring out how to support an MSRV policy can be complicated. Currently I use a grace period and rely on |
This issue has diverted a little, and I don't want it to get left behind. If a Cargo.toml defines a rust version, we should do this:
We also need to decide what is our source of truth for Rust versions. For containerbase today we use the "rust" library image in Docker. Is that also suitable here or should we have a different source of truth for what is a valid/released Rust version? |
Skimming through the Docker tags for the rust image, it looks like the docker releases are usually a few days/weeks after the real release. I measured the real release date by looking at the announcement posts on the Rust blog ("Announcing Rust 1.XY.Z"). A source that is probably easier to read programmatically is the rust-lang/rust git tags. |
On the other hand if Renovate discovers new rust releases almost immediately then the proposed update might fail in the user's environment if the tooling they use to install rust doesn't source directly from the GitHub repository either and also has hours or days delays. |
I currently use github releases as my source of truth for rust releases, see https://github.com/clap-rs/clap/blob/690f5557d7f25904c31ec9f2a3c3657cbb68c98e/.github/renovate.json5#L26-L27 In general, updating of |
Describe the proposed change(s).
Ref: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
This should be extracted both as a dependency, as well as a constraint. In both cases it refers to the minimum version supported, similar to go.mod's go directive.
The dependency should not be bumped by default.
The text was updated successfully, but these errors were encountered: