mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 11:20:54 +00:00
Add warning and debug information when cargo metadata
fails
The errors are silently dropped elsewhere, which make it really hard to debug issues due to dependency download failures.
This commit is contained in:
parent
b139e2150e
commit
55d61be9a3
@ -288,7 +288,22 @@ impl CargoWorkspace {
|
|||||||
locked: bool,
|
locked: bool,
|
||||||
progress: &dyn Fn(String),
|
progress: &dyn Fn(String),
|
||||||
) -> anyhow::Result<(cargo_metadata::Metadata, Option<anyhow::Error>)> {
|
) -> anyhow::Result<(cargo_metadata::Metadata, Option<anyhow::Error>)> {
|
||||||
Self::fetch_metadata_(cargo_toml, current_dir, config, sysroot, locked, false, progress)
|
let res = Self::fetch_metadata_(
|
||||||
|
cargo_toml,
|
||||||
|
current_dir,
|
||||||
|
config,
|
||||||
|
sysroot,
|
||||||
|
locked,
|
||||||
|
false,
|
||||||
|
progress,
|
||||||
|
);
|
||||||
|
if let Ok((_, Some(ref e))) = res {
|
||||||
|
tracing::warn!(
|
||||||
|
"`cargo metadata` failed on `{cargo_toml}`, but retry with `--no-deps` succeeded"
|
||||||
|
);
|
||||||
|
tracing::debug!("{e:?}");
|
||||||
|
}
|
||||||
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fetch_metadata_(
|
fn fetch_metadata_(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user