Skip to content

Commit

Permalink
fix inability to differentiate between no failed deps and all failed …
Browse files Browse the repository at this point in the history
…deps pkg ids can't be parsed
  • Loading branch information
Skgland committed Dec 18, 2024
1 parent f950b27 commit b4bfa7b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/runner/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ fn run_cargo(
let mut did_trybuild = false;
let mut ran_out_of_space = false;
let mut error_codes = BTreeSet::new();
let mut deps = BTreeSet::new();
let mut deps: Option<BTreeSet<Crate>> = None;

let mut detect_error = |line: &str, actions: &mut ProcessLinesActions| {
if line.contains("urlopen error") && line.contains("Temporary failure in name resolution") {
Expand Down Expand Up @@ -189,11 +189,13 @@ fn run_cargo(
// If the error is in a crate that is not local then it's referred to a dependency
// of the current crate
(DiagnosticLevel::Error, pkgid) => {
let deps = deps.get_or_insert_default();
if let Ok(krate) = Crate::try_from(pkgid) {
deps.insert(krate);
}
}
(DiagnosticLevel::Ice, pkgid) => {
let deps = deps.get_or_insert_default();
if let Ok(krate) = Crate::try_from(pkgid) {
deps.insert(krate);
}
Expand Down Expand Up @@ -233,7 +235,7 @@ fn run_cargo(
Err(e.context(FailureReason::ICE).into())
} else if ran_out_of_space {
Err(e.context(FailureReason::NoSpace).into())
} else if !deps.is_empty() {
} else if let Some(deps) = deps {
Err(e.context(FailureReason::DependsOn(deps)).into())
} else if !error_codes.is_empty() {
Err(e.context(FailureReason::CompilerError(error_codes)).into())
Expand Down

0 comments on commit b4bfa7b

Please sign in to comment.