From 7c42cc63ce78a1b181033286dac63df31e1c0605 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Fri, 23 Oct 2026 16:30:27 +0200 Subject: [PATCH] parity: leave out of the prebuild probes that no longer exist A record naming an example since renamed or deleted made the whole Cargo run fail ("no example target named ..."), so no probe was prebuilt and every harness built its own: the probe binaries rename ~250 of them. Co-Authored-By: Claude Opus 5.5 --- tests/test_parity_runner.py | 5 ++++- tools/parity.py | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/test_parity_runner.py b/tests/test_parity_runner.py index beffb557d..a9b7ff595 100644 --- a/tests/test_parity_runner.py +++ b/tests/test_parity_runner.py @@ -35,10 +35,13 @@ class ParityRunnerTests(unittest.TestCase): *parity.artifacts_of(["cargo", "build", "--release", "-p", "horizon-world", "--bin", "horizon-world"]), *parity.artifacts_of(["cargo", "build", "--release", "--bin", "horizon-world"]), *parity.artifacts_of(["cargo", "run", "--profile", "fast", "-p", "horizon-client", "--example", "c"]), + *parity.artifacts_of(["cargo", "build", "--release", "-p", "horizon-world", "--example", "renamed"]), ["example", "old", "release"], # recorded before selections were kept: its own crate's -p ["example", "unknown", "release"], # no longer in the workspace: left to its harness ] - self.assertEqual(parity.prebuild_commands(artifacts, {("example", "old"): "horizon-world"}), [ + packages = {("example", "a"): "horizon-world", ("example", "b"): "horizon-world", ("example", "c"): "horizon-client", + ("bin", "horizon-world"): "horizon-world", ("example", "old"): "horizon-world"} + self.assertEqual(parity.prebuild_commands(artifacts, packages), [ ["cargo", "build", "--locked", "--profile", "fast", "-p", "horizon-client", "--example", "c"], ["cargo", "build", "--locked", "--profile", "release", "--bin", "horizon-world"], ["cargo", "build", "--locked", "--profile", "release", "-p", "horizon-world", "--bin", "horizon-world"], diff --git a/tools/parity.py b/tools/parity.py index 5dbf13554..4113cc791 100644 --- a/tools/parity.py +++ b/tools/parity.py @@ -555,10 +555,14 @@ def prebuild_commands(artifacts, packages=None): """The Cargo runs that build the recorded probes exactly as their harnesses do: one per profile, package and feature selection, and whether examples are among the command's targets (see artifacts_of). - A [kind, name, profile] record from before selections were kept is taken as built with `-p` and its own crate, - as nearly every harness does (packages: target_packages()); the harness's next run records the real one.""" + packages: target_packages(). Records of targets that no longer exist (a probe renamed or deleted since a harness + ran it) are left out, since one unknown target fails its whole Cargo run. A [kind, name, profile] record from + before selections were kept is taken as built with `-p` and its own crate, as nearly every harness does; the + harness's next run records the real one.""" groups = {} for artifact in artifacts: + if packages and artifact[1] and tuple(artifact[:2]) not in packages: + continue if len(artifact) == 3 and (packages or {}).get(tuple(artifact[:2])): kind, name, profile = artifact artifact = [kind, name, profile, ["-p", packages[(kind, name)]], kind == "example"] @@ -578,7 +582,7 @@ def prebuild(artifacts, jobs): environment = run_environment() environment["CARGO_BUILD_JOBS"] = str(jobs) errors = "" - packages = target_packages() if any(len(artifact) == 3 for artifact in artifacts) else None + packages = target_packages() for command in prebuild_commands(artifacts, packages): result = subprocess.run(command, cwd=ROOT, env=environment, capture_output=True, text=True) if result.returncode: