New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
steam: add wrapper testing for libGL #33213
Conversation
NixOS: Failing to set hardware.opengl.driSupport32Bit will lead to a confusing error message about missing libGL.so.1. We include a wrapper around the steam bin to test for working 32bit opengl with glxinfo. When failing, we display a proper warning hinting towards the option. Fixes: #19518
pkgs/games/steam/chrootenv.nix
Outdated
glxinfo >/dev/null 2>&1 | ||
if [ ! "$?" = "0" ]; then | ||
echo "*** WARNING: Test for 32-bit libGL unsuccessful." | ||
echo " This could mean you forgot to activate hardware.opengl.driSupport32Bit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go into stderr
. Also, heredoc would be preferrable:
cat <<EOF > /dev/stderr
WARNING: Test for 32-bit libGL unsuccessful.
This could mean you forgot to activate hardware.opengl.driSupport32Bit
EOF
While it would make Steam start, to make it actually work one would also need to enable
Also, Steam can be installed on other Linux distributions and not just NixOS. It should check if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
@yegortimoshenko checking for /host/etc/NIXOS causes the following assert to fail:
Any pointers? Also, the HEREDOC leads to ugly indentations; what's your preference here? |
I don't understand why it fails: it works in underlying
It is just less error-prone: for example, if someone were to add another line to the message, with echo they would have to wrap it in |
Presumably, this is a bug in |
/cc @ixmatus |
Maybe my build/test-environment was somehow tainted; I don't understand it either. I will dig into it tomorrow and try to get a proper and clean build. As for the heredoc:
I'm not reall happy with this.
|
Compare:
and:
Breaking indentation is actually a feature: it lets you fit 80 chars in a line no matter how deep your shell script is nested up to that point. |
assert: I'm an idiot and missed escaping the backticks, explaining the assert failure perfectly. |
@yegortimoshenko Sorry, I'm not sure if I'm supposed to tag you after I think I did all the changes you wanted. Edit: I also just now noticed that the current wrapper does not pass-through the arguments. Adding that is probably a good idea, even though the steam binary doesn't seem to take any. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Motivation for this change
Failing to set hardware.opengl.driSupport32Bit will lead to a
confusing error message about missing libGL.so.1 as described in #19518
Things done
We include a wrapper around the steam bin to test for working 32bit
opengl with glxinfo. When failing, we display a proper warning hinting
towards the option.
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)Tested on local NixOS machine by activating/deactivating hardware.opengl.driSupport and hardware.opengl.driSupport32Bit. In all cases it gave the expected result: