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:
co-authored by
Claude Sonnet 5.5
parent
2f562efa36
commit
4655baefaf
@@ -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()
|
||||
|
||||
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user