Repository navigation
scripts/dtc: apple-dt-check: validate only the DTBs a change alters - #3826
Conversation
Device tree checks ran CHECK_DTBS (dt-validate) on all 141 Apple DTBs at both the base and the head of every change. Schema validation is most of the job's time, and a runner spends up to ~40 minutes on it even for a one-board change. Compile every Apple DTB at both revisions first, without schema checks, and validate only the DTBs whose compiled bytes differ, widened to their firmware-profile variant family (a variant's warnings are reported under its base board's name). An identical DTB against identical bindings gives identical schema warnings. dtc's own warnings still come from the compile-only pass for every DTB, so a source line or DTC_FLAGS change that leaves the bytes alone is still seen. A change to the bindings, scripts/ or any Makefile/Kbuild file, a DTB build failure, or a DTB missing from the build validates every Apple DTB as before. Also: - make -k in both passes: one DTB that fails to build no longer stops the others being built and validated, which made their warnings look new (or removed) on the other side; - a failed checkout or defconfig has its own status, distinct from make's exit codes (a base-only DTB build failure was taken for a failed checkout); - the HEAD warnings of a board that did not build at BASE are listed but not counted as new, so a change repairing a broken board is not failed for that board's existing warnings; - the work directory is made absolute, since kbuild resolves a relative O= against the -C tree. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide
left a comment
There was a problem hiding this comment.
The new unbuilt-at-BASE filter can also erase a new warning for a board that builds on both sides. I ran the exact filter with board.dtb built at BASE, only board-fw.dtb unbuilt, and a new normalized schema warning on board.dtb. The sibling maps to board.dtb, so the filter moves that warning out of new.warn. Preserve the original board identity through this filter, or suppress only if no family member built at BASE.
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
scripts/dtc/apple-dt-check.sh:274–280 can hide a new schema warning on a DTB that built successfully at BASE. The skip list maps each missing DTB to its family, then removes every new warning with that family's prefix. I reproduced it with board.dtb building on both revisions, board-fw27.dtb failing only at BASE, and a new HEAD-only warning emitted by board.dtb. The old script exits 1. This head moves that warning to uncompared.warn and exits 0. Keep the original DTB identity until this exclusion is applied, or fail conservatively when only part of a family built at BASE. The separate setup status addresses the earlier exit-code collision.
…BASE Warnings are reported under the family (base board) name, so the exclusion for DTBs that did not build at BASE removed every new warning of the family. A new warning from a member that did build at BASE (for example board.dtb, when only board-fw27.dtb failed at BASE) went to uncompared.warn and the check passed. Leave a family out of the comparison only when none of its DTBs built at BASE. A family that only partly built at BASE is compared as usual. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
@DjDeveloperr re your review at 0ae16a6 ( I didn't keep the per-DTB identity: extraction folds a variant's warnings into its base board's name before the comparison, so failing conservatively is the smaller change. Checked by running the script's exclusion block, unchanged, on synthetic BASE/HEAD inputs:
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Re-tested the warning comparison at this commit. A new warning now fails the check when either the base board or its firmware variant built at BASE. A wholly unbuilt family is excluded, and new warnings from other boards still fail the check. The previous false pass is fixed. No runtime change.
What:
scripts/dtc/apple-dt-check.sh(the Device tree checks job) ranCHECK_DTBSon all 141 Apple DTBs at both base and head for every DT change. On the box runners that's up to ~40 minutes per job, mostlydt-validate. It now compiles every Apple DTB at both revisions without schema checks first, then validates only the DTBs whose compiled bytes differ, widened to their firmware-profile variant family (a variant's warnings are reported under its base board's name). An identical DTB against identical bindings gives identical warnings, so the new/removed lists don't change. dtc's own warnings (from the first, compile-only pass) are still compared for every DTB, as before. The script falls back to validating every DTB, as before, when any of these happen:scripts/, or any Makefile/Kbuild file changes (a Makefile can changeDTC_FLAGSwithout changing DTB bytes);Also:
make -kin both passes, so one DTB that fails to build no longer stops the others; a failed checkout/defconfig has its own status (it was 2, which is also make's error code); HEAD warnings of a board that did not build at BASE are listed but not counted as new, so a change that repairs a broken board is not failed for that board's existing warnings. The work directory is made absolute, because kbuild resolves a relativeO=against the-Ctree.Replaces #3804 (one signed commit; covers DjDeveloperr's and CX-REVIEW's findings there).
Tested: buildbox, dtschema 2026.9, old script (main
cafee219) vs this one on the same base/head:t6030-j514s.dtsonly): 1 of 141 DTBs checked. 0 new / 0 removed, same as old. base and head warning lines for that board are identical to the old run's (59). 108 s vs 191 s.t8112.dtsi): 8 of 141 DTBs checked (the T8112 boards). 0/0, same as old. Warning lines identical for the 8 boards. 158 s vs 252 s.t8122-j613-25g83.dtschecks 2 DTBs (the variant and its base board) and reports the same 2 new warnings undert8122-j613.dtbas the old script (new.warnidentical). Exit 1 in both.-Wunit_address_vs_regadded toDTC_FLAGS_t6031-j514c(byte-identical DTBs) gives 4 new warnings, exit 1, through the Makefile fallback. With that fallback disabled, the build-log path alone finds the same 4 in 32 s.t8112-j413.dts(DTB build fails), clean head: exit 0, the board and its-fw27variant listed as not compared (62 lines). The old script exits 1 here on the buildbox: without-kthe base pass stops early and 341 warnings look new. The reverse (head broken) still exits 1 ("HEAD device trees do not build").The buildbox has 32 threads. Runner VMs have far fewer, so validation is a bigger share of the job there and the saving is larger.
Risk: two-way. Only
scripts/dtc/apple-dt-check.shchanges. A wrong selection could miss a new warning; the fallbacks above cover the inputs that can change warnings without changing DTB bytes (bindings, dtschema and dtc scripts). This PR changesscripts/, so its own run validates every DTB. Revert:git revert -m 1 <merge-sha>.Not yet: the dtschema version is pinned by pip at run time and is the same for base and head in one job, so it doesn't affect the comparison.