-
Notifications
You must be signed in to change notification settings - Fork 14
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
Consider documenting MSRV policy #5
Comments
Thanks for the suggestion! I'm very new to maintaining Rust crates, so I might need some help here ... What version would you suggest as MSRV? I've tried a CI setup in #6 (and it seems to work with 1.36.0). Would that check be sufficient? What policy would you recommend? I guess once established, the implementation should stay quite stable, maybe running on 1.36 forever? |
For new crates, I suggest picking the stable at the point of publishing as MSRV and then follow a policy like "at lease a year worth of Rust versions is supported (this corresponds to 8 Rust releases)".
Given that there are few deps, then yes, that'd be good. If the crate have may dependencies, it might be that some dep bumps MSRV past yours. For this to not break your CI, MSRV should be tested with a specific Cargo.lock: https://github.com/matklad/once_cell/blob/0d8a1b963b08338aae44111bdd67fe3b0f35ffd6/.travis.yml#L35-L38
I also feel so, but it makes sense to document something along the line of "we don't plan to aggressively bump MSRV". |
Thanks. I've added paragraph about this in #9, what do you think? I don't really want to commit to a fixed time interval, but if people insist, I can add it later. I don't expect the MSRV to change at all, but if it does, I guess there will be a good reason, so at least a minor version bump seems adequate to me.
But shouldn't it break my CI? |
There's no 100% correct answer here, but I'd say that changing Cargo.toml would be a bad idea. The library is responsible only for picking ranges of compatible versions, the specific versions are always chosen by the leaf application in Cargo.lock. Let's say you build a library L, which is compatible with Rust 1.40 and uses library A, which is also compatible with 1.40. Let's say both L and A at 1.0.0 right now. Let's say now A publishes 1.1.0, which requires Rust 1.42, and you implement a new feature in L, while still using Rust 1.40, and publishing L 1.1.0 If L doesn't constrain version of A, folks building apps for 1.40 can build it using L 1.1.0 and A 1.0.0. Folks using 1.42 can use L 1.1.0 and A 1.1.0. If, however, you pin A on your side to Generally, the most useful things to know are:
See also rust-lang/api-guidelines#227, especially example with crossbeam |
OK, this is indeed more complicated than I thought ...
That's a very good point, I didn't think about this. My remaining question is: do I need a |
I don't think you need |
Thanks, so I guess I'm done with #6 ... except you just mentioned Should tests be included in the considerations for MSRV? I was assuming that tests are allowed to use much more modern features, while the library itself could still have a very old MSRV. Is that not so? Isn't it sufficient to run |
Yeah, many folks just |
I have suspicion that this might become one of the more important crates in the ecosystem. So, it might make sense to:
The text was updated successfully, but these errors were encountered: