Repository navigation
Document a MSRV policy - #2243
Conversation
Benchmark resultsInstruction countsSignificant differencesThere are no significant instruction count differences Other differencesClick to expand
Wall-timeSignificant differencesThere are no significant wall-time differences Other differencesClick to expand
Additional informationCheckout details:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2243 +/- ##
=======================================
Coverage 94.65% 94.65%
=======================================
Files 102 102
Lines 23917 23917
=======================================
Hits 22638 22638
Misses 1279 1279 ☔ View full report in Codecov by Sentry. |
djc
left a comment
There was a problem hiding this comment.
Nice!
It feels like the MSRV section could use a bit more structure, the current versions feels like a somewhat lose collection of points. Maybe think about how that could be more cohesive? Maybe turn it into a bullet list?
|
|
||
| ### Minimum Supported Rust Version | ||
|
|
||
| Our MSRV will be no more recent than 9 versions old, or approximately 12 months. |
There was a problem hiding this comment.
I'm a little wary about promising more than about 4-6 versions. Note that Tokio promises 6 months (4 versions) but are usually more conservative in practice. In that sense, I think it often pays off to underpromise and overdeliver.
Also note that (a) tokio-rustls represents about 80% of rustls recent downloads and (b) we bump the tokio-rustls MSRV whenever necessary for a Tokio bump so practically our usability (at least without some amount of pinning) is limited by that.
There was a problem hiding this comment.
While toward the end we were feeling the pain, we only recently went from an N-19 MSRV (and N-16 before that, in April of this year), and I don't recall that being exceptionally painful. Though there is obviously an opportunity cost there that is difficult to measure.
So I think N-9 is conservative, but not exceptionally so when compared to our recent MSRV history.
My main concern with N-9 right now is that the ecosystem will move more quickly than usual to take advantage of the 2024 edition (which I think we saw with 1.56).
| Once we reach 1.0.0, we will not make MSRV changes in patch releases. | ||
|
|
||
| We will not make MSRV changes to security maintenance branches. | ||
|
|
||
| > [!NOTE] | ||
| > For the avoidance of doubt: security maintenance branches exist for each | ||
| > release line _that is not the latest_: so (at the time of writing) 0.22 | ||
| > and 0.21 have maintenance branches, but 0.23 does not and is released from | ||
| > the `main` branch. |
There was a problem hiding this comment.
I highly appreciate the effort here. However, please note that, as the latest branch isn't considered a maintenance branch, this part of the policy here would mean that any project that keeps any kind of MSRV guarantee would be barred from upgrading to the latest minor release branch as it would unpredictable when/to what version rustls might bump on a patch release (and what patch releases after that are potentially missed).
There was a problem hiding this comment.
Yes, that is correct. To do otherwise would mean MSRV changes are only allowed on a breaking release. (ie, 0.24.0 or 1.0.0 would have to decide the MSRV for that entire release line).
There was a problem hiding this comment.
Yes, that is correct. To do otherwise would mean MSRV changes are only allowed on a breaking release. (ie, 0.24.0 or 1.0.0 would have to decide the MSRV for that entire release line).
I have to say this is highly confusing. It really limits the usefulness of the MSRV policy altogether as most projects would have upgraded whenever you guys decide to bump the MSRV. It essentially traps users into running the newest minor release branch as it might be compliant with the MSRV requirements at the point of adoption, which might change at any moment though, especially if they don't read this fine-print. But even if they carefully read every sentence here, this policy would incentivize them not to run the latest minor branch.
I mean you surely have to see how hard it is to navigate this policy? Also, keep in mind that rustls is not the only dependency that you'll have to monitor for such fine-print.
I understand that you don't see MSRV changes as breaking in rustls and want to maintain the freedom to bump MSRV whenever you feel the need to / like to, but for (direct and transitive) dependent projects MSRV changes are breaking changes, whether you like it or not. :(
Restructured into bullets, and put the MSRV of new deps under its own subheading |
|
Maybe further clarifications: Once we do 1.x, would we do a security release for 1.0.x after we have released 1.1.0? As for the point about adding optional dependencies, might want to make it explicit that you intend this to be about non-default optional dependencies only. ("default" and "optional" are technically distinct.) |
Hm, good question. I would hope when that time comes, we are swapping the cost of stability for the cost of many security maintenance branches (ie, no). But that would leave people with MSRV requirements with fewer options than today. I think we'll need to revisit the maintenance policy at 1.0.0 to answer this, and also possibly adjust it to take into account (hopefully!) longer windows between breaking changes (eg, at the moment, if we have 1.x.x which is current for 2 years, then cut 2.0.0, the 1.x.x branch isn't guaranteed any security maintenance at all.)
Reworded this. |
|
I dont believe this MSRV policy is compatible with the new MSRV-aware resolver (post-1.0). Imagine the scenario that rustls ships a 1.1.X branch with an MSRV of rustc 1.98 and then ships a 1.2.X branch that initially has an MSRV of 1.98 but then switches to an MSRV of rustc 1.99 in 1.2.1 with a critical security fix (and at the same time a 1.1.1 is shipped). An MSRV-aware resolver will pick 1.2.0 over 1.1.1 even though 1.1.1 is newer and contains a critical security fix where 1.2.0 does not (and only contains some new features). |
I think we're saying we won't do that:
This means the 1.2.0 branch would start with a MSRV of 1.99, and not change MSRV thereafter. Ultimately the MSRV-aware resolver does mean there could be successful dependency solutions that do not include security fixes, if your MSRV does not allow for them. There's tooling already to help with that (cargo audit). The situation today is that you'd get a dependency solution that you cannot build, but does include security fixes. I'd also say that this policy is a minimum, rather than a maximum; and:
|
Ah, okay, I was confused by the discussion in the other issue on the current (pre-1.0) stance...would be nice to get 1.0 so that there's an MSRV policy for minor versions :) |
For discussion ref #2239
Rendered