Skip to content

Commit a9fa164

Browse files
committed
[ET-VK][ez] Log GLSL file path on compile error
## Context Make it much easier to debug GLSL compile errors by logging the path of the GLSL file when it fails to compile. This makes it easy to quickly open up the generated GLSL and see what the compiler is complaining about. Differential Revision: [D70795732](https://our.internmc.facebook.com/intern/diff/D70795732/) [ghstack-poisoned]
1 parent e673f7c commit a9fa164

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

backends/vulkan/runtime/gen_vulkan_spv.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,12 @@ def process_shader(shader_paths_pair):
769769
+ self.glslc_flags.split()
770770
)
771771

772-
subprocess.check_call(cmd)
772+
try:
773+
subprocess.check_call(cmd)
774+
except subprocess.CalledProcessError as e:
775+
raise RuntimeError(
776+
f"Failed to compile {os.getcwd()}/{glsl_out_path}"
777+
) from e
773778

774779
return (spv_out_path, glsl_out_path)
775780

0 commit comments

Comments
 (0)