Skip to content

Commit 0ff78b4

Browse files
committed
show build diagnostics even if build fails
1 parent a92227a commit 0ff78b4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,6 @@ fn cargo_build(matches: &ArgMatches, metadata: &Metadata) -> Result<Option<Artif
428428
let messages = Message::parse_stream(stdout).collect::<Vec<_>>();
429429

430430
let status = child.wait()?;
431-
if !status.success() {
432-
bail!("Failed to parse crate metadata");
433-
}
434431

435432
let mut target_artifact: Option<Artifact> = None;
436433
for message in messages {
@@ -457,6 +454,10 @@ fn cargo_build(matches: &ArgMatches, metadata: &Metadata) -> Result<Option<Artif
457454
}
458455
}
459456

457+
if !status.success() {
458+
bail!("Failed to parse crate metadata");
459+
}
460+
460461
if target_artifact.is_none() {
461462
bail!("Could not determine the wanted artifact");
462463
}

0 commit comments

Comments
 (0)