diff --git a/.github/workflows/ci-preflight.yml b/.github/workflows/ci-preflight.yml index b7bbf838..ff2ff5d9 100644 --- a/.github/workflows/ci-preflight.yml +++ b/.github/workflows/ci-preflight.yml @@ -47,7 +47,7 @@ on: type: boolean default: true dylint: - description: Run the repository Dylint gate. Enabled only for the native Linux x86 lane. + description: Run both workspace Dylints on the single Linux x86 lane. type: boolean default: false cache-targets: @@ -200,7 +200,7 @@ jobs: path: logs/kernel-substrate-timing.json if-no-files-found: warn - # Dylint is intentionally a single Linux-x86 step. Its nightly artifacts + # Dylint runs once on Linux x86. Its nightly artifacts # use a dedicated persistent cache so they cannot mix with the stable # workspace build or impose a cold rebuild on every platform lane. - name: Install Dylint nightly @@ -265,6 +265,7 @@ jobs: CARGO_BIN: cargo CARGO_TARGET_DIR: ${{ runner.temp }}/running-process-dylint-target run: | + rustup run nightly-2026-04-16 "$CARGO_BIN" dylint --all --workspace rustup run nightly-2026-04-16 "$CARGO_BIN" dylint --path lints --pattern running-process-platform-boundary --workspace # #1216: save only on main; PR runs restore main's entry. diff --git a/lints/running-process-platform-boundary/ui/main.rs b/lints/running-process-platform-boundary/ui/main.rs index 163c7daf..dd2e2672 100644 --- a/lints/running-process-platform-boundary/ui/main.rs +++ b/lints/running-process-platform-boundary/ui/main.rs @@ -1,4 +1,4 @@ fn main() { - #[cfg(any(windows, not(target_os = "linux")))] + #[cfg(all(windows, not(target_os = "linux")))] use std::os::windows::process::CommandExt as _; } diff --git a/lints/running-process-platform-boundary/ui/main.stderr b/lints/running-process-platform-boundary/ui/main.stderr index 60bd5016..070ac5b5 100644 --- a/lints/running-process-platform-boundary/ui/main.stderr +++ b/lints/running-process-platform-boundary/ui/main.stderr @@ -9,13 +9,13 @@ LL | use std::os::windows::process::CommandExt as _; error: host-platform cfg selection (windows) is not allowed here; host selection belongs in crates/running-process-platform-internal/src/lib.rs cfg_select! --> $DIR/main.rs:2:15 | -LL | #[cfg(any(windows, not(target_os = "linux")))] +LL | #[cfg(all(windows, not(target_os = "linux")))] | ^^^^^^^ error: host-platform cfg selection (target_os) is not allowed here; host selection belongs in crates/running-process-platform-internal/src/lib.rs cfg_select! --> $DIR/main.rs:2:28 | -LL | #[cfg(any(windows, not(target_os = "linux")))] +LL | #[cfg(all(windows, not(target_os = "linux")))] | ^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/tests/test_ci_lint.py b/tests/test_ci_lint.py index cafcecf7..5f5466e8 100644 --- a/tests/test_ci_lint.py +++ b/tests/test_ci_lint.py @@ -3,6 +3,20 @@ from ci import lint as ci_lint +def test_one_linux_preflight_gates_both_workspace_dylints() -> None: + workflows = ci_lint.ROOT / ".github" / "workflows" + reusable = (workflows / "ci-preflight.yml").read_text(encoding="utf-8") + assert "dylint --all --workspace" in reusable + assert "--pattern running-process-platform-boundary" in reusable + for name in ("ci-linux.yml", "ci-macos.yml", "ci-windows.yml"): + source = (workflows / name).read_text(encoding="utf-8") + for label in ("linux-x86", "linux-arm") if name == "ci-linux.yml" else ( + ("macos-x86", "macos-arm") if name == "ci-macos.yml" else ("windows-x86", "windows-arm") + ): + job = source.split(f"label: {label}", 1)[1].split("\n\n", 1)[0] + assert ("dylint: true" in job) == (label == "linux-x86"), (name, label) + + def test_main_runs_lint_commands_through_running_process_cli(monkeypatch) -> None: commands: list[list[str]] = [] monkeypatch.setattr(