[Mesa-dev] [PATCH 4/9] glsl: When failing to compile some builtins, print the error.

Eric Anholt eric at anholt.net
Mon Mar 12 18:08:17 PDT 2012


This makes the process slightly more debuggable, though it would be
nice if the build just failed immediately instead.
---
 src/glsl/builtins/tools/generate_builtins.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
index 72d12bb..9ab6edd 100755
--- a/src/glsl/builtins/tools/generate_builtins.py
+++ b/src/glsl/builtins/tools/generate_builtins.py
@@ -63,6 +63,14 @@ def run_compiler(args):
     p = Popen(command, 1, stdout=PIPE, shell=False)
     output = p.communicate()[0]
 
+    if (p.returncode):
+        sys.stderr.write("Failed to compile builtins with command:\n")
+        for arg in command:
+            sys.stderr.write(arg + " ")
+        sys.stderr.write("\n")
+        sys.stderr.write("Result:\n")
+        sys.stderr.write(output)
+
     # Clean up output a bit by killing whitespace before a closing paren.
     kill_paren_whitespace = re.compile(r'[ \n]*\)', re.MULTILINE)
     output = kill_paren_whitespace.sub(')', output)
-- 
1.7.9.1



More information about the mesa-dev mailing list