Unnamed repository; edit this file 'description' to name the repository.
Merge #10824
10824: project_model: print full cargo command if cargo metadata fails to run r=Veykril a=jhgg well, `Command` implements a sensible `Debug` which *roughly* does what we want to do. Unfortunately it's got a bit of a quote situation, So it'd output something like `"cargo" "metadata" "--format-version" "1" "--features" "foo,bar,baz"`. Which although is a bit verbose with the quotes, it's at the very least, not entirely incorrect/misleading. fixes #10797 Co-authored-by: Jake Heinz <[email protected]>
bors[bot] 2021-11-25
parent 4ca6233 · parent 03eb9f3 · commit 870e730
-rw-r--r--crates/project_model/src/cargo_workspace.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/project_model/src/cargo_workspace.rs b/crates/project_model/src/cargo_workspace.rs
index 24b7398ee6..85123ed5c5 100644
--- a/crates/project_model/src/cargo_workspace.rs
+++ b/crates/project_model/src/cargo_workspace.rs
@@ -286,9 +286,8 @@ impl CargoWorkspace {
// unclear whether cargo itself supports it.
progress("metadata".to_string());
- let meta = meta.exec().with_context(|| {
- format!("Failed to run `cargo metadata --manifest-path {}`", cargo_toml.display(),)
- })?;
+ let meta =
+ meta.exec().with_context(|| format!("Failed to run `{:?}`", meta.cargo_command()))?;
Ok(meta)
}