HaxeFoundation/hashlink

Native Linux SDL builds can not be run through Steam

csclyde opened this issue · 1 comments

When building my HashLink application for Linux, it mostly works fine. But when I download and launch the game through Steam, it immediately crashes. The relevant error I get is this:

src/App.hx:24: Successfully initialized Steam
SIGNAL 11
sdl.$Window.__constructor__(sdl/Window.hx:74)
hxd.$Window.__constructor__(hxd/Window.hl.hx:100)
hxd.$System.start(hxd/System.hl.hx:117)
hxd.$App.__constructor__(hxd/App.hx:45)
$App.__constructor__(App.hx:3)
$App.main(App.hx:28)
fun$9256(?:1)

The segfault seems to be coming from this line of sdl.Window.hx:
if( glctx == null || !GL.init() || !testGL() ) {

I think it is having an issue initializing OpenGL. If I go to the Steam local files for the installed game, it runs fine. So I think the problem is some incompatibility between SDL/OpenGL installed for the OS, and the version Steam uses on Linux in the "Steam Runtime".

Having native Linux builds working with Steam would be a huge boon. I noticed this same problem with Nuclear Blaze, and I assume it is the same with Dead Cells and Northgard.

Fixed, because Steam needs to launch a shell script that bypasses the Steam Runtime, then launches the game. Here is the contents of the "run.sh" file, for anyone looking for an answer to this later on:

LD_PRELOAD= LD_LIBRARY_PATH=. ./hl