5816: Better error if Cargo is not in Path
 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-08-19 14:34:36 +00:00 committed by GitHub
commit 1d19084317
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,11 +151,18 @@ pub fn load(
ProjectWorkspace::Json { project }
}
ProjectManifest::CargoToml(cargo_toml) => {
let cargo_version = utf8_stdout({
let mut cmd = Command::new(toolchain::cargo());
cmd.arg("--version");
cmd
})?;
let cargo = CargoWorkspace::from_cargo_metadata(&cargo_toml, cargo_config)
.with_context(|| {
format!(
"Failed to read Cargo metadata from Cargo.toml file {}",
cargo_toml.display()
"Failed to read Cargo metadata from Cargo.toml file {}, {}",
cargo_toml.display(),
cargo_version
)
})?;
let sysroot = if with_sysroot {