-
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
When generating version requirements, use the oldest "good" version within a major version #14372
Comments
This is our default stance as well, see our guidelines
Integration of security checks is being tracked in #7678. imo not all security vulnerabilities are created equal. I've had people ping me about my
I feel like doing this by default would run counter to user expectations. If I ran When starting this reply, I was assuming this is something users would want as a blanket policy and config would be more appropriate but In light of the
I feel like this runs counter to the mental model of |
That's a fair point. I agree this is subtle and I don't really see an obvious solution. It might be rare enough that manual intervention after the default generated version requirement is acceptable.
Good point. I am fine manually editing the version requirement to the oldest version that contains all features I use, but I can see how it's a very bad idea for most users.
I'm going from the principle that users shouldn't use flags that don't fit their usecase, in which case, the only cost of a flag is its maintainance cost. That said, I can see how the maintainance could be too high for the benefits of the flag. In which case, as you suggest, a third-party command would be the right approach. If that's the issue conclusion, I would be curious to look into it if I get time.
It's true that using this flag without I guess I'll just wait until either this issue reaches a conclusion regarding whether this should be a third-party command, or if I get time to play around with writing a third-party command (which would essentially provide |
UI / documentation bloat is another problem. This came up in the discussion of
Even with |
I see. I would consider this a rather strong argument for making it a third-party command then. And thanks for the link to the minimal-version discussion. That third-party command should also:
|
Actually, thinking a bit more about this, I fell like the behavior of Footnotes
|
This came up quite a bit in: https://internals.rust-lang.org/t/feedback-on-cargo-upgrade-to-prepare-it-for-merging/17101
The problem is that you still run into issues with Cargo choosing versions different versions for your |
We discussed this in today's Cargo team meeting. While we are understanding of wanting to give flexibility for users on versions, there is too much variance within a major version to pick the oldest within that and too little community convention around minor versions to pick the oldest within that. There are also likely too many caveats around this workflow to smooth this out for end users, especially considering We are inclined to close this but could revisit it if there is sufficient new information. |
Thanks for the feedback! I agree this is better addressed with a third-party command, which I hope I'll have time to implement. |
Problem
Proposed Solution
I'm thinking that
cargo add
(resp.cargo update --breaking
) would add (resp. update to) the oldest version satisfying both properties below:The exact algorithm would be:
Notes
The current behavior is to use the latest published version (not sure if vulnerabilites are checked).
I'm obviously fine if I have to use a flag, e.g.
cargo add --bikeshed
andcargo update --breaking --bikeshed
.The text was updated successfully, but these errors were encountered: