From ec66f7419f2155d1b4bd852fdc3da87646d865c0 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sun, 12 Jul 2026 14:04:54 -0700 Subject: print error messages from glslang it's quite annoying otherwise, the build would fail with no explanation Force-Push: yes Change-Id: Ia5405c1f0e63f778da49ca1c85139f5e785fde29 --- build.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/build.rs b/build.rs index dde9a94..b4ffa72 100644 --- a/build.rs +++ b/build.rs @@ -31,15 +31,18 @@ fn process_all () -> std::io::Result<()> { .join(format!("{}.spv", input_path.file_name().unwrap().to_str().unwrap())); - if !Command::new("glslang") - .arg("-V") - .arg(&input_path) - .arg("-o") - .arg(output_path) - .status()?.success() - { - println!("cargo::error=Failed to compile shader {}", + let result = Command::new("glslang") + .arg("-V") + .arg(&input_path) + .arg("-o") + .arg(output_path) + .output()?; + if !result.status.success() { + println!("cargo::error=Failed to compile shader {}; details follow.", input_path.display()); + for line in std::str::from_utf8(&result.stdout).unwrap().lines() { + println!("cargo::error={}", line); + } } println!("cargo::rerun-if-changed={}", input_path.display()); -- cgit 1.4.1