Automatically install override toolchain when missing.#1250
Automatically install override toolchain when missing.#1250bors merged 2 commits intorust-lang:masterfrom
Conversation
9d49300 to
6c4c5e1
Compare
|
cc @nrc @Diggsey @alexcrichton @withoutboats -- any of you up for reviewing? |
|
I'm not that comfortable having it automatically install the new toolchain, I can imagine that would be unacceptable to some people. I can see a few alternatives:
Would one or more of those work for you? @alexcrichton thoughts? |
|
Servo tries to keep up with Rust nightly, which means upgrading several times a month. I think it is important that this is as seamless as possible for regular contributors. Pulling from So I think option 2 is not particularly useful. Option 1 seems tricky for two reasons: this code path is often used in non-interactive environments (e.g. Travis-CI) where prompting would just hang. As to the command line argument, I don’t know where it should go for proxy executables like Option 3 sounds like that config should be owned by the user and Servo’s build system should not mess with it. What do you think of an environment variable? |
|
Should all this apply only to |
|
Given that the behaviour is only triggered by building a project with a toolchain file, it seems to me that the user has already opted-in. I don't think this is difference from Cargo downloading a crate for a build. At most we should get the user's consent once per project (e.g., the first time you build Servo, rustup asks if it should download a toolchains, user can then opt-in to auto-downloads or get errors, but I don't think even that is necessary. |
|
I agree that this is similar to automatically downloading dependency crates. @Diggsey, what do you think of that point of view, or of the environment variable approach? |
|
I personally agree with @nrc that if this is only used in conjunction with In reading this, though, I had a few questions:
|
|
What is This PR is relevant when:
Each of these cases end up going through the same code path. |
|
@SimonSapin oh sorry, I meant the It sounds like though it's already working! Sounds good to me that we'd also include overrides and the env var. Can you add a test (or maybe there already is one?) about |
A typical scenario is: * I work on a repository that uses `rust-toolchain` to pin to a specific Nightly version * I run `git pull`, `rust-toolchain` has been changed to update to a new Rust version * I run `cargo build` Result before this PR (typically): rustup fails with an error like: ``` error: override toolchain 'nightly-2017-08-31' is not installed info: caused by: the toolchain file at '/home/simon/projects/servo/rust-toolchain' specifies an uninstalled toolchain ``` A better result would be to install toolchains as needed. Closes rust-lang#1218
6c4c5e1 to
eae3131
Compare
|
I’ve pushed a new commit with the requested tests. |
|
@bors: r+ Thanks! |
|
📌 Commit eae3131 has been approved by |
Automatically install override toolchain when missing. A typical scenario is: * I work on a repository that uses `rust-toolchain` to pin to a specific Nightly version * I run `git pull`, `rust-toolchain` has been changed to update to a new Rust version * I run `cargo build` Result before this PR (typically): rustup fails with an error like: ``` error: override toolchain 'nightly-2017-08-31' is not installed info: caused by: the toolchain file at '/home/simon/projects/servo/rust-toolchain' specifies an uninstalled toolchain ``` A better result would be to automatically install toolchains as needed. Closes #1218
|
☀️ Test successful - status-appveyor, status-travis |
|
Could we get a new release with this change? Can I help? |
|
Sorry I've been slow to respond, I will try to get to a release when I get a chance |
A typical scenario is:
rust-toolchainto pin to a specific Nightly versiongit pull,rust-toolchainhas been changed to update to a new Rust versioncargo buildResult before this PR (typically): rustup fails with an error like:
A better result would be to automatically install toolchains as needed.
Closes #1218