calendulish / stlib

Async library that provides features related to Steam client and compatible stuffs
GNU General Public License v3.0
15 stars 2 forks source link

[Feature Request] Flatpak Support #26

Closed RozeFound closed 2 months ago

RozeFound commented 1 year ago

Is your feature request related to a problem? Please describe. stlib as well as SteamworksPy can't see running steam installed thru flatpak, and throw SteamNotRunningException.

Describe the solution you'd like I want to interact with steamwoks regardless of flatpak isolation, no matter if the script is isolated in flatpak (but still have rw right to steam directories), nor steam is installed with flatpak. if possible, without user intervention.

Describe alternatives you've considered The only solution I see is write a steam module in Rust with use of steamworks-rs lib as it appears to somehow work (not tested) and then use it in python code.

Additional context A lot of users install software thru flatpak these days because it's convenient for users and for developers, but, one of it's main features tend to hurt such interprocess interactions as steamworks, and that feature is isolation. I would like to ask you to implement Flatpak support if even possible, which is looks like the case as of this issue.

calendulish commented 2 months ago

After some investigation, I came to the conclusion that it don't worth implementing at this time. Applications installed through flatpak run in their own environment isolated from the host, that is the whole idea of ​​the sandboxing. The stlib uses a C wrapper to access the SteamWorks, which communicates with the Steam client loading the same shared library used by the running client, and this behavior is managed by SteamWorks itself, which currently has the interaction hardcoded in the proprietary code. The issue isn't related to file permission, but memory permission.

The options we have would be to modify SteamWorks itself to consider situations like this, since it 'as-is' will always use the internal defaults when a steam instance isn't found, but this modification is also not possible due to Valve's license that don't allow it.

A second solution would be to recompile our wrapper with some hacks that makes it slip into the steam sandbox process when loaded, this way the native ipc would work, but this is insane, grotesque, essentially a spyware.

A solution that needs user interaction would be something similar to what you already mentioned, modifying the path of the files with symlinks and loosen flatpak permissions, but this is also an ugly hack and can break things (e.g. in case the user has the normal version and flatpak version installed).

The ideal would be for Steam to use some interface, like dbus for example, for intercommunication, but currently SteamWorks works at a much lower level, also for security reasons, and anything you do that makes this work is a security hole for the user, so this cannot be supported unless Valve wants to support it.

I will close this for now. Thank you for the suggestion.