-
Notifications
You must be signed in to change notification settings - Fork 2k
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
make: add targets to debug dependencies variables #12004
make: add targets to debug dependencies variables #12004
Conversation
Script added, I am running it right now. |
@fjmolinas you may be interested in this as I would like to use this for helping reviewing changes done with #11477 |
Running the script took 130m on my machine though. |
Can you give me the exact command you executed please. |
Sure, the command I used was:
With |
I will change something. As I want to compare the output from the Otherwise it makes comparing way harder as concatenating all files and diff is invalid. |
If one currently wants to compare the output of the |
0ecad5f
to
a6b45a0
Compare
I rebased due to conflicts in |
a6b45a0
to
19f538e
Compare
This PR was tested while reviewing #12092. |
Now that #11470 is merged, I could rebase this PR and integrate the content of the I did not before as it required removing erroneous files and preferred to be explicit in the testing PRs. |
Please do. |
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.
Some general comments regarding code (shellcheck
is happy :) ).
dist/tools/buildsystem_sanity_check/save_all_dependencies_resolution_variables.sh
Show resolved
Hide resolved
makefiles/dependencies_debug.inc.mk
Outdated
.PHONY: dependency_debug | ||
# Only generate the dependencies when the board is not disabled | ||
# This will allow comparing with the output of `info-boards-supported` more easily | ||
dependency_debug: |
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.
Just a style remark, why "_"
most recipe we have use "-"
as far as I can tell.
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.
Indeed, will change.
makefiles/dependencies_debug.inc.mk
Outdated
# The goal is to get the value of variables used for dependency resolution | ||
# and the impact of refactoring | ||
|
||
# Files output can be generated through `info-boards-supported` evaluation with |
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.
This returns incorrect resolution in some cases if I'm understanding right from your PR description, right?
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.
The script returns the resolutions from the build system, but the build system returns incorrect parsing when doing info-boards-supported
as it ignores the content of boards/cpu/Makefile.include
that are currently required.
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.
Maybe we need to add a note saying they are different and that there is a "correct" one, similar to your PR comment.
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.
Sure I add this.
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.
I will flip the definitions to have the "normal" one first.
I will add it and remove the documentation explaining how to do it. |
I still kept the documentation in |
Ok, although I think this and many tools should somehow have there documentation more exposed, e.g. in |
You are right. I squash and add a reference in there. |
Add a 'dependency-debug' and a 'DEPENDENCY_DEBUG=1' option for 'info-boards-supported' to save some variables used when resolving dependencies. Print some some 'sorted' variables to simplify comparing the actual value when the parsing order changed. This should help tracking changes introduced when refactoring the dependency parsing.
Add a script saving all applications and boards dependency resolution variables and also aggregated files to compare between both dependencies handling. It is slow but should dump everything.
b4a49c7
to
7d0b922
Compare
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.
I have a single comment for the new doc, otherwise I think this PR is ok. If you agree with my suggestion please squash.
Or with the version used by murdock to know supported boards to a | ||
`dependencies_info-boards-supported_board_name` file: |
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.
Or with the "quick" version used by murdock (this is an incomplete resolution, details in makefiles/dependencies_debug.inc.mk
):
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.
I changed it this way to still keep the rest of sentence.
I squash directly.
diff --git a/doc/doxygen/src/advanced-build-system-tricks.md b/doc/doxygen/src/advanced-build-system-tricks.md
index b5f0e9b67..c7614a8be 100644
--- a/doc/doxygen/src/advanced-build-system-tricks.md
+++ b/doc/doxygen/src/advanced-build-system-tricks.md
@@ -58,8 +58,9 @@ Generate the variables dump with the normal dependency resolution to a
BOARD=board_name make dependency-debug
~~~~~~~~~~~~~~~~~~~
-Or with the version used by murdock to know supported boards to a
-`dependencies_info-boards-supported_board_name` file:
+Or with the "quick" version used by murdock to know supported boards
+(this is an incomplete resolution, details in `makefiles/dependencies_debug.inc.mk`)
+to a `dependencies_info-boards-supported_board_name` file:
~~~~~~~~~~~~~~~~~~~
BOARDS=board_name DEPENDENCY_DEBUG=1 make info-boards-supported
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.
Yep looks good!
Add short documentation for the dependency resolution debug targets. Point to the main files for more infos.
040df2f
to
9940a15
Compare
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.
ACK!
GO! |
Thank you for the review! |
Contribution description
Add a 'dependency_debug' and a 'DEPENDENCY_DEBUG=1' option for
'info-boards-supported' to save some variables used when resolving
dependencies.
This should help tracking changes introduced when refactoring the
dependency parsing.
Testing procedure
As described in the file documentation:
The goal is to get the value of variables used for dependency resolution
and the impact of refactoring
Files output can be generated through
info-boards-supported
evaluation withAnd for each board in the normal make context with
To compare in an aggregated file, you can run in an application directory:
"Funny" things:
Right now, the quick "resolution" done by murdock to know which boards are supported is using a subset of the values it must be using.
USEMODULE
does not have all the modules and someFEATURES_REQUIRED
are absent.It can easily be seen already with one board in
examples/hello-world
Issues/PRs references