Skip to content

dt-checks: normalize empty fragments in chosen schema IDs - #3586

Draft
johnturek wants to merge 1 commit into
aurora-silicon:mainfrom
johnturek:fix/chosen-schema-empty-fragment
Draft

johnturek wants to merge 1 commit into
aurora-silicon:mainfrom
johnturek:fix/chosen-schema-empty-fragment

Conversation

@johnturek

Copy link
Copy Markdown

What: Accept chosen.yaml schema IDs with or without the optional empty # fragment. This fixes the documented-property filter mismatch reported by @kazuhidet in #2745, without suppressing genuine warnings.

Tested: J715 / Mac16,13 on macOS 27.3 at 2b6ec9e: five host-side tests pass, including the reported four-property J715 diagnostic against real in-tree bindings. CI-only change; no runtime change.

Risk: Two-way door · no runtime changes on any Mac; affects Apple DT warning filtering in CI only.

Not yet: Full Linux CHECK_DTBS rebuild across all Apple DTBs; CI workflow execution. No hardware-boot result is claimed.

Details

dtschema can print http://devicetree.org/schemas/chosen.yaml without the trailing #. The exact comparison currently passes that warning through unchanged, so documented in-tree properties are not subtracted.

Normalize only the empty trailing fragment. Keep warnings from other schemas, nonempty fragments, undocumented properties, other nodes, and type/value errors unchanged. Run the new focused tests in the existing device-tree checks workflow.

The diagnosis and proposed normalization were reported in the November 26 comment on #2745.

Evidence

Base: d2532e903450f6368f69ecbd723d967f8e1de591.
Candidate: 2b6ec9e.
Host: Mac16,13 / J715, macOS 27.3 (26C5047e), Python 3.14.

  • Unmodified production filter: four failing subcases in the initial regression fixtures.
  • Patched production filter: five test methods pass.
  • Covered: inline and continuation-line schema IDs with and without #; the actual J715 diagnostic and real bindings; unknown properties; different schemas; nonempty fragments; missing schema IDs; aliases; type errors.
  • bash -n scripts/dtc/apple-dt-check.sh: pass.
  • python -m py_compile scripts/dtc/apple-dt-check-test.py: pass.
  • Workflow YAML parsing and test-step wiring: pass.
  • git diff --check: pass.
  • checkpatch: zero errors and zero warnings with FILE_PATH_CHANGES excluded after confirming that MAINTAINERS already covers scripts/dtc/.

The macOS fixtures validate warning filtering, not hardware support or the complete CI workflow.

dtschema can print chosen.yaml without the optional trailing #. Normalize that empty fragment before comparing IDs so documented in-tree chosen properties are subtracted, while unknown properties and other schemas remain reported.

Exercise both diagnostic layouts, the reported J715 warning against real bindings, and rejection boundaries in the existing dt-checks workflow.

Signed-off-by: JT Turek <jt@dweeb.net>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks @johnturek, this is the right fix. dtschema 2026.9 prints the chosen.yaml $id without the trailing #, so on main the filter never matches, and the dt-checks job fails falsely on DT PRs (for example #2745). Your test fails against main's filter and passes with yours. When you are ready, please mark it ready for review and we will review and merge it quickly.

@RyanTheTide

Copy link
Copy Markdown
Contributor

@johnturek is this ready? It's the only thing keeping #2745 (approved since 11-25) from landing. One request: the .github/workflows/dt-checks.yml step needs Ryan's code-owner approval, and that can take a while. Could you drop that hunk from this PR, leaving just the apple-dt-check.sh fix and apple-dt-check-test.py, mark it ready, and send the workflow step as a small follow-up? I'll review and merge the scripts part the same day. If it's still a draft at 12-01 12:00 AEDT, I'll open a carrier with your commit (authorship and sign-off kept, minus the workflow hunk) so #2745 can move, and close this one with a link.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants