Skip to content

Commit fe3286d

Browse files
smoeliusjyn514
authored andcommitted
Add components llvm-tools-preview and rustc-dev
1 parent fd94bfc commit fe3286d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/docbuilder/rustwide_builder.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use std::sync::Arc;
3030
use tracing::{debug, info, warn};
3131

3232
const USER_AGENT: &str = "docs.rs builder (https://github.com/rust-lang/docs.rs)";
33+
const COMPONENTS: &[&str] = &["llvm-tools-preview", "rustc-dev", "rustfmt"];
3334
const DUMMY_CRATE_NAME: &str = "empty-library";
3435
const DUMMY_CRATE_VERSION: &str = "1.0.0";
3536

@@ -188,9 +189,11 @@ impl RustwideBuilder {
188189
// if `rustfmt` is not available in the newer version
189190
// NOTE: this ignores the error so that you can still run a build without rustfmt.
190191
// This should only happen if you run a build for the first time when rustfmt isn't available.
191-
if let Err(err) = self.toolchain.add_component(&self.workspace, "rustfmt") {
192-
warn!("failed to install rustfmt: {}", err);
193-
info!("continuing anyway, since this must be the first build");
192+
for component in COMPONENTS {
193+
if let Err(err) = self.toolchain.add_component(&self.workspace, component) {
194+
warn!("failed to install {component}: {err}");
195+
info!("continuing anyway, since this must be the first build");
196+
}
194197
}
195198

196199
self.rustc_version = self.detect_rustc_version()?;

0 commit comments

Comments
 (0)