fix(bionic): address review findings

Launcher (tools/bionic-runtime/tool/launch.sh)
- The FEX code cache is also cleared when another FEX build wrote to it since this tool last ran the prefix:
  the stamp now holds the FEX ID and a fingerprint of the caches, saved after each run (also after
  runinprefix and when Steam stops the game).
- A game started by a launcher that then exits keeps the tool waiting: the wait goes on while any program
  of the prefix runs, apart from Wine's own services. The game is looked up in this prefix only, by its
  name as fixed text.
- The tool exits with Wine's status instead of 0.

Install scripts (droiddeck-game-env)
- A "run process" entry counts as done only when its hasrunkey value is a DWORD of at least its
  MinimumHasRunValue (1 by default), as Steam's evaluator decides; a 0 or a value of another type no longer
  lets the evaluator be skipped.

Helpers
- execshim: non-regular files (a FIFO) go to libc without a blocking open; libc functions are bound at load
  through atomic slots; relative posix_spawn paths with file actions are left to libc; the argument vector
  has room for its terminator when argv is empty.
- gstag: replies and errors are matched to their request's sequence number per connection; one bounded
  packet reader; destroyed windows leave the candidate and tagged lists; the focus override needs a live
  tagged window and a successful focus read; only gone candidates are pruned.
- steamshm: a new shared object is created and sized under a private name and then put in place in one
  step; both code redirects go in or neither, and unused trampolines are released.
- check-needed.py fails when readelf fails and ignores dangling links.
- The bionic runtime workflow also runs for tools/gpuload changes.

App and tool wrapper
- FEX twin downloads run once per name; a twin that a game's FEX choice still needs on an installed tool
  cannot be deleted.
- With proot on and no DroidDeck-Proton installed, a launch sent to DroidDeck-Bionic stops with a message
  instead of starting the bionic tool.
This commit is contained in:
The412Banner committed 2026-11-22 17:56:19 -05:00
1 parent dca443e3aa
commit 2aae4b2284
11 files changed
+435 -122

No files matched your search

@@ -819,6 +819,8 @@ def read_vdf(text):
def run_keys(items, appid=""):
# (hasrunkey, value name, MinimumHasRunValue) of each "run process" entry; Steam runs the process unless the
# value is a DWORD of at least that minimum (1 when the script does not say)
appid = next((value for name, value in items if name.lower() == "appid" and isinstance(value, str)), appid)
found = set()
for name, value in items:
@@ -827,30 +829,44 @@ def run_keys(items, appid=""):
if any(isinstance(v, str) and re.fullmatch(r"process [0-9]+", n.lower()) for n, v in value):
key = next((v for n, v in value if n.lower() == "hasrunkey" and isinstance(v, str)),
"HKEY_LOCAL_MACHINE\\Software\\Valve\\Steam\\Apps\\" + appid)
found.add((key.lower(), name.lower()))
minimum = next((v for n, v in value if n.lower() == "minimumhasrunvalue" and isinstance(v, str)), "1")
try:
minimum = int(minimum.strip(), 0)
except ValueError:
minimum = int(minimum.strip()) if minimum.strip().isdigit() else 1
found.add((key.lower(), name.lower(), minimum))
found |= run_keys(value, appid)
return found
def registry_values(path):
found, section = set(), None
# {(key, value name): DWORD, or None for a value of another type}
found, section = {}, None
with open(path, encoding="utf-8", errors="replace") as reg:
for line in reg:
if line.startswith("["):
section = line[1:line.find("]")].replace("\\\\", "\\").lower() if "]" in line else None
elif section and line.startswith('"') and '"=' in line:
found.add((section, line[1:line.index('"=')].replace("\\\\", "\\").lower()))
name = line[1:line.index('"=')].replace("\\\\", "\\").lower()
data = line[line.index('"=') + 2:].strip()
dword = None
if data.lower().startswith("dword:"):
try:
dword = int(data[6:], 16)
except ValueError:
pass
found[(section, name)] = dword
return found
def has_run(key, value, values):
def has_run(key, value, values, minimum=1):
path = key[len("hkey_local_machine\\"):] if key.startswith("hkey_local_machine\\") else None
if path is None:
return False
views = [path]
if path.startswith("software\\"):
views.append("software\\wow6432node\\" + path[len("software\\"):])
return any((view, value) in values for view in views)
return any(isinstance(values.get((view, value)), int) and values[(view, value)] >= minimum for view in views)
def scripts_digest(scripts):
@@ -896,7 +912,7 @@ def install_scripts_done(scripts, env):
values = registry_values(prefix / "system.reg")
except (OSError, ValueError):
return False
if not keys or not all(has_run(key, value, values) for key, value in keys):
if not keys or not all(has_run(key, value, values, minimum) for key, value, minimum in keys):
return False
try:
if (prefix / INSTALL_STAMP).read_text().strip() == scripts_digest(scripts):
@@ -305,6 +305,8 @@ if [ -f "$here/bionic/launch.sh" ] && [ -z "${DDNATV_ROOT:-}" ]; then
echo "droiddeck-proton: DroidDeck-Bionic needs Run without proot; this launch uses ${dd_fallback##*/}" >&2
exec "$dd_fallback/droiddeck-proton-wrap" "$verb" "$@"
fi
echo "droiddeck-proton: DroidDeck-Bionic needs Run without proot, and no DroidDeck-Proton is installed to run this launch instead; turn on Run without proot or install DroidDeck-Proton" >&2
exit 1
fi
"""