Logbook stats rebuild: put the Visual Studio Installer folder (vswhere) on PATH, which a server started without a shell lacks

This commit is contained in:
KeelrLeek committed 2026-10-06 16:21:58 -05:00
1 parent a67462f8ca
commit a92efdad45
1 file changed
+4
+4
View File
@@ -84,6 +84,10 @@ def rebuild_stats(project, repo, stats_repo, head):
tools = Path(stats_repo) / "tools" / "progress" tools = Path(stats_repo) / "tools" / "progress"
# its own data dir: the agents' compiles hold the shared decomp-build\pirates.h open # its own data dir: the agents' compiles hold the shared decomp-build\pirates.h open
env = dict(os.environ, OPENSEAS_DATA=os.environ.get("HARBOR_LOGBOOK_DATA", r"R:\Workspace\Data\openseas-logbook")) env = dict(os.environ, OPENSEAS_DATA=os.environ.get("HARBOR_LOGBOOK_DATA", r"R:\Workspace\Data\openseas-logbook"))
# the readable build finds the compiler through vswhere, which a server started without a shell's PATH lacks
installer = r"C:\Program Files (x86)\Microsoft Visual Studio\Installer"
if os.path.isdir(installer) and installer.lower() not in env.get("PATH", "").lower():
env["PATH"] = installer + os.pathsep + env.get("PATH", "")
run = lambda *argv: subprocess.run([sys.executable, "-B", *map(str, argv)], cwd=str(stats_repo), env=env, run = lambda *argv: subprocess.run([sys.executable, "-B", *map(str, argv)], cwd=str(stats_repo), env=env,
capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=900) capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=900)
sync = run(tools / "sync_decomp.py", "--decomp", repo) sync = run(tools / "sync_decomp.py", "--decomp", repo)