Skip to content

Don't require rustfmt for the very first build #931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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