Don't use dbg for printing stdout/stderr

They are byte buffers, not strings. A pretty print has been added accordingly.
This commit is contained in:
Luke Parker 2023-07-24 15:35:43 -04:00
parent 24dba66bad
commit 6df1b46313
No known key found for this signature in database

View file

@ -125,8 +125,19 @@ pub fn build(name: String) {
.output()
.unwrap();
if !res.status.success() {
dbg!(res.stdout);
dbg!(res.stderr);
println!("failed to build {name}\n");
println!("-- stdout --");
println!(
"{}\r\n",
String::from_utf8(res.stdout)
.unwrap_or_else(|_| "stdout had non-utf8 characters".to_string())
);
println!("-- stderr --");
println!(
"{}\r\n",
String::from_utf8(res.stderr)
.unwrap_or_else(|_| "stderr had non-utf8 characters".to_string())
);
panic!("failed to build {name}");
}