|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Announcing Rust 1.12.1" |
| 4 | +author: The Rust Core Team |
| 5 | +--- |
| 6 | + |
| 7 | +The Rust team is happy to announce the latest version of Rust, 1.12.1. Rust is |
| 8 | +a systems programming language with the slogan "fast, reliable, productive: |
| 9 | +pick three." |
| 10 | + |
| 11 | +As always, you can [install Rust 1.12.1][install] from the appropriate page on our |
| 12 | +website. |
| 13 | + |
| 14 | +[install]: https://www.rust-lang.org/install.html |
| 15 | + |
| 16 | +### What's in 1.12.1 stable |
| 17 | + |
| 18 | +Wait... one-twelve-point... one? |
| 19 | + |
| 20 | +In [the release announcement for 1.12][one-twelve] a few weeks ago, we said: |
| 21 | + |
| 22 | +[one-twelve]: https://blog.rust-lang.org/2016/09/29/Rust-1.12.html |
| 23 | + |
| 24 | +> The release of 1.12 might be one of the most significant Rust releases since |
| 25 | +> 1.0. |
| 26 | +
|
| 27 | +It was true. One of the biggest changes was turning on a large compiler |
| 28 | +refactoring, [MIR], which re-architects the internals of the compiler. The |
| 29 | +overall process went like this: |
| 30 | + |
| 31 | +[MIR]: https://blog.rust-lang.org/2016/04/19/MIR.html |
| 32 | + |
| 33 | +* Initial MIR support landed in nightlies back in Rust 1.6. |
| 34 | +* While work was being done, a flag, `--enable-orbit`, was added so that |
| 35 | + people working on the compiler could try it out. |
| 36 | +* Back [in October], we would always attempt to build MIR, even though it |
| 37 | + was not being used. |
| 38 | +* A flag was added, `-Z orbit`, to allow users on nightly to try and use MIR |
| 39 | + rather than the traditional compilation step ('trans'). |
| 40 | +* After substantial testing over months and months, for Rust 1.12, [we enabled |
| 41 | + MIR by default]. |
| 42 | +* In Rust 1.13, [MIR will be the only option]. |
| 43 | + |
| 44 | +[in October]: https://github.com/rust-lang/rust/pull/28748 |
| 45 | +[we enabled MIR by default]: https://github.com/rust-lang/rust/pull/34096 |
| 46 | +[MIR will be the only option]: https://github.com/rust-lang/rust/pull/35764 |
| 47 | + |
| 48 | +A change of this magnitude is huge, and important. So it's also important to do |
| 49 | +it right, and do it carefully. This is why this process took so long; we |
| 50 | +regularly tested the compiler against every crate on crates.io, we asked people |
| 51 | +to try out `-Z orbit` on their private code, and after six weeks of beta, no |
| 52 | +significant problems appeared. So we made the decision to keep it on by default |
| 53 | +in 1.12. |
| 54 | + |
| 55 | +But large changes still have an element of risk, even though we tried to reduce |
| 56 | +that risk as much as possible. And so, after release, 1.12 saw a fair number of |
| 57 | +regressions that we hadn't detected in our testing. Not all of them are |
| 58 | +directly MIR related, but when you change the compiler internals so much, it's |
| 59 | +bound to ripple outward through everything. |
| 60 | + |
| 61 | +One of these bugs even prevented a production user, [Ethcore], from building on |
| 62 | +Rust 1.12 stable. This is further compounded by [a DoS attack] against the |
| 63 | +Etherium network itself, and so the project is recommending that all Etherium |
| 64 | +users switch to Parity. When it rains, it pours. |
| 65 | + |
| 66 | +[Ethcore]: https://github.com/ethcore/parity |
| 67 | +[a DoS attack]: https://blog.ethereum.org/2016/09/22/ethereum-network-currently-undergoing-dos-attack/ |
| 68 | + |
| 69 | +### Why make a point release? |
| 70 | + |
| 71 | +Now, given that we have a six-week release cycle, and we're halfway towards |
| 72 | +Rust 1.13, you may wonder why we're choosing to cut a patch version of Rust |
| 73 | +1.12 rather than telling users to just wait for the next release. We have |
| 74 | +previously said something like "point releases should only happen in extreme |
| 75 | +situations, such as a security vulnerability in the standard library." |
| 76 | + |
| 77 | +The Rust team cares deeply about the stability of Rust, and about our users, |
| 78 | +both production and non. We could have told you all to wait, but we want you to |
| 79 | +know how seriously we take this stuff. We think it's worth it to demonstrate |
| 80 | +our commitment to you by putting in the work of making a patch release in this |
| 81 | +situation. |
| 82 | + |
| 83 | +Furthermore, given that this is not security related, it's a good time to |
| 84 | +practice actually cutting a patch release. We've never done it before, and the |
| 85 | +release process is [semi-automated] but still not completely so. Having a patch |
| 86 | +release in the world will also shake out any bugs in dealing with patch |
| 87 | +releases in other tooling as well, like [rustup]. Making sure that this all |
| 88 | +goes smoothly and getting some practice going through the motions will be |
| 89 | +useful if we ever need to cut some sort of *emergency* patch release due to |
| 90 | +a security advisory or anything else. |
| 91 | + |
| 92 | +[semi-automated]: https://forge.rust-lang.org/release-process.html |
| 93 | +[rustup]: http://rustup.rs/ |
| 94 | + |
| 95 | +It is true that regular patch releases would indicate that something is deeply |
| 96 | +wrong with our process. However, we've gone 72 weeks past Rust 1.0 without |
| 97 | +needing to do a point release, so we feel that we've been doing well so far. |
| 98 | +We're going to continue to closely monitor all of this to ensure that this |
| 99 | +isn't a sign of something more deeply wrong with our release engineering. |
| 100 | + |
| 101 | +### A note about testing on beta |
| 102 | + |
| 103 | +One thing that you, as a user of Rust, can do to help us fix these issues |
| 104 | +sooner: test your code against the beta channel! Every beta release is a |
| 105 | +release candidate for the next stable release, so for the cost of an extra |
| 106 | +build in CI, you can help us know if there's going to be some sort of problem |
| 107 | +before it hits a stable release! It's really easy. For example, on |
| 108 | +[Travis](https://travis-ci.org/), you can use this as your `.travis.yml`: |
| 109 | + |
| 110 | +```yaml |
| 111 | +language: rust |
| 112 | +rust: |
| 113 | + - stable |
| 114 | + - beta |
| 115 | +``` |
| 116 | +
|
| 117 | +And you'll test against both. Furthermore, if you'd like to make it so that any |
| 118 | +beta failure doesn't fail your own build, do this: |
| 119 | +
|
| 120 | +```yaml |
| 121 | +matrix: |
| 122 | + allow_failures: |
| 123 | + - rust: beta |
| 124 | +``` |
| 125 | +
|
| 126 | +The beta build may go red, but your build will stay green. |
| 127 | +
|
| 128 | +Most other CI systems, such as [AppVeyor](https://www.appveyor.com/), should |
| 129 | +support [something |
| 130 | +similar](https://www.appveyor.com/docs/build-configuration/#allow-failing-jobs). |
| 131 | +Check the documentation for your specific continuous integration product for |
| 132 | +full details. |
| 133 | +
|
| 134 | +### Full details |
| 135 | +
|
| 136 | +There were nine issues fixed in 1.12.1, and all of those fixes have been |
| 137 | +backported to 1.13 beta as well. |
| 138 | +
|
| 139 | +* [ICE: 'rustc' panicked at 'assertion failed: concrete_substs.is_normalized_for_trans()' #36381][36381] |
| 140 | +* [Confusion with double negation and booleans][36856] |
| 141 | +* [rustc 1.12.0 fails with SIGSEGV in release mode (syn crate 0.8.0)][36875] |
| 142 | +* [Rustc 1.12.0 Windows build of `ethcore` crate fails with LLVM error][36924] |
| 143 | +* [1.12.0: High memory usage when linking in release mode with debug info][36926] |
| 144 | +* [Corrupted memory after updated to 1.12][36936] |
| 145 | +* ["Let NullaryConstructor = something;" causes internal compiler error: "tried to overwrite interned AdtDef"][37026] |
| 146 | +* [Fix ICE: inject bitcast if types mismatch for invokes/calls/stores][37112] |
| 147 | +* [debuginfo: Handle spread_arg case in MIR-trans in a more stable way.][37153] |
| 148 | + |
| 149 | +[36381]: https://github.com/rust-lang/rust/issues/36381 |
| 150 | +[36856]: https://github.com/rust-lang/rust/issues/36856 |
| 151 | +[36875]: https://github.com/rust-lang/rust/issues/36875 |
| 152 | +[36924]: https://github.com/rust-lang/rust/issues/36924 |
| 153 | +[36926]: https://github.com/rust-lang/rust/issues/36926 |
| 154 | +[36936]: https://github.com/rust-lang/rust/issues/36936 |
| 155 | +[37026]: https://github.com/rust-lang/rust/issues/37026 |
| 156 | +[37112]: https://github.com/rust-lang/rust/issues/37112 |
| 157 | +[37153]: https://github.com/rust-lang/rust/issues/37153 |
| 158 | + |
| 159 | +In addition, there were four more regressions that we decided not to include |
| 160 | +in 1.12.1 for various reasons, but we'll be working on fixing those as soon |
| 161 | +as possible as well. |
| 162 | + |
| 163 | +* [ICE, possibly related to associated types of associated types?][36325] |
| 164 | +* [Compilation of a crate using a large static map fails on latest i686-pc-windows-gnu Beta][36799] |
| 165 | +* [Regression: "no method found" error when calling same method twice, with HRTB impl][37154] |
| 166 | +* [ ICE: fictitious type <i32 as ToRef>::Ref in sizing_type_of()][37109] |
| 167 | + |
| 168 | +[36325]: https://github.com/rust-lang/rust/issues/36325 |
| 169 | +[36799]: https://github.com/rust-lang/rust/issues/36799 |
| 170 | +[37154]: https://github.com/rust-lang/rust/issues/37154 |
| 171 | +[37109]: https://github.com/rust-lang/rust/issues/37109 |
| 172 | + |
| 173 | +You can see the full diff from 1.12.0 to 1.12.1 |
| 174 | +[here](https://github.com/rust-lang/rust/pull/37173). |
0 commit comments