diff options
author | Simon McVittie <smcv@collabora.com> | 2022-06-08 20:17:05 +0300 |
---|---|---|
committer | Arkadiusz Hiler <ahiler@codeweavers.com> | 2022-08-10 19:29:30 +0300 |
commit | 79c9b6a15d1042b0a2252a0998267036780d706a (patch) | |
tree | 41ef891ef228a2a64e7afdeb4340d90c89a5c8a6 | |
parent | 4cc575b2f4c0325419d5adc8680526c1105421d6 (diff) |
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
-rwxr-xr-x | proton | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1398,6 +1398,11 @@ class Session: return subprocess.call(args, env=local_env, stderr=self.log_file, stdout=self.log_file) 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"]): try: self.dump_dbg_scripts() @@ -1415,9 +1420,11 @@ class Session: # CoD: Black Ops 3 workaround 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: - 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: remote_debug_proc.kill() |