Skip to content

Commit

Permalink
Provide a better error when x.py install src/doc doesn't work.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jul 12, 2021
1 parent 60ff731 commit 166c147
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/bootstrap/install.rs
Expand Up @@ -139,10 +139,12 @@ macro_rules! install {

install!((self, builder, _config),
Docs, "src/doc", _config.docs, only_hosts: false, {
// `expect` should be safe, only None when config.docs is false,
// which is guarded in `should_run`
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 {
Expand Down

0 comments on commit 166c147

Please sign in to comment.