Skip to content

ci: Run the Tier 2 stale-build reset from Python (#962) - #2601

Merged
zackees merged 2 commits into
masterfrom
infra/962-gen-005-stale-build-python
Oct 27, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/962-gen-005-stale-build-python

Conversation

@zackees

@zackees zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member

Ports rust/tools/linux-validate/stale-build.sh (23 lines) to Python, per the GEN-005 burn-down in #962. Clean single-unit port: its only caller is validate.sh, which runs with uv mounted into the Tier 2 container (ci.yml: --mount ...$(command -v uv),dst=/usr/local/bin/uv) and already runs other ported helpers through uv run --script.

The shell's reset_stale_build read the ambient SRC shell variable, which is not exported in validate.sh, so the port takes the source root as an argument instead: stale_build.py BUILD_DIR RUSTC_VERSION [SRC]. Without SRC the source-path check is skipped, matching the shell's ${SRC:-}.

RED (3385e413a)

ci/test_tier2_run.py's StaleBuildTest now drives the port instead of source ... stale-build.sh; its cases and expectations are unchanged. On the unfixed tree the module does not exist, so the four cases error: uv run --script .../stale_build.py ... returned non-zero exit status 2. (18 tests, 4 errors.)

GREEN (a33050a7a)

  • rust/tools/linux-validate/stale_build.py — the port. reset_stale_build removes BUILD_DIR when BUILD_DIR.rustc does not record RUSTC_VERSION, or when the CMakeCache.txt's CMAKE_HOME_DIRECTORY is not SRC (an old /src copy, now /ro); it then records the version.
  • rust/tools/linux-validate/validate.sh — the source line is gone; both call sites ($build and $dbg) run the module through uv run --script, passing "$SRC".
  • stale-build.sh deleted; its GEN-005 exception removed from ci.toml.

Verification

  • ci/test_tier2_run.py — 18 tests OK (was 4 errors on RED).
  • Differential check against the shell across all eight cases it handled — same build-dir removed/kept and same stamp written, including the SRC match/mismatch/absent branches: all match.
  • ci.test_ci_toml 19 OK, ci.test_uv_run 5 OK, ci.test_no_sys_path_edits 2 OK; uvx ruff check clean.
  • Not run: ./lint's test_local_gate_probe rust lane (the host's soldr is older than the repo pins); no container was started (the suite uses a temp dir, not Docker).

Tiers: this is CI tooling, so there is no Rust/C tier to add — the only behaviour touched is the Python helper, covered by the suite above. No docs/features.md line (no user-visible change).

Refs #962.

@zackees
zackees enabled auto-merge October 27, 2026 10:40
@zackees
zackees added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 27, 2026
Port rust/tools/linux-validate/stale-build.sh (23 lines) to
rust/tools/linux-validate/stale_build.py. Its only caller is validate.sh,
which runs with uv mounted into the Tier 2 container, so the module is called
through `uv run --script`; SRC (the source root) is passed as an argument
rather than read from the environment, which is not exported.

reset_stale_build removes BUILD_DIR when BUILD_DIR.rustc does not record the
rustc version, or when the CMakeCache's CMAKE_HOME_DIRECTORY is not SRC, then
records the version. Behaviour is unchanged across all eight cases the shell
handled. The GEN-005 exception for the shell script is removed.
@zackees
zackees force-pushed the infra/962-gen-005-stale-build-python branch from a33050a to 61bb23b Compare October 27, 2026 11:00
@zackees
zackees enabled auto-merge October 27, 2026 11:00
@zackees
zackees added this pull request to the merge queue Oct 27, 2026
Merged via the queue into master with commit 6a9fcf4 Oct 27, 2026
36 checks passed
@zackees
zackees deleted the infra/962-gen-005-stale-build-python branch October 27, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant