(core): fix processing of glsl files with glslang
Summary
- Sheldon crashes when checking glsl files
Steps to reproduce
- Add a new glsl file to the resources and check it with sheldon
Dev environment
- OS: Linux
- Commit: 23b0049a
Relevant logs and/or screenshots
- Error output by sheldon:
* [Sheldon] Checking file modules/viz/us/rc/glsl/Transparency.inc.glsl with: ()
* [Sheldon] Checking file modules/viz/us/rc/glsl/Transparency.inc.glsl with: ('-DCELL_SHADING_DEPTH_PEELING=1',)
* [Warning] glslang preprocessor failed for : modules/viz/us/rc/glsl/Transparency.inc.glsl *
* [Warning] using the following #defines : ('-DCELL_SHADING_DEPTH_PEELING=1',) *
* [Warning] Aborting *
Traceback (most recent call last):
File "/home/aancel/git/git.ircad.fr/sight/sight-git/hooks/sheldon", line 179, in <module>
results += [f(files) for name, f in hooks.items() if name in active_hooks]
File "/home/aancel/git/git.ircad.fr/sight/sight-git/hooks/sheldon", line 179, in <listcomp>
results += [f(files) for name, f in hooks.items() if name in active_hooks]
File "/home/aancel/git/git.ircad.fr/sight/sight-git/hooks/glslang_validator.py", line 300, in glslang_validator
abort = validate_glsl(f, sight_include_dirs) or abort
File "/home/aancel/git/git.ircad.fr/sight/sight-git/hooks/glslang_validator.py", line 253, in validate_glsl
os.remove(tmp_file)
TypeError: remove: path should be string, bytes or os.PathLike, not NoneType
- After the fix:
* [Sheldon] Checking file modules/viz/us/rc/glsl/Transparency.inc.glsl with: ()
* [Sheldon] Checking file modules/viz/us/rc/glsl/Transparency.inc.glsl with: ('-DCELL_SHADING_DEPTH_PEELING=1',)
* [Warning] glslang preprocessor failed for : modules/viz/us/rc/glsl/Transparency.inc.glsl *
* [Warning] using the following #defines : ('-DCELL_SHADING_DEPTH_PEELING=1',) *
* [Warning] Aborting *
* [Sheldon] Checking file modules/viz/us/rc/glsl/Video_w_Mask_FP.glsl with: ()
* [Sheldon] Checking file modules/viz/us/rc/glsl/Video_w_Mask_FP.glsl with: ('-DMASK=1',)
* [Sheldon] Checking glsl version in : modules/viz/us/rc/glsl/Video_w_Mask_FP.glsl
************************************************************************************************************************
* [Warning] Check failed !!! Check error messages above. *
* [Warning] Please fix the issues, stage modifications with 'git add' and run 'sheldon' again. *
************************************************************************************************************************
Edited by Alexandre ANCEL