Skip to content

Commit f16b4f6

Browse files
jyn514Joshua Nelson
authored and
Joshua Nelson
committed
Don't require rustfmt on the very first build run
This should only affect contributors, not production in any way.
1 parent efdfa75 commit f16b4f6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/docbuilder/rustwide_builder.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,12 @@ impl RustwideBuilder {
171171
}
172172
// NOTE: rustup will automatically refuse to update the toolchain
173173
// if `rustfmt` is not available in the newer version
174-
self.toolchain.add_component(&self.workspace, "rustfmt")?;
174+
// NOTE: this ignores the error so that you can still run a build without rustfmt.
175+
// This should only happen if you run a build for the first time when rustfmt isn't available.
176+
if let Err(err) = self.toolchain.add_component(&self.workspace, "rustfmt") {
177+
log::warn!("failed to install rustfmt: {}", err);
178+
log::info!("continuing anyway, since this must be the first build");
179+
}
175180

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

0 commit comments

Comments
 (0)