We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a341089 commit 2968c39Copy full SHA for 2968c39
collector/src/toolchain.rs
@@ -589,13 +589,15 @@ pub fn create_toolchain_from_published_version(
589
}
590
591
fn get_lib_dir_from_rustc(rustc: &Path) -> anyhow::Result<PathBuf> {
592
- let sysroot = Command::new(rustc)
593
- .arg("--print")
594
- .arg("sysroot")
595
- .output()?
596
- .stdout;
597
- let sysroot_path = String::from_utf8_lossy(&sysroot);
598
-
+ let output = Command::new(rustc).arg("--print").arg("sysroot").output()?;
+ if !output.status.success() {
+ anyhow::bail!(
+ "rustc failed to provide sysroot, exit status: {}\nstderr: {}",
+ output.status,
+ String::from_utf8_lossy(&output.stderr)
+ );
599
+ }
600
+ let sysroot_path = String::from_utf8_lossy(&output.stdout);
601
Ok(Path::new(sysroot_path.as_ref().trim()).join("lib"))
602
603
0 commit comments