about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <jnelson@cloudflare.com>2022-07-10 21:30:06 -0500
committerJoshua Nelson <jnelson@cloudflare.com>2022-07-10 21:53:06 -0500
commit939510348d841b081dbfe49766d220740c580e97 (patch)
tree42ae3cce8d2beb21cfb9cdddaf3cb55ba9981630
parentc396bb3b8a16b1f2762b7c6078dc3e023f6a2493 (diff)
downloadrust-939510348d841b081dbfe49766d220740c580e97.tar.gz
rust-939510348d841b081dbfe49766d220740c580e97.zip
Give a better error when `x dist` fails for an optional tool
Before:
```
thread 'main' panicked at 'Unable to build RLS', dist.rs:42:9
```

After:
```
thread 'main' panicked at 'Unable to build submodule tool RLS (use `missing-tools = true` to ignore this failure)
note: not all tools are available on all nightlies
help: see https://forge.rust-lang.org/infra/toolstate.html for more information', dist.rs:43:9
```
-rw-r--r--src/bootstrap/dist.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 4aadc3943c9..cba013b5bb6 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -39,7 +39,11 @@ fn missing_tool(tool_name: &str, skip: bool) {
     if skip {
         println!("Unable to build {}, skipping dist", tool_name)
     } else {
-        panic!("Unable to build {}", tool_name)
+        let help = "note: not all tools are available on all nightlies\nhelp: see https://forge.rust-lang.org/infra/toolstate.html for more information";
+        panic!(
+            "Unable to build submodule tool {} (use `missing-tools = true` to ignore this failure)\n{}",
+            tool_name, help
+        )
     }
 }