Closed smcv closed 1 year ago
This binary has a setgid bit set on it so it ignores the LD_LIBRARY_PATH environment var, which means it probably picked up classic SDL 1.2, which gives this error message since it doesn't have a video backend named "wayland"
When I removed the setgid bit, it ran with SDL_VIDEODRIVER=wayland without problems.
I've taken to exporting SDL12COMPAT_DEBUG_LOGGING=1, which doesn't do much, but will print a version notice to stderr on startup, which just makes me certain I have the right library and correct build of it.
When you get a moment, please confirm this is the issue, or if I should look further.
Sigh, I'd forgotten how common this meme of "make your game setgid so it can write to a system-wide high score table" used to be. I should probably do some mass-bug-filing in Debian to get people to stop using setgid frivolously - although many of the affected games are essentially unmaintained anyway, so they're unlikely to change any time soon.
I should probably re-test a bunch of the games earlier in the alphabet to make sure they were genuinely using sdl12-compat like I thought they were...
The good news is that if/when we swap from real SDL 1.2 to sdl12-compat as Debian's implementation of the SDL 1.2 ABI (like Fedora and Arch did), we'll no longer be using a custom LD_LIBRARY_PATH
, so it won't matter whether the executable is setgid or not.
I confirm that njam works fine with
SDL_VIDEODRIVER=wayland \
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/sdl12-compat \
SDL12COMPAT_DEBUG_LOGGING=1 \
ld.so /usr/games/njam
which bypasses the setgid bit by using ld.so
as an interpreter.
Prerequisites:
pipewire-pulse
emulating PulseAudioapt install njam
(Debian package version1.25-11
)libsdl1.2-compat
either 1.2.58-1 (packaged in Debian experimental) or commit 63e4393 (locally built)libsdl2-2.0-0
version2.24.1+dfsg-1
To reproduce:
njam
LD_LIBRARY_PATH=.../sdl12-compat/_build njam
SDL_VIDEODRIVER=wayland LD_LIBRARY_PATH=.../sdl12-compat/_build njam
Expected result: all work
Actual result: with sdl12-compat and Wayland,
Error initializing SDL: No available video device