From d31db6b6a6ac6df528f0abc063c06b23427eb46d Mon Sep 17 00:00:00 2001 From: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Date: Sun, 8 Nov 2026 22:11:32 +1100 Subject: [PATCH] scripts/dtc: let the ADT coverage ratchet introduce a new board A board added together with its inventory had no base DTB, so the bootstrap measured the head inventory against a file that did not exist. The coverage step then failed with ENOENT. The aurora-wip sync #1210 hit this for t6050-j716s and t6050-j873s, because aurora-wip had no T6050 trees yet. Nothing at the base can regress for such a board, so only check that its own inventory resolves in the head DTB. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM --- scripts/dtc/apple-adt-coverage-test.py | 13 +++++++++++++ scripts/dtc/apple-adt-coverage.py | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/scripts/dtc/apple-adt-coverage-test.py b/scripts/dtc/apple-adt-coverage-test.py index f1728f7b9cef4..99c6feda2b1c2 100644 --- a/scripts/dtc/apple-adt-coverage-test.py +++ b/scripts/dtc/apple-adt-coverage-test.py @@ -160,6 +160,19 @@ def test_bootstrap_rejects_paths_absent_from_both_dtbs(self): self.assertEqual(result.returncode, 1) self.assertIn("new absent DT path", result.stderr) + def test_bootstrap_of_a_new_board_needs_no_base_dtb(self): + directory = self.root / "baseline" + directory.mkdir() + absent = self.root / "base-dtbs" + absent.mkdir() + args = ("--baseline-manifest-dir", str(directory), "--baseline-dtb-dir", str(absent)) + result = self.run_check("/x - -> MISSING\n/y - -> /soc\n", *args) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn("new board, no base DTB", result.stdout) + result = self.run_check("/x - -> /never-existed\n", *args) + self.assertEqual(result.returncode, 1) + self.assertIn("new absent DT path", result.stderr) + def test_ratchet_validates_baseline_and_options(self): args = self.baseline("invalid\n") self.assertEqual(self.run_check("/x - -> /soc\n", *args).returncode, 1) diff --git a/scripts/dtc/apple-adt-coverage.py b/scripts/dtc/apple-adt-coverage.py index 81e9f7b67bd42..10bb38b57cda7 100644 --- a/scripts/dtc/apple-adt-coverage.py +++ b/scripts/dtc/apple-adt-coverage.py @@ -126,6 +126,13 @@ def main(argv=None): # DTBs. Later runs always use the base's committed inventory. baseline = manifest print(f"{board}: bootstrapping baseline from head inventory") + if not (args.baseline_dtb_dir / (board + ".dtb")).is_file(): + # The board itself is new: nothing at the base can regress, + # but its own inventory must still resolve in the head DTB. + print(f"{board}: new board, no base DTB") + for target in sorted(broken): + errors.append(f"{board}: new absent DT path: {target}") + continue old, before, old_broken = inventory( baseline, args.baseline_dtb_dir / (board + ".dtb"), board) removed = {e[1] for e in old} - {e[1] for e in entries}