From db098ba812ff9cf47e7c8ba5c1a2d58485b6d510 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Fri, 13 Nov 2026 12:34:31 +0800 Subject: [PATCH] fix(ci): support Cargo 1.100 artifact layout in cleanup fixture (#5010) Cargo 1.100 moves intermediate compiler artifacts into per-unit build directories and emits `build_script_build` instead of `build-script-build`. The unlocked-build fixture currently fails on its old rlib path before the SDK build starts, even though the library survives cleanup. Discover compiler inputs recursively and accept both build-script names while preserving the library, generated-input, ordinary-executable, discarded-test, linker-failure and outside-target assertions. The standalone fixture reproduces the failure before this change and passes afterward on Rust/Cargo 1.100.0; it also passes on 1.97.0. Fault injection confirms missing libraries and other retained inputs still fail their assertions. Production cleanup and normal workflow coverage are unchanged. --- ci/tests/test_build_no_lock.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ci/tests/test_build_no_lock.py b/ci/tests/test_build_no_lock.py index 634e8d333..f760d2bfc 100644 --- a/ci/tests/test_build_no_lock.py +++ b/ci/tests/test_build_no_lock.py @@ -88,9 +88,11 @@ class BuildNoLockTest(unittest.TestCase): self.assertTrue((target / "fixture_cli").is_file()) # Cargo guarantees this binary for test execution, not compile-time reads. subprocess.run([str(target / "fixture_cli")], check=True) - self.assertTrue(list((target / "deps").glob("libartifact_fixture*.rlib"))) - self.assertTrue(list((target / "build").glob("*/build-script-build"))) - self.assertTrue(list((target / "build").glob("*/out/generated.rs"))) + # Cargo 1.100 nests compiler inputs in per-unit build directories and + # names the build-script executable build_script_build. + self.assertTrue(list(target.rglob("libartifact_fixture*.rlib"))) + self.assertTrue(list((target / "build").rglob("build[-_]script[-_]build"))) + self.assertTrue(list((target / "build").rglob("out/generated.rs"))) def test_link_failure_preserves_cargo_status_and_diagnostic(self): with tempfile.TemporaryDirectory(prefix=".no-lock-", dir=SCRIPT.parent) as temp: