|
| 1 | +# Compiler change backports |
| 2 | + |
| 3 | +Sometimes, compiler changes need to be backported to the stable and/or beta channel. Example |
| 4 | +motivations may include but are not limited to: |
| 5 | + |
| 6 | +- To fix significant regressions that are present on the beta / stable channels. |
| 7 | +- To revert changes that unintentionally cause the compiler to reject / accept new code. |
| 8 | +- To revert lints (or changes to their default lint levels) that may be overzealous / too noisy. |
| 9 | +- To revert stabilizations due to significant concerns / issues, or accidental stabilizations. |
| 10 | + |
| 11 | +## Nominating for compiler backport review |
| 12 | + |
| 13 | +You can nominate a compiler change for compiler team to consider to backport to **stable** and/or |
| 14 | +**beta** channels by applying suitable labels: |
| 15 | + |
| 16 | +- Nominate for **beta** channel backport: [`beta-nominated`] |
| 17 | +- Nominate for **stable** channel backport: [`stable-nominated`] |
| 18 | + |
| 19 | +You can combine both labels if the change should be considered to backport to both release channels. |
| 20 | + |
| 21 | +To apply those labels, you can either: |
| 22 | + |
| 23 | +- Directly apply the suitable label(s), or |
| 24 | +- Use one of the following [`@rustbot` label invocations](../triagebot/labeling.md): |
| 25 | + - `@rustbot label: +beta-nominated` |
| 26 | + - `@rustbot label: +stable-nominated` |
| 27 | + - `@rustbot label: +beta-nominated +stable-nominated` |
| 28 | +- Make sure the PR has a `T-compiler` team label if the backport decision requires compiler review. |
| 29 | + This should typically already be done by [triagebot](../triagebot/autolabels.md) if the PR changes |
| 30 | + compiler code. If this is not the case, you can also use `@rustbot label: +T-compiler` to manually |
| 31 | + apply a compiler team label. |
| 32 | + |
| 33 | +In any case, **please include a nomination message providing context of the change and justifying |
| 34 | +the beta and/or stable backport** so that compiler backport reviewers don't have to search for |
| 35 | +issues or dig through a bunch of links. |
| 36 | + |
| 37 | +**Backport nominations are not guaranteed be accepted**. Compiler backport reviewers may decide to |
| 38 | +reject backport nominations if they determine that: |
| 39 | + |
| 40 | +- The **benefit** of backporting to beta/stable channels **does not sufficiently outweigh the risk |
| 41 | + of introducing *new* regressions** to the beta/stable channels. |
| 42 | +- The nominated change is **too complex** (which typically correlates with being too risky) to |
| 43 | + backport. |
| 44 | +- (For beta backport nominations) The nominated change has insufficient time to bake on the beta |
| 45 | + release channel. If the beta compiler candidate is near the end of a release cycle, i.e. meaning |
| 46 | + the beta compiler candidate has very limited (if any) time to bake to give people opportunities to |
| 47 | + test and report new regressions. |
| 48 | +- (For stable backport nominations) The nominated change does not sufficiently justify a stable |
| 49 | + point release on its own, and there are no other accepted stable backport nominations (not |
| 50 | + necessarily compiler stable backport nominations) around the same time. |
| 51 | + |
| 52 | +If a backport nomination unfortunately slides the relevant release channels (e.g. due to |
| 53 | +implementation issues), the nomination may be automatically rejected. For beta regressions that slid |
| 54 | +to stable, you may need to consider a stable backport nomination instead. This should not generally |
| 55 | +happen for critical issues. |
| 56 | + |
| 57 | +## Meaning of the `{beta,stable}-{nominated,accepted}` labels |
| 58 | + |
| 59 | +- [`beta-nominated`], [`stable-nominated`] (only when in conjunction with the [`T-compiler`] team |
| 60 | + label): a PR is nominated for the beta and/or stable release channel. |
| 61 | +- [`beta-accepted`], [`stable-accepted`]: the compiler team decided to accept the beta and/or stable |
| 62 | + backport nomination. |
| 63 | + |
| 64 | +## How are approved backports handled? |
| 65 | + |
| 66 | +Most of the time, [`beta-accepted`] and [`stable-accepted`] labels are applied to PRs that target |
| 67 | +the `master` branch. If a `master`-targeting PR is marked `{beta,stable}-accepted`, their backports |
| 68 | +will be handled by the [release team](../release/backporting.md). |
| 69 | + |
| 70 | +In rare circumstances, a beta backport PR may need to *directly* target the `beta` branch. In this |
| 71 | +case, coordinate with the [release team](../release/README.md) before merging (e.g. by pinging the |
| 72 | +release team or opening a [#t-release zulip |
| 73 | +thread](https://rust-lang.zulipchat.com/#narrow/channel/241545-t-release)). |
| 74 | + |
| 75 | +## Reviewing compiler backport nominations |
| 76 | + |
| 77 | +> **Note on experimental nature of async backport nominations** |
| 78 | +> |
| 79 | +> The compiler team is currently experimenting with *asynchronous* backport decisions, but we will |
| 80 | +> still track backport nominations in the weekly [compiler triage meeting](./meetings.md). |
| 81 | +
|
| 82 | +When a PR has `{beta,stable}-nominated` and [`T-compiler`] labels applied on [rust-lang/rust], a new |
| 83 | +backport nomination zulip thread will automatically be created by |
| 84 | +[triagebot](../triagebot/zulip-notifications.md) under [#t-compiler/backports] and ping compiler |
| 85 | +team members who are subscribed to the backport channel. |
| 86 | + |
| 87 | +Compiler team members will review the beta/stable backport nominations through the zulip threads, |
| 88 | +and discuss and vote on the polls created by [triagebot](../triagebot/zulip-notifications.md). If |
| 89 | +there are no timely consensus on decision from the asynchronous backport nomination zulip threads, |
| 90 | +the [compiler-ops team](../compiler/operations.md) will raise those on the upcoming [compiler triage |
| 91 | +meeting](./meetings.md) to make a synchronous decision. |
| 92 | + |
| 93 | +### Considerations for backport decisions |
| 94 | + |
| 95 | +For compiler backport reviewers, here are some **non-exhaustive** considerations that they might |
| 96 | +consider in making a backport decision: |
| 97 | + |
| 98 | +- How long does a beta backport have to bake? Consider remaining time available for users to test |
| 99 | + the beta compiler candidate before the next release cycle (note that the actual stable compiler |
| 100 | + artifact will necessarily be built sooner than the actual release!). |
| 101 | +- How complex is the nominated compiler change? |
| 102 | +- How risky is the nominated compiler change? Can it introduce new regressions to the stable/beta |
| 103 | + channel? Can the "cure" (nominated change) be potentially worse than the "poison" (the stable/beta |
| 104 | + regression)? |
| 105 | +- How severe is the regression/issue being fixed? E.g. critical regressions vs stable-to-stable |
| 106 | + regressions that are not very severe, and is already on stable channel for multiple release |
| 107 | + cycles. |
| 108 | + |
| 109 | +At the end of then day, it's a risk vs benefit tradeoff decision. The general guidance is to only |
| 110 | +accept beta backports if it's fix for a (beta/stable) regression if the benefit sufficiently |
| 111 | +overweighs the risk. For stable backports, this bar should be even higher as we should not and do |
| 112 | +not want to encourage frequent stable point releases. |
| 113 | + |
| 114 | +## When and how is a backport decision reached? How long should a backport decision take? |
| 115 | + |
| 116 | +> **Overall idea** |
| 117 | +> |
| 118 | +> The general idea behind the current async backport review and approval process experiment is that |
| 119 | +> |
| 120 | +> > async backport will never take longer than waiting for the next meeting. |
| 121 | +> |
| 122 | +> See [discussions on async backport reviews](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Do.20backport.20nominations.20async.3F/near/518255539). |
| 123 | +
|
| 124 | +A *asynchronous* beta/stable backport nomination (i.e. the aforementioned async backport nomination |
| 125 | +zulip threads under [#t-compiler/backports]) **may** be considered accepted/rejected **if and only |
| 126 | +if**: |
| 127 | + |
| 128 | +- There are at least **3** compiler team members who vote for approve/reject (i.e. a "**strong |
| 129 | + decision outcome**"), and there are no outstanding votes in the opposite direction, then the |
| 130 | + backport nomination can be considered to be approved/accepted **by the next compiler triage |
| 131 | + meeting**. |
| 132 | + - Example: if **3** compiler team members vote **approve**, **1** member vote **don't know**, then |
| 133 | + the backport nomination is considered accepted by the next compiler triage meeting. |
| 134 | + |
| 135 | +A *synchronous* beta/stable backport nomination **may** be considered accepted/rejected **if and |
| 136 | +only if** (during the weekly triage meeting): |
| 137 | + |
| 138 | +- There are sufficient engagement during the backport decision discussion (**at least 2** compiler |
| 139 | + team members are present, including **at least 1** compiler team lead), and no significant |
| 140 | + disagreements. |
| 141 | +- The compiler lead will make the call to accept/reject/postpone the backport nomination. |
| 142 | +- A [compiler-ops member](./operations.md) or any compiler team member should leave a comment |
| 143 | + announcing the backport decision and backlink to the triage meeting decision message / async |
| 144 | + backport decision thread and adjust `{beta,stable}-{nominated,accepted}` labels as suitable. |
| 145 | + |
| 146 | +A backport nomination decision for a *merged* (reviewed and approved) compiler change (to `master` |
| 147 | +branch) should *generally* be expected to take no longer than until the next weekly synchronous |
| 148 | +compiler triage meeting. For *unmerged* (outstanding review concerns / unreviewed) PRs, compiler |
| 149 | +backport reviewers *may* decide to postpone to next weekly compiler triage meeting. |
| 150 | + |
| 151 | +In time sensitive cases, compiler leads **may** choose to accepted/reject backport nominations if |
| 152 | +there are insufficient engagement on either async/sync avenues. |
| 153 | + |
| 154 | + |
| 155 | +[rust-lang/rust]: https://github.com/rust-lang/rust |
| 156 | +[`beta-nominated`]: https://github.com/rust-lang/rust/labels/beta-nominated |
| 157 | +[`beta-accepted`]: https://github.com/rust-lang/rust/labels/beta-accepted |
| 158 | +[`stable-nominated`]: https://github.com/rust-lang/rust/labels/stable-nominated |
| 159 | +[`stable-accepted`]: https://github.com/rust-lang/rust/labels/stable-accepted |
| 160 | +[#t-compiler/backports]: https://rust-lang.zulipchat.com/#narrow/channel/474880-t-compiler.2Fbackports |
| 161 | +[`T-compiler`]: https://github.com/rust-lang/rust/labels/T-compiler |
0 commit comments