From 47455171010f5a93a4ba549adba42f445b5d6dbe Mon Sep 17 00:00:00 2001 From: The412Banner Date: Wed, 28 Oct 2026 04:41:11 +0000 Subject: [PATCH] fix(steam): skip only Steam's own driver-query run in compatdata/0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review of #1708: matching the file name alone also caught getcompatpath for that path and a game that happens to use the name. The wrappers now skip only "run …/d3ddriverquery64.exe" (or the 32-bit name) with STEAM_COMPAT_DATA_PATH in compatdata/0, which is how the client calls it; every other verb and prefix goes on to Proton. (cherry picked from commit c5e8ad0f8069800a8dae7c2bbec5037ccc18740b) --- .../overlay/usr/local/bin/steam-compatibility | 11 ++++---- tools/tests/test_game_environment.py | 27 +++++++++++++------ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility index 4c0e7f7ec..47c83fbd9 100755 --- a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility +++ b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility @@ -276,12 +276,13 @@ bl_vacdiag() { } """ -# Steam's shader pre-caching runs its D3D driver query through every Proton tool at each start. Here it has never -# succeeded (exit 1 every time), and each run started Wine in compatdata/0, where the two Protons upgrade the prefix -# back and forth for many seconds while the game starts. Steam gets the same failure without starting Wine. +# Steam's shader pre-caching runs its D3D driver query through every Proton tool at each start, as +# "run /bin/d3ddriverquery64.exe" in compatdata/0. Here it has never succeeded (exit 1 every time), and each +# run started Wine in compatdata/0, where the two Protons upgrade the prefix back and forth for many seconds while the +# game starts. Steam gets the same failure without starting Wine; other verbs and prefixes are left alone. BL_DRIVER_QUERY_SKIP = """ -case "${1##*/}" in - d3ddriverquery64.exe | d3ddriverquery.exe) +case "$verb:${1##*/}:${STEAM_COMPAT_DATA_PATH%/}" in + run:d3ddriverquery64.exe:*/compatdata/0 | run:d3ddriverquery.exe:*/compatdata/0) echo "droiddeck-proton: Steam's D3D driver query is not run (it fails here and would start Wine in compatdata/0)" >&2 exit 1 ;; esac diff --git a/tools/tests/test_game_environment.py b/tools/tests/test_game_environment.py index 0dce932cc..d0d04e045 100644 --- a/tools/tests/test_game_environment.py +++ b/tools/tests/test_game_environment.py @@ -859,21 +859,32 @@ class GameEnvironmentTest(unittest.TestCase): def test_both_proton_wrappers_answer_steams_driver_query_without_wine(self): scripts = (COMPAT["launcher_sh"](), COMPAT["extra_wrapper_sh"]("proton")) query = "/root/.local/share/Steam/steamrtarm64/../bin/d3ddriverquery64.exe" + probe = "/root/.local/share/Steam/steamapps/compatdata/0" for script in scripts: subprocess.run(["bash", "-n"], input=script, text=True, check=True) - self.assertLess(script.index('case "${1##*/}" in'), script.index("bl_components ")) - for args in ([query, "-d3d12"], [query], [query.replace("64.exe", ".exe")]): + self.assertLess(script.index('case "$verb:${1##*/}:'), script.index("bl_components ")) + for args, prefix in (([query, "-d3d12"], probe), ([query], probe + "/"), + ([query.replace("64.exe", ".exe")], probe)): result = subprocess.run(["bash", "-s", "run"] + args, input=script, text=True, capture_output=True, - env={"PATH": os.defpath, "HOME": "/nonexistent"}, timeout=10) + env={"PATH": os.defpath, "HOME": "/nonexistent", "STEAM_COMPAT_DATA_PATH": prefix}, + timeout=10) self.assertEqual(result.returncode, 1, result.stderr) self.assertEqual(result.stdout, "") self.assertIn("D3D driver query is not run", result.stderr) skip = COMPAT["BL_DRIVER_QUERY_SKIP"] - for args in (["/games/AIO/AIO-Graphics-Test-64bit.exe", "--cube", "dx11"], - ["/games/Tool/tool.exe", query], ["/games/d3ddriverquery64.exe.bak"]): - out = subprocess.run(["bash", "-c", "verb=run\n" + skip + "echo continued", "_"] + args, - capture_output=True, text=True, check=True).stdout - self.assertEqual(out, "continued\n", args) + for verb, args, prefix in ( + ("getcompatpath", [query], probe), + ("run", [query], "/root/.local/share/Steam/steamapps/compatdata/2276548447"), + ("run", [query], None), + ("waitforexitandrun", ["/games/AIO/AIO-Graphics-Test-64bit.exe", "--cube", "dx11"], probe), + ("run", ["/games/Tool/tool.exe", query], probe), + ("run", ["/games/d3ddriverquery64.exe.bak"], probe)): + env = {"PATH": os.defpath} + if prefix is not None: + env["STEAM_COMPAT_DATA_PATH"] = prefix + out = subprocess.run(["bash", "-c", "verb=" + verb + "\n" + skip + "echo continued", "_"] + args, + env=env, capture_output=True, text=True, check=True).stdout + self.assertEqual(out, "continued\n", (verb, args, prefix)) def test_wrappers_preload_the_session_library_before_the_input_shim(self): overlay = "/root/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so"