From 59d2f157ebf9ba12214b0e4f81e845dfcf8eff4f Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Tue, 22 Sep 2026 23:14:08 +0000 Subject: [PATCH] Probe scoop dotnet-sdk path explicitly (runner service has stale env) --- scripts/guibuild.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/guibuild.py b/scripts/guibuild.py index 198fce5..313c3ad 100755 --- a/scripts/guibuild.py +++ b/scripts/guibuild.py @@ -216,11 +216,22 @@ def fetch_vpk() -> Path: def _dotnet() -> str: - """Resolve the dotnet host, preferring DOTNET_ROOT (a plain `dotnet` may - resolve to a runtime-only installation without the SDK/runtime we need).""" + """Resolve the dotnet host with an SDK/modern runtime. + + A plain `dotnet` may resolve to a runtime-only installation (e.g. + C:\\Program Files\\dotnet), and long-running services (CI runners) may + carry a stale environment without DOTNET_ROOT or scoop paths — so probe + known locations explicitly. + """ + candidates = [] root = os.environ.get("DOTNET_ROOT") if root: - exe = Path(root) / ("dotnet.exe" if sys.platform == "win32" else "dotnet") + candidates.append(Path(root)) + if sys.platform == "win32": + candidates.append(Path(r"C:\ProgramData\scoop\apps\dotnet-sdk\current")) + exe_name = "dotnet.exe" if sys.platform == "win32" else "dotnet" + for base in candidates: + exe = base / exe_name if exe.exists(): return str(exe) return "dotnet"