Skip to content

Commit 89e67be

Browse files
authored
Check output of build command and panic if not successful (#1278)
1 parent 5c8e372 commit 89e67be

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

hermes/build.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ fn main() {
2626

2727
// Run each command to prepare the OUT_DIR with the protobuf definitions. We need to make sure
2828
// to change the working directory to OUT_DIR, otherwise git will complain.
29-
let _ = Command::new("sh")
29+
let output = Command::new("sh")
3030
.args(["-c", protobuf_setup])
3131
.current_dir(&out_dir)
3232
.output()
33-
.expect("failed to setup protobuf definitions");
33+
.expect("failed to run protobuf setup commands");
34+
if !output.status.success() {
35+
panic!(
36+
"failed to setup protobuf definitions: {}",
37+
String::from_utf8_lossy(&output.stderr)
38+
);
39+
}
3440

3541
// We build the resulting protobuf definitions using Rust's prost_build crate, which generates
3642
// Rust code from the protobuf definitions.

0 commit comments

Comments
 (0)