Skip to content

Commit

Permalink
Rollup merge of rust-lang#87007 - ehuss:fix-rust-analyzer-install, r=…
Browse files Browse the repository at this point in the history
…Mark-Simulacrum

Fix rust-analyzer install when not available.

This changes it so that `x.py install` won't fail if rust-analyzer isn't available. This was changed in rust-lang#86568 to handle the case where installing on stable/beta, and `extended=true`, to skip rust-analyzer. But I neglected to update the install part to also ignore it.

Fixes rust-lang#86999
  • Loading branch information
JohnTitor committed Jul 12, 2021
2 parents a499273 + 166c147 commit 2d9a038
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/bootstrap/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,17 @@ macro_rules! install {

install!((self, builder, _config),
Docs, "src/doc", _config.docs, only_hosts: false, {
let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs");
install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball);
if let Some(tarball) = builder.ensure(dist::Docs { host: self.target }) {
install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball);
} else {
panic!("docs are not available to install, \
check that `build.docs` is true in `config.toml`");
}
};
Std, "library/std", true, only_hosts: false, {
for target in &builder.targets {
// `expect` should be safe, only None when host != build, but this
// only runs when host == build
let tarball = builder.ensure(dist::Std {
compiler: self.compiler,
target: *target
Expand All @@ -165,10 +171,15 @@ install!((self, builder, _config),
}
};
RustAnalyzer, "rust-analyzer", Self::should_build(_config), only_hosts: true, {
let tarball = builder
.ensure(dist::RustAnalyzer { compiler: self.compiler, target: self.target })
.expect("missing rust-analyzer");
install_sh(builder, "rust-analyzer", self.compiler.stage, Some(self.target), &tarball);
if let Some(tarball) =
builder.ensure(dist::RustAnalyzer { compiler: self.compiler, target: self.target })
{
install_sh(builder, "rust-analyzer", self.compiler.stage, Some(self.target), &tarball);
} else {
builder.info(
&format!("skipping Install rust-analyzer stage{} ({})", self.compiler.stage, self.target),
);
}
};
Clippy, "clippy", Self::should_build(_config), only_hosts: true, {
let tarball = builder.ensure(dist::Clippy { compiler: self.compiler, target: self.target });
Expand Down Expand Up @@ -212,6 +223,8 @@ install!((self, builder, _config),
}
};
Analysis, "analysis", Self::should_build(_config), only_hosts: false, {
// `expect` should be safe, only None with host != build, but this
// only uses the `build` compiler
let tarball = builder.ensure(dist::Analysis {
// Find the actual compiler (handling the full bootstrap option) which
// produced the save-analysis data because that data isn't copied
Expand Down

0 comments on commit 2d9a038

Please sign in to comment.