OpenMandrivaSoftware / steam_xdg_enforcer

Rewrites the paths accessed by Steam into proper ones by using FUSE.
GNU General Public License v3.0
15 stars 0 forks source link

Unable to run Proton games with enforcer active #4

Closed 62832 closed 1 year ago

62832 commented 1 year ago

While the XDG enforcer runs, Steam seems to be unable to play games via Proton. So far the only title I have just now tested is the original Binding of Isaac, which consistently refuses to launch under Proton unless Steam is restarted without the enforcer running alongside.

It may be worth noting that when trying to install said game with the enforcer active, the initial Proton prefix would also remain entirely empty. However, installing the game without it and populating the prefix beforehand doesn't help either with the launch bug.

My current wrapper script for steam-runtime is as follows. The enforcer is installed under a tools sub-directory I made for various Steam-related utilities.

#!/bin/sh
MOUNT_POINT="$STEAM_RUN_DIR/.steam"

mkdir -p "$MOUNT_POINT"
"$STEAM_DATA_DIR"/tools/xdg-enforcer/steam_xdg_enforcer "$MOUNT_POINT"

HOME="$STEAM_RUN_DIR" "$STEAM_DATA_DIR"/steam.sh "$@"

umount "$MOUNT_POINT"
62832 commented 1 year ago

Running the wrapper script in a terminal reveals the following output:

Game process added : AppID 113200 "/extra/_/Games/Steam/ubuntu12_32/reaper SteamLaunch AppId=113200 -- /extra/_/Games/Steam/ubuntu12_32/steam-launch-wrapper -- '/run/user/1000/steam/.steam/root/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/run/user/1000/steam/.steam/root/steamapps/common/Proton - Experimental'/proton waitforexitandrun  '/run/user/1000/steam/.steam/root/steamapps/common/The Binding Of Isaac/Isaac.exe'", ProcID 6206, IP 0.0.0.0:0
chdir "/run/user/1000/steam/.steam/root/steamapps/common/The Binding Of Isaac"
ERROR: ld.so: object '/run/user/1000/steam/.steam/root/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/run/user/1000/steam/.steam/root/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/run/user/1000/steam/.steam/root/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/run/user/1000/steam/.steam/root/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/run/user/1000/steam/.steam/root/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
pressure-vessel-wrap[6207]: E: Unable to create symlink "./lib64/ld-linux-x86-64.so.2" in "/run/user/1000/steam/.steam/root/steamapps/common/SteamLinuxRuntime_sniper/var/tmp-6JTX31/usr": No such file or directory
GameAction [AppID 113200, ActionID 1] : LaunchApp changed task to WaitingGameWindow with ""
GameAction [AppID 113200, ActionID 1] : LaunchApp changed task to Completed with ""
Game process removed: AppID 113200 "/extra/_/Games/Steam/ubuntu12_32/reaper SteamLaunch AppId=113200 -- /extra/_/Games/Steam/ubuntu12_32/steam-launch-wrapper -- '/run/user/1000/steam/.steam/root/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/run/user/1000/steam/.steam/root/steamapps/common/Proton - Experimental'/proton waitforexitandrun  '/run/user/1000/steam/.steam/root/steamapps/common/The Binding Of Isaac/Isaac.exe'", ProcID 6206 
ThreadGetProcessExitCode: no such process 6208
ThreadGetProcessExitCode: no such process 6207
davidebeatrici commented 1 year ago

Thank you for your report!

Could you perhaps also check the enforcer's debug output? You can run it in foreground with the -f argument and then launch Steam in a separate terminal session.

Please note that the debug messages are only compiled in debug mode (i.e. CMAKE_BUILD_TYPE set to Debug).

62832 commented 1 year ago

Sure thing, though it is pretty crowded when run in the foreground. Is there anything in particular I should be looking for within the debug output?

E: Hold that thought, this only seems to be a problem when the HOME is set to be the same as STEAM_RUN_DIR. Running Steam alongside without specifying a different home directory seemingly causes no issue when running TBoI through Proton.

davidebeatrici commented 1 year ago

Interesting.

pressure-vessel-wrap[6207]: E: Unable to create symlink "./lib64/ld-linux-x86-64.so.2" in "/run/user/1000/steam/.steam/root/steamapps/common/SteamLinuxRuntime_sniper/var/tmp-6JTX31/usr": No such file or directory

I would look for [symlink] in the debug output.

62832 commented 1 year ago

Out of the whole debug log, these are the lines I could find referencing [fs_symlink] when running with HOME="$STEAM_RUN_DIR".

[fs_symlink] rmt-tar -> rmt-tar
[fs_symlink] /root/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-E7Q731/usr/sbin/rmt -> /extra/_/Games/Steam/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-E7Q731/usr/sbin/rmt
...
[fs_symlink] agetty -> agetty
[fs_symlink] /root/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-E7Q731/usr/sbin/getty -> /extra/_/Games/Steam/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-E7Q731/usr/sbin/getty
...
[fs_symlink] ../lib/locale -> ../lib/locale
[fs_symlink] /root/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-E7Q731/usr/lib64/locale -> /extra/_/Games/Steam/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-E7Q731/usr/lib64/locale
...
[fs_symlink] /lib/x86_64-linux-gnu/ld-2.28.so -> (null)
...
[fs_symlink] /extra/_/Games/Steam/steamapps/common/Proton - Experimental/files/share/fonts/times.ttf -> (null)

I also spoke too soon regarding that first edit, since I didn't realise the enforcer simply won't run if the mount point given is different to the HOME directory Steam is started with.

davidebeatrici commented 1 year ago

Technically it still runs, but doesn't intercept Steam's calls as they target another root.

No problem though, you have already spotted the relevant debug lines.

https://github.com/OpenMandrivaSoftware/steam_xdg_enforcer/blob/d97226b8190bc1f69f59be6d6b5ecfdbac156511/path.c#L118-L157

The code above mistakenly doesn't accept paths that are outside Steam's directory.

Could you check whether #5 fixes the issue, please?

62832 commented 1 year ago

Yeah, that seemed to work. Many thanks!

davidebeatrici commented 1 year ago

Thank you very much for testing and providing detailed debug info!