Skip to content

Commit

Permalink
Don't require rustfmt on the very first build run
Browse files Browse the repository at this point in the history
This should only affect contributors, not production in any way.
  • Loading branch information
jyn514 authored and Joshua Nelson committed Aug 3, 2020
1 parent efdfa75 commit f16b4f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/docbuilder/rustwide_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,12 @@ impl RustwideBuilder {
}
// NOTE: rustup will automatically refuse to update the toolchain
// if `rustfmt` is not available in the newer version
self.toolchain.add_component(&self.workspace, "rustfmt")?;
// NOTE: this ignores the error so that you can still run a build without rustfmt.
// This should only happen if you run a build for the first time when rustfmt isn't available.
if let Err(err) = self.toolchain.add_component(&self.workspace, "rustfmt") {
log::warn!("failed to install rustfmt: {}", err);
log::info!("continuing anyway, since this must be the first build");
}

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

0 comments on commit f16b4f6

Please sign in to comment.