Skip to content

Commit

Permalink
umu_run: validate compatibility tools used in session
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Sep 12, 2024
1 parent 6661ded commit 661f36b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions umu/umu_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
get_libc,
get_library_paths,
get_osrelease_id,
get_vdf_value,
is_installed_verb,
is_winetricks_verb,
)
Expand Down Expand Up @@ -803,6 +804,36 @@ def main() -> int: # noqa: D103
):
sys.exit(1)

# Determine if the set of compatibility tools match.
# Proton is a compatibility tool as it will contain toolmanifest.vdf,
# therefore conforming to Steam's compatability tool interface.
# See steam-compat-tool-interface.md
# The value of 'require_tool_appid' will be the id of the SLR
toolappid_proton: str = get_vdf_value(
Path(env["PROTONPATH"], "toolmanifest.vdf"), "require_tool_appid"
)

# SLR is a compatibility tool, but will not contain the metadata of
# interest in toolmanifest.vdf. If we want to know if the tools are
# related, instead of toolmanifest.vdf, read a file from the depot.
# The value of 'appid' is the id of the SLR.
toolappid_slr: str = ""
for file in UMU_LOCAL.joinpath("steampipe/").glob("*.vdf"):
if toolappid_slr := get_vdf_value(file, "appid"):
break

# Warn about mismatching compatibility tools, but don't crash
# e.g., Proton 7.0 should not be used with steamrt3 (sniper)
if toolappid_slr != toolappid_proton:
proton: Path = Path(env["PROTONPATH"])
log.warning("Compatibility tools mismatch")
log.warning(
"%s requires Runtime Platform with App ID '%s'",
proton.name,
toolappid_slr,
)
log.warning("See https://steamdb.info/app/%s/", toolappid_slr)

# Build the command
command: tuple[Path | str, ...] = build_command(env, UMU_LOCAL, opts)
log.debug("%s", command)
Expand Down

0 comments on commit 661f36b

Please sign in to comment.