fix(ea): a failed touchup is retried and its output reaches the store log (#2505)

* fix(ea): a failed touchup is retried and its output reaches the store log

* fix(ea): bound the touchup output kept for the store log

The output goes to a temporary file and only its last 64 KiB are read back. The timeout test now checks the output is logged and the next launch retries.

* fix(ea): a touchup still runs when its output cannot be captured
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-24 18:15:30 -05:00
1 parent 8f4cefd3bd
commit 8f4744398d
2 files changed
+119 -1

No files matched your search

@@ -1479,14 +1479,32 @@ def ea_touchup(folder, sidecar, compat_data, proton, timeout=900):
except OSError:
pass
args = touchup_args(str(extra.get("touchupArgs") or ""), str(extra.get("locale") or "en_US"), windows_path(str(folder)).rstrip("\\"))
try:
sink = tempfile.TemporaryFile()
except OSError:
sink = None
try:
run = subprocess.run([proton, "run", str(exe)] + args, cwd=str(exe.parent), stdin=subprocess.DEVNULL,
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=timeout)
stdout=sink or subprocess.DEVNULL, stderr=subprocess.STDOUT, timeout=timeout)
result = "ok" if run.returncode == 0 else "exit-%d" % run.returncode
except subprocess.TimeoutExpired:
result = "timeout"
except OSError:
return "failed"
finally:
output = b""
if sink is not None:
try:
sink.seek(0, os.SEEK_END)
sink.seek(max(0, sink.tell() - 65536))
output = sink.read()
except OSError:
pass
sink.close()
for line in output.decode("utf-8", "replace").splitlines()[-200:]:
log("touchup: " + line)
if result != "ok":
return result
try:
marker.write_text(stamp)
except OSError: