-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
cmake: dts: print binding dirs and board extension overlays #83533
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -276,6 +276,18 @@ finds in the configuration phase, like this: | |
|
||
-- Found devicetree overlay: .../some/file.overlay | ||
|
||
Additional directories containing devicetree overlay files can also be added | ||
by appending to the ``BOARD_EXTENSION_DIRS`` CMake variable in the application | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I saw it when I was investigating the BOARD_EXTENSION_DIRS variable indeed. It seemed a bit overcomplicated to me, I don't want make any new variant with new qualifiers, I just want to extend a board with the same name. I also think it cannot do any harm by supporting BOARD_EXTENSION_DIRS more openly. It is still possible anyway, why not document it so people can use it correctly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I understand, but we require this because we don't want the original board description to be "quietly" replaced or overridden just by including an external module in the workspace. We also don't want potential conflicts from multiple modules trying to add their own overlays etc.
In this case, it's because the variable is tied to the old board extension feature, which is deprecated and will be removed together with HWMv1. But note that the use case you alluded to in this file - setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use case that I am dealing with is that I have the following project structure where I want to reuse
Essentially, I want to be able to specify where that project-specific There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It sounds like you could use |
||
:file:`CMakeLists.txt` file. Make sure to do so **before** pulling in the | ||
Zephyr boilerplate with ``find_package(Zephyr ...)``. | ||
|
||
.. note:: | ||
|
||
When specifying ``BOARD_EXTENSION_DIRS`` in a CMakeLists.txt, then an absolute path must | ||
be provided, for example ``list(APPEND BOARD_EXTENSION_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/<extension-dir>``. | ||
When using ``-DBOARD_EXTENSION_DIRS=<extension-dir>`` both absolute and relative paths can be | ||
used. Relative paths are treated relatively to the application directory. | ||
|
||
.. _use-dt-overlays: | ||
|
||
Use devicetree overlays | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always challenging to decide exactly what should be printed.
We try to limit the output CMake status output to just exact files or tools included in build as those are those are most important in order to quickly discover if a wrong file (conf, dts, etc.) or version of a given tool (compiler, python, etc) is picked up, as this quickly helps users to discover when something is wrong, like env variable, paths, and the like.
You may say paths can be in similar category, but there can be a lot of paths being searched and if we start to print all of those, including those being provided by Zephyr modules, then we quickly get a lot of lines that makes it harder to quickly spot the more important information mentioned above.
If you want to see which paths were actually considered for the build, then you should take a look at
<build>/build_info.yml
which contains a lot more information regarding both files and paths used during the CMake and build stages.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I see.
build_info.yml
seems to be fairly recent (October 8, 2024) and doesn't seem to have made it into my downstream fork (nrfconnect/[email protected]) yet, so I haven't tried it. Currently, we're upstepping to nRF Connect 2.9.0, so then I can re-evaluate. For that reason, I will close this.Most of my issues related to devicetree generation have been due to malformed file paths, forgetting the
bindings
ordts
indts/bindings
, for example. I am a big proponent of the "The Rule of Silence" posix philosophy, but discarding devicetree entries because the binding for a node could not be found (in all the paths where it goes looking for them), I consider particularly noteworthy. So in that philosophy, that would be the ideal moment to print the binding paths. But I am also pragmatic, so without dwelling too much into the devicetree generation code, this would be, I thought, the next best opportunity.My apologies for any inconvenience this PR may have caused and thanks a lot for your valuable feedback and time 🙂
Regards,
Jelle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this I agree too sounds like something which should probably be printed.
Discarding an entry without informing the user is in general never nice.
I'm unsure the reason for such silent discard, but I this PR (or an alternative) can be made which informs users when entries are discarded, then that sounds like a nice improvements.
Alternative, create an enhancement issue, as that can have other people providing feedback as to why this is silently ignored.
The PR had no inconveniences, only the description of the PR wasn't exactly clear that entries was silently discarded.
You surely have found something worth improving 👍