Makefile.dep: Fix duplicate modules from USEMODULE#13401
Makefile.dep: Fix duplicate modules from USEMODULE#13401aabadie merged 1 commit intoRIOT-OS:masterfrom
Conversation
|
@leandrolanzieri nice catch! I don't want to dogmatize this incident, but here again we have a poster child of how untamable our current solution to dependency resolution is ... and that we are missing proper regression tests for the build system itself. Anything that adds complexity to the enormity in Makefile.dep (c'mon, recursive inclusion of the same Makefile?) feels like a step backwards. It requires a good grasp of large parts of the build system to see overall implications of any change in |
|
@aabadie and @kaspar030, you reviewed the original PR, could you take a second look at this? |
|
Thanks for the catch @leandrolanzieri, sorry for not checking this earlier I was on vacation. Regarding the changes alltough there is not harm in having duplicates, it is a nice cleanup! The simple expansion is important catch, so thanks for the fix. I tested locally and it still works. The build issue are also present in master for me for all msp430: Has something happened with msp430 since I've been away?? |
|
@fjmolinas sounds like a toolchain problem to me. @kaspar030 was there a docker image change and do we need to restart some workers? |
The msp320-elf tolchain has been added, but there should be no change to the existing 4.x toolchain. |
IIRC the old msp430 needs oneway_malloc, which is a default module. Maybe some change there makes that not be included anymore. |
Hmm I don't understand why if I do: there is no but if I do: there is |
|
The change also breaks tha handling of RIOT/boards/common/nrf52/Makefile.include Lines 9 to 12 in 2ebf1d6 which includes |
I guess the problem will vanish with #12457, but waiting for that PR to be merged may probably take a little bit more time.
we want a hack to persist long-term? :) I would not object with switching the include order. Are there other benefits to having |
Not the hack hahaha, just the re-ordering, see #9913 for a more detaile road-map and explanation. Once all requirements are fulfilled, the ordering can be inverted and both hacks removed. |
|
@leandrolanzieri your last fixup re-introduces the behavior that make includes order matter, but that in this case make the |
This is not my favourite solution either. But we can't have the simply expanded assignment before the first iteration of the |
The logic that adds auto_init_% DEFAULT_MODULES was placed at the end of Makefile.dep, which is recursively included. That means that the logic is executed multiple times. This moves the logic so it is only executed once, when the break condition of the iteration is met.
26cd2fc to
20bbe43
Compare
|
@fjmolinas squashed |
IMO DEFAULT_MODULE is not very well defined, and since the handling is wrong and unclear it leads to improper use. IMO See #13089 (comment)_ also |
Contribution description
With the changes introduced in #13089 the list of
USEMODULEs shows multiple timesauto_init_%modules.There are multiple reasons for this:
auto_init_%DEFAULT_MODULEStoUSEMODULEis placed at the end ofMakefile.dep, which means that it gets executed multiple times (due to recursive inclusion ofMakefile.dep).DEFAULT_MODULESis not sorted (unlikeUSEMODULE) so it holds duplicates.Makefile.includeUSEMODULEis extended with the not-disabledDEFAULT_MODULEs, but the assignment is not simply expanded, so it only gets expended after a first iteration ofMakefile.dep. This means that theDEFAULT_MODULElist may already have new elements.Printing
USEMODULEand filtering duplicates, for example, forexamples/gcoapreturns:On master:
With PR:
# emptyTesting procedure
make info-debug-variable-USEMODULEthat modules are not longer duplicated, and the list of not duplicated is the same.Issues/PRs references
#13089