Skip to content

Conversation

@emersion
Copy link

@emersion emersion commented Jan 3, 2026

When glslang is integrated into a build system (like Meson), stdout is stored in an output file and stderr is printed to the user. This hides error messages from the user. See: mesonbuild/meson#11506

stderr is the standard stream errors should get printed to, always use that.

@CLAassistant
Copy link

CLAassistant commented Jan 3, 2026

CLA assistant check
All committers have signed the CLA.

externalmirrors-syncer bot pushed a commit to external-mirrors/wlroots that referenced this pull request Jan 5, 2026
Currently, the glslang check is run every time ninja is invoked,
even with an up-to-date build directory when GLSL shaders haven't
been modified. This is due to glslang not creating any output
file: the _check file never exists so ninja keeps trying to
generate it by running the command.

Unfortunately Meson doesn't support running commands with no
outputs [1]. Create an empty output file to fix this by setting
`capture: true`.

This doesn't work out-of-the-box, because glslang prints messages
to stdout, and provides no way to change this [2]. As a result,
shader errors are not surfaced back to the user - they end up in
the _check file. Workaround this with a thin wrapper which
redirects stdout to stderr when invoking glslang.

[1]: mesonbuild/meson#11506
[2]: KhronosGroup/glslang#4138
@emersion emersion force-pushed the log-stderr branch 2 times, most recently from 26aaff0 to df48165 Compare January 5, 2026 23:13
Copy link
Collaborator

@dnovillo dnovillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be confusing tests expecting output on stdout, though. They will need to be adapted. I think you may find failures in the testsuite with this.

When glslang is integrated into a build system (like Meson), stdout
is stored in an output file and stderr is printed to the user. This
hides error messages from the user. See:
mesonbuild/meson#11506

stderr is the standard stream errors should get printed to, always
use that.
@emersion
Copy link
Author

emersion commented Jan 6, 2026

Ah, I attempted a fix but it only fixed a few tests. Tried a more general fix in the last push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants