Skip to content

Commit c85950c

Browse files
committed
build-tools: Fix reporting of errors
Signed-off-by: Aaron Erhardt <[email protected]>
1 parent e616855 commit c85950c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

glib-build-tools/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,20 @@ use std::{env, path::Path, process::Command};
1818
pub fn compile_resources<P: AsRef<Path>>(source_dir: P, gresource: &str, target: &str) {
1919
let out_dir = env::var("OUT_DIR").unwrap();
2020

21-
let status = Command::new("glib-compile-resources")
21+
let output = Command::new("glib-compile-resources")
2222
.arg("--sourcedir")
2323
.arg(source_dir.as_ref())
2424
.arg("--target")
2525
.arg(&format!("{out_dir}/{target}"))
2626
.arg(gresource)
27-
.status()
27+
.output()
2828
.unwrap();
2929

3030
assert!(
31-
status.success(),
32-
"glib-compile-resources failed with exit status {status}",
31+
output.status.success(),
32+
"glib-compile-resources failed with exit status {} and stderr:\n{}",
33+
output.status,
34+
String::from_utf8_lossy(&output.stderr)
3335
);
3436

3537
println!("cargo:rerun-if-changed={gresource}");

0 commit comments

Comments
 (0)