|
| 1 | +- Feature Name: msrv-2020 |
| 2 | +- Start Date: 2020-11-14 |
| 3 | +- RFC PR: (leave this empty) |
| 4 | +- Rust Issue: (leave this empty) |
| 5 | + |
| 6 | +# Summary |
| 7 | +[summary]: #summary |
| 8 | + |
| 9 | +This RFC proposes an update to the [current MSRV policy], and is an |
| 10 | +alternative to the earlier proposal [#449]. Some of the RFC text is copied |
| 11 | +from that earlier proposal. |
| 12 | + |
| 13 | +This proposal suggests a significantly reduced MSRV guarantee: all WG crates |
| 14 | +must build on the _latest stable Rust release_ at all times, and it is |
| 15 | +recommended that their main branches are checked to always build on stable via |
| 16 | +CI on both pull requests and regularly scheduled CI runs. |
| 17 | + |
| 18 | +[current MSRV policy]: https://github.com/rust-embedded/wg/blob/8eb6488fdb16e92e70b074acc2fcf249b3edc70b/ops/msrv.md |
| 19 | +[#449]: https://github.com/rust-embedded/wg/pull/449 |
| 20 | + |
| 21 | +# Motivation |
| 22 | +[motivation]: #motivation |
| 23 | + |
| 24 | +<!-- Why are we doing this? What use cases does it support? What is the expected outcome? --> |
| 25 | + |
| 26 | +As part of the push to take [foundational crates to 1.0] releases, it has |
| 27 | +become necessary to be more exact on our guarantees to support versions of the |
| 28 | +Rust compiler. This discussion [has been contentious] in the past, sparking |
| 29 | +significant discussions in many meetings. |
| 30 | + |
| 31 | +In particular, it has been necessary to balance the (somewhat opposed) concerns of: |
| 32 | + |
| 33 | +1. Some users may find themselves stuck on old versions of the compiler, due to company restrictions, slow moving distribution/package managers, or regulatory concerns. |
| 34 | +2. We maintain these crates on a volunteer basis, and our time is limited to focus on maintenance |
| 35 | + |
| 36 | +Our current MSRV policy has been found to have significant flaws around how |
| 37 | +dependencies are managed. Since many WG crates depend on non-WG crates, we |
| 38 | +cannot control the MSRV policy of those dependencies without investing |
| 39 | +additional effort to vendor or fork those crates. Consequently, a non-breaking |
| 40 | +update to a dependency might violate a published crate's MSRV. |
| 41 | + |
| 42 | +So far, the WG has received very little feedback from any users who rely on the |
| 43 | +relatively old MSRV, and so most of their use cases have been hypothetical. |
| 44 | +Conversely, there are many features in later Rust releases we would like to be |
| 45 | +able to use in crates, and the additional maintenance effort involved with |
| 46 | +checking our crates and all their dependencies support an older MSRV is |
| 47 | +non-trivial. |
| 48 | + |
| 49 | +The previous proposal to update our MSRV resolved the ambiguity in dealing with |
| 50 | +dependencies, but in a fashion which has downsides of its own and was far from |
| 51 | +unanimously supported. Consequently, this RFC proposes a much simpler MSRV |
| 52 | +policy. |
| 53 | + |
| 54 | +[foundational crates to 1.0]: https://github.com/rust-embedded/wg/issues/383 |
| 55 | +[has been contentious]: https://github.com/rust-embedded/wg/issues/427 |
| 56 | + |
| 57 | +# Detailed design |
| 58 | +[design]: #detailed-design |
| 59 | + |
| 60 | +<!-- |
| 61 | +This is the bulk of the RFC. Explain the design in enough detail for somebody familiar |
| 62 | +with the language to understand, and for somebody familiar with the compiler to implement. |
| 63 | +This should get into specifics and corner-cases, and include examples of how the feature is used. |
| 64 | +--> |
| 65 | + |
| 66 | +1. Crates released by the Embedded WG must compile on the most recent stable |
| 67 | + Rust release at all times. If a dependency releases an update which causes a |
| 68 | + published crate to no longer build on the most recent stable release, a new |
| 69 | + version must be released to resolve the issue. |
| 70 | +2. Individual crates may specify a more restrictive MSRV if the crate's team |
| 71 | + agrees to do so, as long as it is at least as restrictive as this policy. |
| 72 | +3. It is permissible for specifically-indicated features of a crate to not |
| 73 | + build on stable, to support the use of nightly-only features. All features |
| 74 | + not specifically indicated in the README or documentation must build on |
| 75 | + stable. |
| 76 | + |
| 77 | +It is recommended that all crates use a CI system to check that a PR does not |
| 78 | +break building on stable Rust, and schedule regular CI jobs to check that a |
| 79 | +newly released stable Rust has not broken the crate's build. Crates may also |
| 80 | +consider regular CI runs against the latest released version of the crate. |
| 81 | + |
| 82 | +# How We Teach This |
| 83 | +[how-we-teach-this]: #how-we-teach-this |
| 84 | + |
| 85 | +<!-- |
| 86 | +What names and terminology work best for these concepts and why? |
| 87 | +How is this idea best presented—as a continuation of existing Rust patterns, or as a wholly new one? |
| 88 | +
|
| 89 | +Would the acceptance of this proposal change how Rust is taught to new users at any level? |
| 90 | +How should this feature be introduced and taught to existing Rust users? |
| 91 | +
|
| 92 | +What additions or changes to the Rust Reference, _The Rust Programming Language_, and/or _Rust by Example_ does it entail? |
| 93 | +--> |
| 94 | + |
| 95 | +We will need to take the following actions: |
| 96 | + |
| 97 | +1. Update the [MSRV Operational Notes](./../ops/msrv.md) |
| 98 | +2. Ensure all crates test the current Rust stable release. It is believed that |
| 99 | + this is already the case, so no further action would be required. |
| 100 | +3. Update our CI examples and crates to start running scheduled CI tests. |
| 101 | + |
| 102 | +# Drawbacks |
| 103 | +[drawbacks]: #drawbacks |
| 104 | + |
| 105 | +This updated policy reduces the burden on Embedded WG maintainers and |
| 106 | +contributors, but at the expense of users who previously relied on our |
| 107 | +conservative MSRV policy. Those users may no longer be able to build |
| 108 | +Embedded WG crates on older versions of Rust, including our foundational |
| 109 | +crates which are widely used in the embedded ecosystem. |
| 110 | + |
| 111 | +Such users could continue using old versions of crates, fork and maintain a |
| 112 | +version of those crates with a lower MSRV, or contribute to the crates to |
| 113 | +help maintain a lower MSRV if possible. |
| 114 | + |
| 115 | +# Alternatives |
| 116 | +[alternatives]: #alternatives |
| 117 | + |
| 118 | +1. Make no change to our MSRV policy, despite the shortcomings that have become |
| 119 | + apparent around the management of dependencies. |
| 120 | +2. Accept [#449], clarifying how we manage dependencies while maintaining |
| 121 | + a stricter MSRV policy. |
| 122 | +3. Accept this proposal, but replacing "latest stable" with "latest-but-one |
| 123 | + stable" or similar. This provides a slightly more conservative level of MSRV |
| 124 | + support for users who can upgrade Rust version but perhaps cannot do so |
| 125 | + overnight. |
| 126 | + |
| 127 | +[#449]: https://github.com/rust-embedded/wg/pull/449 |
| 128 | + |
| 129 | +# Unresolved questions |
| 130 | +[unresolved]: #unresolved-questions |
| 131 | + |
| 132 | +At the moment, there are no open unresolved questions. |
0 commit comments