Makefile.features: add declarative FEATURES_ variables definition#11492
Makefile.features: add declarative FEATURES_ variables definition#11492fjmolinas merged 4 commits intoRIOT-OS:masterfrom
Conversation
|
@cladmi Is this PR waiting for another PR because of your TODO list or because is actually depends on one? |
|
My bad, it does not depend on anything. Must have misclicked… |
|
Oh yes it depends on splitting the first two commits, now that I remember it. So was indeed right, I just forgot to do it. |
|
It could also be merged without these two commits at all. So lets say they should either be removed before merging, or split in another pull request but not block it. |
There was a problem hiding this comment.
@cladmi Can you reword your last commit details to :
Define a variable for FEATURES_USED that conflict and use it in
Makefie.include.
It could also be merged without these two commits at all. So lets say they should either be removed before merging, or split in another pull request but not block it.
About the first two commits, do you see more use for the recipe besides testing this PR? If there is one lets keep it, but if not remove them from the PR.
Otherwise I tested and got the same supported-applications output.
I like the general re-ordering introduced by this PR, I do have a couple of comments regarding naming. See below and FEATURES_CONFLICTING isn't working for me.
Makefile.features
Outdated
| FEATURES_OPTIONAL_ONLY = $(sort $(filter-out $(FEATURES_REQUIRED),$(FEATURES_OPTIONAL))) | ||
| FEATURES_OPTIONAL_USED = $(sort $(filter $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY))) | ||
| # Optional features that will not be used because they are unavailable | ||
| FEATURES_OPTIONAL_UNUSED = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY))) |
There was a problem hiding this comment.
I think FEATURES_OPTIONAL_MISSING would be clearer in this case, FEATURES_OPTIONAL_UNUSED doesn't let you know why they are unused. What do you think?
There was a problem hiding this comment.
Thank you for going in the semantic details, that is what I want to be challenged :)
I wanted to separate missing which for me sounds like an error from they are not available but optional anyway/or not used. And even changed it from the previous FEATURES_MISSING message that was in info-build.
With a new general FEATURES_BLACKLIST #9081 variable or specific FEATURES_OPTIONAL_DISABLE #10047 (comment) variable, an optional feature could be provided but not included.
But maybe I would indeed need a specific variable for this case or the OPTIONAL_MISSING.
About the first two commits, do you see more use for the recipe besides testing this PR? If there is one lets keep it, but if not remove them from the PR.
Testing other refactoring Pull requests that touch the makefiles/info-global.inc.mkand can changeinfo-boards-supported`.
I would prefer to have them in a separate PR anyway.
There was a problem hiding this comment.
I wanted to separate missing which for me sounds like an error from they are not available but optional anyway/or not used. And even changed it from the previous FEATURES_MISSING message that was in info-build.
I agree with this. But FEATURES_OPTIONAL_UNUSED makes me think of features that are optional but that I (or the build system) have decided not to use. I had to read up the comment and code to understand what it meant since it went against my intuition of what the variable name made me think.
FEATURES_OPTIONAL_DISABLE #10047 (comment) variable, an optional feature could be provided but not included.
In that case to me its more intuitive to have:
FEATURES_OPTIONAL_UNUSED = $(sort $(filter $(FEATURES_OPTIONAL_DISABLE),$(FEATURES_OPTIONAL_ONLY)))
and
FEATURES_OPTIONAL_MISSING = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY)))
Anyway this is just my interpretation, but I think is exactly the kind of questioning you wanted right?
There was a problem hiding this comment.
So you would prefer two variables for this.
Currently there would be no FEATURES_OPTIONAL_UNUSED as none of the two DISABLE or BLACKLIST are there.
I will change the UNUSED to go back to the MISSING behavior and see for a nice more describing comment.
@cladmi Ok, can you open a separate PR for this then? Or are you thinking of optimizing it a bit first? I'm merging what you did now, I'm sure optimization will come later :). (I can review that one and get it moving quickly) |
|
@cladmi ping! |
|
@fjmolinas I am not 100% currently available, so I cannot focus on everything. But no worry, I do not miss it :) |
6c1d9dc to
b72930c
Compare
4e3683c to
4afa19b
Compare
|
@cladmi This is not longer waiting for another PR right? |
|
Indeed, updated the description and the labels. |
|
I'm satisfied with the naming of the variables. As I stated before everything was working as expected. I will still wan't to repeat the tests afters you squash your commits! (and if you are also happy with the variables semantics) |
Update the FEATURES_OPTIONAL meaning to be more in line since FEATURES_USED is defined. Handle FEATURES_OPTIONAL as a configuration from the BSP/build that should not be changed anymore after. `FEATURES_OPTIONAL` are by definition optional so are not supposed to cause a build to fail. Only the 'REQUIRED' ones that are not 'PROVIDED' are 'MISSING'. * Do not change FEATURES_OPTIONAL to remove REQUIRED features * Prepare for having a different variable for the previous value * Update dependency resolution/info-build as FEATURES_OPTIONAL cannot be missing
Put the definition of `FEATURES_MISSING` in common and use the variable instead of duplicating code.
Put the definition of `FEATURES_USED` in common and use the variable instead of duplicating code. This required defining 'FEATURES_OPTIONAL_ONLY|USED' to not overwrite the value of 'FEATURES_OPTIONAL' as was done before. Also add 'FEATURES_OPTIONAL_MISSING' to list optional features that were not included as not provided. This removes the need to print FEATURES_MISSING with the optional features too.
Define a variable for used features that conflict and use it in `Makefie.include`. It was not used by `info-global.inc.mk` and is still currently not.
4afa19b to
6d7a70b
Compare
|
Squashed and I am happy with the current names. |
|
At least I get the same output for |
|
@fjmolinas ping if you have time :) |
fjmolinas
left a comment
There was a problem hiding this comment.
Tested again, everything is still working as expected and I agree with the semantic change. ACK!
|
Sorry for the delay, GO! |
|
@fjmolinas no worry we all have a lot of things in parallel. |
|
Thank you for the review |
Contribution description
Use
Makefile.featuresto define all the calculatedFEATURES_variables.This gives a name on the resolved parsing of the BSP
FEATURES_variables.Then use them in
Makefile.include/makefiles/info.inc.mk/makefiles/info-global.inc.mk`.Reviewing procedure
The review is mainly on
Makefile.featuresthe other changes being the consequence of the changes but they can explain what changed.The goal is does the name makes sense and matches with what is evaluated.
The fact that the migration is correct can come in a second time.
Testing procedure
All the supported applications should still be the same.
I added
make info-applications-supported-boardsthat can be run in the base directory to compare a commit with another for listing all the boards returned byinfo-boards-supported. (I will split this one).The output of this one should be the same with the end commit and the commit introducing it.
Info-build output
I will add some outputs for the
info-buildto verify the new variables in some defined cases.Difference between master and this pull request
Output with conflicting features:
Issues/PRs references
Side work of #9913 that added this
Makefile.featuresto group thefeatureshandling.Could help with #9081 to have the definition in only one place.
info-applications-supported-boardsmakefiles/app_dirs.inc.mk: target to list supported applications/boards #11590