diff --git a/.github/workflows/dylint.yml b/.github/workflows/dylint.yml index a7ac4e4e..c3df7e2f 100644 --- a/.github/workflows/dylint.yml +++ b/.github/workflows/dylint.yml @@ -125,7 +125,7 @@ jobs: - name: Prepare prebuilt Dylint tools and driver timeout-minutes: 10 run: | - soldr dylint prepare 2>&1 | tee "$RUNNER_TEMP/dylint-prepare.log" + env -u RUSTUP_TOOLCHAIN soldr dylint prepare 2>&1 | tee "$RUNNER_TEMP/dylint-prepare.log" # Library UI tests invoke soldr cargo test separately, so preserve # the prebuilt dylint-link directory for their linker config. sed -n 's/^soldr: dylint prepare: tool bin dir //p' "$RUNNER_TEMP/dylint-prepare.log" >> "$GITHUB_PATH" @@ -192,7 +192,7 @@ jobs: # every platform-gated source path on each run. export RUSTFLAGS="${RUSTFLAGS:+${RUSTFLAGS} }--cfg fbuild_platform_boundary_observation_run_${GITHUB_RUN_ID}" rm -f "$FBUILD_PLATFORM_BOUNDARY_OBSERVED" - soldr dylint --all -- --workspace --all-targets + env -u RUSTUP_TOOLCHAIN soldr dylint --all -- --workspace --all-targets - name: Compare scanner with actual Dylint observations run: uv run --no-project python ci/enforce_platform_boundary.py --dylint-observed target/platform-boundary-dylint-observed.tsv --print-totals diff --git a/ci/run_dylint.py b/ci/run_dylint.py index a843a523..681f23e4 100644 --- a/ci/run_dylint.py +++ b/ci/run_dylint.py @@ -24,6 +24,9 @@ def main(argv: list[str] | None = None) -> int: if not os.environ.get("CARGO_HOME"): os.environ["CARGO_HOME"] = str(Path.home() / ".cargo") env = os.environ.copy() + # setup-soldr pins the workspace's stable toolchain in this variable. + # Dylint must resolve the separate nightly from its library manifests. + env.pop("RUSTUP_TOOLCHAIN", None) # The ordinary local check can reuse Cargo fingerprints. CI's native OS # legs force fresh traversal and compare the independent observation ledger. env.pop("FBUILD_PLATFORM_BOUNDARY_OBSERVED", None) diff --git a/ci/test_run_dylint.py b/ci/test_run_dylint.py index 984350de..408514f3 100644 --- a/ci/test_run_dylint.py +++ b/ci/test_run_dylint.py @@ -14,11 +14,12 @@ def test_prepares_prebuilt_tools_and_lints_workspace(self) -> None: commands: list[list[str]] = [] def run(args: list[str], **_kwargs): + self.assertNotIn("RUSTUP_TOOLCHAIN", _kwargs["env"]) commands.append(args) return subprocess.CompletedProcess(args, 0) with ( - patch.dict(os.environ, {"CARGO_HOME": "", "FBUILD_PLATFORM_BOUNDARY_OBSERVED": "stale"}), + patch.dict(os.environ, {"CARGO_HOME": "", "FBUILD_PLATFORM_BOUNDARY_OBSERVED": "stale", "RUSTUP_TOOLCHAIN": "1.95.0"}), patch.object(Path, "home", return_value=Path("/tmp/fbuild-test-home")), patch.object(run_dylint, "activate"), patch.object(run_dylint.subprocess, "run", side_effect=run),