Skip to content

Add components llvm-tools-preview and rustc-dev #2101

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
Apr 11, 2023
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
9 changes: 6 additions & 3 deletions src/docbuilder/rustwide_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use std::sync::Arc;
use tracing::{debug, info, warn};

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

Expand Down Expand Up @@ -188,9 +189,11 @@ impl RustwideBuilder {
// if `rustfmt` is not available in the newer version
// 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") {
warn!("failed to install rustfmt: {}", err);
info!("continuing anyway, since this must be the first build");
for component in COMPONENTS {
if let Err(err) = self.toolchain.add_component(&self.workspace, component) {
warn!("failed to install {component}: {err}");
info!("continuing anyway, since this must be the first build");
}
}

self.rustc_version = self.detect_rustc_version()?;
Expand Down