Skip to content

[DNM] rust: add comment support to DTS parser #89420

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

pillo79
Copy link
Collaborator

@pillo79 pillo79 commented May 2, 2025

This PR tests the change in zephyrproject-rtos/zephyr-lang-rust#96 that filters comments in DTS files with the new DTS comments implemented in #89410 (the first 5 commits).

pillo79 and others added 6 commits May 1, 2025 16:55
The phandle property is auto-generated when parsing the DTS, so there is
no 'source information'. This commit sets the filename and line number
of the phandle property to be the same as the first reference to the
target node.

Signed-off-by: Luca Burelli <[email protected]>
List each element of a property array in a different line to improve
readability of the generated output.
Update the exepected output of the tests accordingly.

Signed-off-by: Luca Burelli <[email protected]>
Output lineno/filename as comments in the string representation of a DT
to help with debugging DT issues. Also, remove the added comments when
comparing the string representation of a DT to a reference string in the
DT testsuite.

Signed-off-by: Benjamin Cabé <[email protected]>
Signed-off-by: Luca Burelli <[email protected]>
The root node is the first node in the DTS string representation, and is
currently separated from the headers by two empty lines.

Adjust the spacing so that only one line is printed in all situations. A
small adjustment is added to the test suite to keep the current expected
outputs unchanged.

Signed-off-by: Luca Burelli <[email protected]>
This commit allows comments to reference files with paths that are relative
to the Zephyr workspace root. This is done by adding a new argument
'--workspace-dir' to the 'gen_edt.py' script, which is passed to the
'EDT' and 'DT' classes and used instead of the current working directory.

The workspace directory is set to WEST_TOPDIR if West is in use,
otherwise it is set to the parent directory of ZEPHYR_BASE so that
Zephyr files have a 'zephyr/' prefix.

Signed-off-by: Luca Burelli <[email protected]>
Copy link

github-actions bot commented May 2, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
zephyr-lang-rust zephyrproject-rtos/zephyr-lang-rust@d4f9036 (v4.1-branch) zephyrproject-rtos/zephyr-lang-rust#96 zephyrproject-rtos/zephyr-lang-rust#96/files

DNM label due to: 1 project with PR revision

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-zephyr-lang-rust DNM (manifest) This PR should not be merged (controlled by action-manifest) labels May 2, 2025
@pillo79 pillo79 changed the title rust: add comment support to DTS parser [DNM] rust: add comment support to DTS parser May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DNM (manifest) This PR should not be merged (controlled by action-manifest) manifest manifest-zephyr-lang-rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants