|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Announcing Rustup 1.25.1" |
| 4 | +author: The Rustup Working Group |
| 5 | +--- |
| 6 | + |
| 7 | +The rustup working group is announcing the release of rustup version 1.25.1. |
| 8 | +[Rustup][install] is the recommended tool to install [Rust][rust], a |
| 9 | +programming language that is empowering everyone to build reliable and |
| 10 | +efficient software. |
| 11 | + |
| 12 | +If you have a previous version of rustup installed, getting rustup 1.25.1 is as |
| 13 | +easy as stopping any programs which may be using Rustup (e.g. closing your IDE) |
| 14 | +and running: |
| 15 | + |
| 16 | +``` |
| 17 | +rustup self update |
| 18 | +``` |
| 19 | + |
| 20 | +Rustup will also automatically update itself at the end of a normal toolchain |
| 21 | +update: |
| 22 | + |
| 23 | +``` |
| 24 | +rustup update |
| 25 | +``` |
| 26 | + |
| 27 | +If you don't have it already, you can [get rustup][install] from the |
| 28 | +appropriate page on our website. |
| 29 | + |
| 30 | +[rust]: https://www.rust-lang.org |
| 31 | +[install]: https://rustup.rs |
| 32 | + |
| 33 | +## What's new in rustup 1.25.1 |
| 34 | + |
| 35 | +This version of rustup fixes a regression introduced in the previous release |
| 36 | +(1.25.0), which caused some workflows to fail. |
| 37 | + |
| 38 | +### Regression in nested Cargo invocations with different toolchains |
| 39 | + |
| 40 | +When you invoke Rust or Cargo installed by rustup, you're not running them |
| 41 | +directly. Instead, you run [rustup "proxy" binaries][proxies], whose job is to |
| 42 | +detect the right toolchain (parsing the `+channel` CLI argument or using one of |
| 43 | +the defaults) and run it. |
| 44 | + |
| 45 | +Running these proxies is not instantaneous though, and for example a `cargo |
| 46 | +build` invocation might execute several of them (the initial `cargo` invocation |
| 47 | +plus one `rustc` for every dependency), slowing down the build. |
| 48 | + |
| 49 | +To improve performance, rustup 1.25.0 changed the proxies code to set the |
| 50 | +[`RUSTC` and `RUSTDOC` environment variables][cargo-env] when missing, which |
| 51 | +instructed Cargo to skip the proxies and invoke the binaries defined in those |
| 52 | +variables directly. This provided a performance gain when building crates with |
| 53 | +lots of dependencies. |
| 54 | + |
| 55 | +Unfortunately this change broke some users of rustup, who did something like: |
| 56 | + |
| 57 | +* The first Cargo invocation (for example an extension, an alias or an |
| 58 | + integration test) uses toolchain `foo`, setting the `RUSTC` and `RUSTDOC` |
| 59 | + environment variables pointing to that toolchain. |
| 60 | + |
| 61 | +* The first invocation calls Cargo again, but this time using toolchain `bar` |
| 62 | + (for example `cargo +bar build`). This does **not** set the `RUSTC` and |
| 63 | + `RUSTDOC` environment variables pointing to `bar`, as those variables are |
| 64 | + already present. |
| 65 | + |
| 66 | +* The second invocation of Cargo then invokes rustc by using the `RUSTC` |
| 67 | + environment variable and skipping the proxy, which results in the `foo` |
| 68 | + toolchain being invoked. Previous versions of rustup invoked the proxy |
| 69 | + instead, which would correctly detect and use the `bar` toolchain. |
| 70 | + |
| 71 | +Rustup 1.25.1 fixes this regression by reverting the change. The rustup working |
| 72 | +group is discussing in [issue #3035][issue] plans to re-introduce the change in |
| 73 | +a future release while avoiding breakage. |
| 74 | + |
| 75 | +[proxies]: https://rust-lang.github.io/rustup/concepts/proxies.html |
| 76 | +[cargo-env]: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-reads |
| 77 | +[issue]: https://github.com/rust-lang/rustup/issues/3035 |
| 78 | + |
| 79 | +## Thanks |
| 80 | + |
| 81 | +Thanks again to all the contributors who made rustup 1.25.1 possible! |
| 82 | + |
| 83 | +- Daniel Silverstone (kinnison) |
| 84 | +- Robert Collins (rbtcollins) |
| 85 | +- Joshua Nelson (jyn514) |
| 86 | +- Pietro Albini (pietroalbini) |
0 commit comments