Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edtlib: Revert a regression affecting property filters at the child-binding level and bellow #80030

Conversation

dottspina
Copy link
Contributor

@dottspina dottspina commented Oct 18, 2024

In #65221 we tried to get more valuable answers from the PropertySpec.path API, which is supposed to tell in which binding file a property's specification was last modified.

Working on related issues (#78095) later showed that the chosen approach is dead end: we need to first rethink how bindings (and especially child-bindings) are initialized.

In the meantime, we have to tackle other concerns we've accidentally stumbled upon (#79948):

[Edit: reverting #65221 will also address "B filters I filters X", I'll instead add the complementary unit tests to #79900 once this is merged.]

Hence the rationale for this PR:

  • fix the regression as soon as we can
  • clean things up before we look at the remaining issues

Thanks.

This unit test was added specifically to cover a regression
reported by the CI while working on [1].

Further work on related issues [2] showed that:
- [1] and [2] are dead end: we need to first rethink
  how bindings (and especially child-bindings) are initialized
- the inclusion mechanism supported by Zephyr deserves more systematic
  testing in edtlib if we want to work with confidence

The approach we choose is to:
- revert all changes made in [1]
- from there, systematically add unit tests as we address
  the issues we identified (or the additional features we need)
  one after the other

[1] edtlib: fix last modified semantic in included property specs
[2] edtlib: Preserve paths of properties from included child bindings

See also: zephyrproject-rtos#65221, zephyrproject-rtos#78095

This reverts commit 33bb3b6.

Signed-off-by: Christophe Dufaza <[email protected]>
This unit test was added to cover the change introduced by [1].

Further work on related issues [2] showed that the chosen approach
is dead end.
We're reverting all changes made in [1].

[1] edtlib: fix last modified semantic in included property specs
[2] edtlib: Preserve paths of properties from included child bindings

See also: zephyrproject-rtos#65221, zephyrproject-rtos#78095

This reverts commit 70eaa61.

Signed-off-by: Christophe Dufaza <[email protected]>
Use-case "B includes I includes X":
- X is a base binding file, specifying common properties
- I is an intermediary binding file, which includes X
  without modification nor filter
- B includes I, filtering the properties it chooses
  to inherit with an allowlist or a blocklist

Check that the properties inherited from X via I
are actually filtered as B intends to,
up to the grandchild-binding level.

Signed-off-by: Christophe Dufaza <[email protected]>
[1] was introduced to get more valuable answers from
the PropertySpec.path API, which is supposed to tell
in which file the property's specification was "last modfied".

Further work on related issues [2] showed that the
approach chosen in [1] is dead end: we need to first rethink
how bindings (and especially child-bindings) are initialized.

[1] edtlib: fix last modified semantic in included property specs
[2] edtlib: Preserve paths of properties from included child bindings

See also: zephyrproject-rtos#65221, zephyrproject-rtos#78095

This reverts commit b3b5ad8.

Signed-off-by: Christophe Dufaza <[email protected]>
@ghost ghost added Regression Something, which was working, does not anymore area: Devicetree Tooling PR modifies or adds a Device Tree tooling priority: low Low impact/importance bug labels Oct 18, 2024
@dottspina
Copy link
Contributor Author

@decsny , just to keep you updated:

  • although I didn't find Zephyr bindings (in dts/bindings) that the issues described in edtlib: indirect "include:"s break property filters #79948 could break, property filters are still definitely broken when "B filters I includes X"
  • this PR is harmless: it reverts an enhancement (sic) that only mattered to me (DTSh), and which introduced the regression that causes the errors above
  • with this PR applied, all unit tests currently disabled in edtlib: tests: refine coverage of Binding objects initialization #79900 pass
  • I'm not confident with triaging this as low-priority: IMHO the broken use cases seem entirely valid, and could appear in out-of-tree bindings (I would even support backporting the fix to Zephyr 3.7)

Thanks.

Fixes #79948.

@mmahadevan108 mmahadevan108 merged commit b0b2785 into zephyrproject-rtos:main Nov 6, 2024
45 checks passed
@dottspina dottspina deleted the pr-revert-propspecs-path-semantic branch November 6, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree Tooling PR modifies or adds a Device Tree tooling area: Devicetree priority: low Low impact/importance bug Regression Something, which was working, does not anymore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants