From cfe955f42b0fed574fd1f5bc4165f7491a775c25 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:38:10 -0700 Subject: [PATCH] fix: remove runtime variable directory each update (#214) * umu_runtime: remove variable dir each update * umu_runtime: add comment * tests: update e2e tests to account for variable dir * tests: prefer chaining the umu-run commands --- tests/test_update.sh | 4 +++- umu/umu_runtime.py | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test_update.sh b/tests/test_update.sh index a4b88744..d1f14d3f 100644 --- a/tests/test_update.sh +++ b/tests/test_update.sh @@ -7,4 +7,6 @@ tar xaf SteamLinuxRuntime_sniper.tar.xz mv SteamLinuxRuntime_sniper/* "$HOME/.local/share/umu" mv "$HOME/.local/share/umu/_v2-entry-point" "$HOME/.local/share/umu/umu" -UMU_LOG=debug GAMEID=umu-0 "$HOME/.local/bin/umu-run" wineboot -u +# Perform a preflight step, where we ensure everything is in order and create '$HOME/.local/share/umu/var' +# Afterwards, run a 2nd time to perform the runtime update and ensure '$HOME/.local/share/umu/var' is removed +UMU_LOG=debug GAMEID=umu-0 UMU_RUNTIME_UPDATE=0 "$HOME/.local/bin/umu-run" wineboot -u && UMU_LOG=debug GAMEID=umu-0 "$HOME/.local/bin/umu-run" wineboot -u diff --git a/umu/umu_runtime.py b/umu/umu_runtime.py index a2578470..96eddbb2 100644 --- a/umu/umu_runtime.py +++ b/umu/umu_runtime.py @@ -159,6 +159,7 @@ def _install_umu( # Move the files to the correct location source_dir: Path = Path(tmpcache, f"SteamLinuxRuntime_{codename}") + var: Path = UMU_LOCAL.joinpath("var") log.debug("Source: %s", source_dir) log.debug("Destination: %s", UMU_LOCAL) @@ -170,6 +171,14 @@ def _install_umu( ] ) + if var.is_dir(): + log.debug("Removing: %s", var) + # Remove the variable directory to avoid Steam Linux Runtime + # related errors when creating it. Supposedly, it only happens + # when going from umu-launcher 0.1-RC4 -> 1.1.1 + # See https://github.com/Open-Wine-Components/umu-launcher/issues/213#issue-2576708738 + thread_pool.submit(rmtree, str(var)) + for future in futures: future.result()