Fix renamed paths (include_str of window_launches, a function imported from its planner module), drop the unused var_os of two settings modules

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-11-14 13:20:36 +01:00
co-authored by Claude Sonnet 5.5
parent 2f562efa36
commit 4655baefaf
9 changed files with 24 additions and 22 deletions
+14
View File
@@ -19,6 +19,7 @@ import shutil
import subprocess
import sys
import tempfile
import time
sys.path.insert(0, str(pathlib.Path(__file__).parent))
from rust_modtree import IDENT, OPAQUE, Crate, _attribute_end, _skip_balanced, cfg_exprs, statements, strip_code # noqa: E402
@@ -49,8 +50,21 @@ RUSTFMT = shutil.which("rustfmt") or "rustfmt"
WORK = pathlib.Path(tempfile.gettempdir()) / "explicit-imports"
def wait_for_gpu_idle(wt):
"""The laptop is also the GPU test machine: no build starts while its wanted flag or run lock exists."""
common = subprocess.run(
["git", "rev-parse", "--git-common-dir"], cwd=wt, capture_output=True, text=True, check=False
).stdout.strip()
git_dir = (pathlib.Path(wt) / common).resolve()
names = ("laptop-gpu-wanted.flag", "laptop-gpu-run.lock")
while any((git_dir / n).exists() for n in names):
print(" GPU stretch wanted or running: build paused", flush=True)
time.sleep(60)
def run_cargo(wt, args, out_name):
"""Messages of `cargo check --message-format=json ARGS` run in `wt`; the log is kept in WORK."""
wait_for_gpu_idle(wt)
WORK.mkdir(parents=True, exist_ok=True)
out = WORK / (pathlib.Path(wt).resolve().name + "-" + out_name)
check = ["check", "--message-format=json"] + args.split()
+1 -1
View File
@@ -12,7 +12,7 @@ import re
import sys
SETTINGS = '''//! The only place of this crate that reads the process environment (`env-read` ratchet of `architecture.json`).
//! The reads keep their call sites and their parsing; a later step replaces these two functions by a parsed settings value.
//! The reads keep their call sites and their parsing; a later step replaces these functions by a parsed settings value.
use std::env::{self, VarError};
use std::ffi::{OsStr, OsString};