Skip to content

Commit 01016e6

Browse files
jyn514Joshua Nelson
authored and
Joshua Nelson
committed
Add rustup when installing a new toolchain
Example build: ``` 2020/07/26 20:02:52 [INFO] rustwide::toolchain: adding component rustfmt for toolchain nightly 2020/07/26 20:02:52 [INFO] rustwide::cmd: running `Command { std: "/home/joshua/src/rust/docs.rs/.rustwide/cargo-home/bin/rustup" "component" "add" "--toolchain" "nightly" "rustfmt", kill_on_drop: false }` 2020/07/26 20:02:53 [INFO] rustwide::cmd: [stderr] info: downloading component 'rustfmt' 2020/07/26 20:02:54 [INFO] rustwide::cmd: [stderr] info: installing component 'rustfmt' ``` This was tested by building `fermium 0.0.11` with the new changes. I have not tested the upgrade behavior, so possibly this shouldn't be merged until I do that.
1 parent aef8426 commit 01016e6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: src/db/pool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub enum PoolError {
8989
#[fail(display = "the provided database URL was not valid")]
9090
InvalidDatabaseUrl(#[fail(cause)] postgres::Error),
9191

92-
#[fail(display = "failed to create the connection pool")]
92+
#[fail(display = "failed to create the database connection pool")]
9393
PoolCreationFailed(#[fail(cause)] r2d2::Error),
9494

9595
#[fail(display = "failed to get a database connection")]

Diff for: src/docbuilder/rustwide_builder.rs

+3
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ impl RustwideBuilder {
166166
for target in &targets_to_install {
167167
self.toolchain.add_target(&self.workspace, target)?;
168168
}
169+
// NOTE: rustup will automatically refuse to update the toolchain
170+
// if `rustfmt` is not available in the newer version
171+
self.toolchain.add_component(&self.workspace, "rustfmt")?;
169172

170173
self.rustc_version = self.detect_rustc_version()?;
171174
if old_version.as_deref() != Some(&self.rustc_version) {

0 commit comments

Comments
 (0)