mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-02-04 17:50:42 +03:00
proton: Allow forwarding commands into the Proton environment
Recent versions of the Steam Runtime include an IPC server/client pair which can be used to run commands inside the container environment (or any other special execution environment), analogous to sshd/ssh or flatpak-portal/flatpak-spawn. The server runs inside the Steam Runtime container and accepts commands over D-Bus; the client runs on the host system, asks the server to run a command, and forwards its stdin, stdout and stderr back to the host. https://gitlab.steamos.cloud/steamrt/steamlinuxruntime/-/merge_requests/72 adds support for injecting commands into the SteamLinuxRuntime_soldier compatibility tool (and any later version, such as sniper). However, Steam compatibility tools are stackable: in particular, Proton runs in a soldier container (or presumably sniper in future). If we are debugging a Proton game, then ideally we will want to inject commands into Proton's execution environment rather than soldier's, so that they run with the correct environment variables etc. to communicate with a running Proton session. In particular, it's important that the `WINEPREFIX` is correct. The steam-runtime-launcher-interface-0 program implements the interface for compatibility tools to use to decide where, if anywhere, to launch the command server. This commit does not alter the scripts produced by PROTON_DUMP_DEBUG_COMMANDS. To run those scripts' commands in the container environment, pass their filenames to steam-runtime-launch-client. Signed-off-by: Simon McVittie <smcv@collabora.com> Link: https://github.com/ValveSoftware/Proton/pull/5891
This commit is contained in:
parent
4cc575b2f4
commit
79c9b6a15d
11
proton
11
proton
@ -1398,6 +1398,11 @@ class Session:
|
|||||||
return subprocess.call(args, env=local_env, stderr=self.log_file, stdout=self.log_file)
|
return subprocess.call(args, env=local_env, stderr=self.log_file, stdout=self.log_file)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
if shutil.which('steam-runtime-launcher-interface-0') is not None:
|
||||||
|
adverb = ['steam-runtime-launcher-interface-0', 'proton']
|
||||||
|
else:
|
||||||
|
adverb = []
|
||||||
|
|
||||||
if "PROTON_DUMP_DEBUG_COMMANDS" in self.env and nonzero(self.env["PROTON_DUMP_DEBUG_COMMANDS"]):
|
if "PROTON_DUMP_DEBUG_COMMANDS" in self.env and nonzero(self.env["PROTON_DUMP_DEBUG_COMMANDS"]):
|
||||||
try:
|
try:
|
||||||
self.dump_dbg_scripts()
|
self.dump_dbg_scripts()
|
||||||
@ -1415,9 +1420,11 @@ class Session:
|
|||||||
|
|
||||||
# CoD: Black Ops 3 workaround
|
# CoD: Black Ops 3 workaround
|
||||||
if os.environ.get("SteamGameId", 0) == "311210":
|
if os.environ.get("SteamGameId", 0) == "311210":
|
||||||
rc = self.run_proc([g_proton.wine_bin, "c:\\Program Files (x86)\\Steam\\steam.exe"] + sys.argv[2:] + self.cmdlineappend)
|
argv = [g_proton.wine_bin, "c:\\Program Files (x86)\\Steam\\steam.exe"]
|
||||||
else:
|
else:
|
||||||
rc = self.run_proc([g_proton.wine64_bin, "c:\\windows\\system32\\steam.exe"] + sys.argv[2:] + self.cmdlineappend)
|
argv = [g_proton.wine64_bin, "c:\\windows\\system32\\steam.exe"]
|
||||||
|
|
||||||
|
rc = self.run_proc(adverb + argv + sys.argv[2:] + self.cmdlineappend)
|
||||||
|
|
||||||
if remote_debug_proc:
|
if remote_debug_proc:
|
||||||
remote_debug_proc.kill()
|
remote_debug_proc.kill()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user