Makefile.dep: auto_init_% as DEFAULT_MODULES#13089
Conversation
|
I removed now all |
|
Ups I had |
|
BTW this should wait for the release to be over. |
6a4a3e8 to
4d5ddfb
Compare
|
Rebased. |
|
I'll also add |
I'll do a separate PR for this, murdock already on this one so it should be ok as is, |
Makefile.dep
Outdated
| USEMODULE += random | ||
| endif | ||
|
|
||
| ifneq (,$(filter auto_init,$(USEMODULE))) |
There was a problem hiding this comment.
Would it make sense to move this to a separate file?
Makefile.dep
Outdated
| USEMODULE += random | ||
| endif | ||
|
|
||
| ifneq (,$(filter auto_init,$(USEMODULE))) |
There was a problem hiding this comment.
I think it would make sense to turn this into a loop.
Something like
HAS_AUTO_INIT += foo \
bar \
#
ifneq (,$(filter auto_init,$(USEMODULE)))
DEFAULT_MODULE += $(patsubst %,auto_init_%,$(filter $(HAS_AUTO_INIT),$(USEMODULE))
endif
There was a problem hiding this comment.
maybe additionally filter on DISABLED_MODULES
There was a problem hiding this comment.
HAS_AUTO_INIT += foo \ bar \
where would this be?
There was a problem hiding this comment.
I think in Makefile.dep for now is fine, no?
There was a problem hiding this comment.
The alternative would be to have, for every module that uses auto_init, a dependency block:
ifneq (,$(filter foo,$(USEMODULE)))
ifneq (,$(filter auto_init,$(USEMODULE)))
DEFAULT_MODULE += auto_init_foo
endif
endif
This way, the information is "closer" to the module's dependency info.
There was a problem hiding this comment.
I don't like the HAS_AUTO_INIT because these function do not allways match a module name which makes it kind of weird. These HAS_AUTO_INIT would IMO have to be in the modules MAKEFILE, but some of these MODULES are not pseudomodules, so it isn't a HAS_AUTO_INIT but use this MODULEs init function in a way, and there isn't a MODULE<->auto_init naming match in all cases.
There was a problem hiding this comment.
why "later in the file"?
in order to know all modules with potential auto_init support. but since this file is included transitively, this doesn't make much sense.
There was a problem hiding this comment.
So which style is prefered @aabadie @kaspar030?
There was a problem hiding this comment.
For me,
ifneq (,$(filter foo,$(USEMODULE)))
DEFAULT_MODULES += auto_init_foo
...
endif
... together with some logic so that if auto_init is disabled, all auto_init_% are also disabled.
|
|
||
| FEATURES_REQUIRED = periph_rtt | ||
|
|
||
| DISABLE_MODULE += auto_init |
There was a problem hiding this comment.
Should be removed this is still called, since init_rtt is not in auto_init
|
I've removed the discussion label, I think there's consensus this is a nice idea. |
aefb068 to
ef76fe4
Compare
|
Rebased to fix conflict. |
ef76fe4 to
c830260
Compare
Declaring all auto_init_% modules as pseudomodules will allow using auto_init_% modules as modules that can be disabled. This will give a higher lever of granularity allowing users to not disable the complete auto_init module but only some of them.
Currently default modules resolution is only performed in Makefile.include. This avoids DEFAULT_MODULES being declared in Makefile.dep since they never become USEMODULE. Duplicate at the end of the dependency resolutiion after recursive cach of transitive depdencies since at this stage DEFAULT_MODULES can't and SHOULD NOT trigger depedency resolutions.
Having the modules as DEFAULT_MODULES allows disabling them.
c830260 to
e0855de
Compare
|
@kaspar030 @aabadie can you check if all is OK for you, this one diverges quickly. |
| DEFAULT_MODULE += auto_init_gnrc_sixlowpan | ||
| USEMODULE += sixlowpan | ||
| DEFAULT_MODULE += auto_init_gnrc_sixlowpan |
There was a problem hiding this comment.
Is there a reason for adding auto_init_gnrc_sixlowpan twice?
I think those were added twice by accident. This cleans that up. introduced by RIOT-OS#13089
Contribution description
This PR looks to extend the granularity of
auto_initMODULES. Currently onlyauto_initis aDEFAULT_MODULEwhich means its the only one that can be disabled, which translates into, get everything or nothing. As a user I could want to only deactivate one of thisauto_initmodules and keep the rest (for examples in ourtests).This PR wan't to achieve this by declaring all curent cases of
USEMODULE += auto_init_%asDEFAULT_MODULE += auto_init_%, it also by default declares allauto_init_%as pseudomodules (except for those that are not).As an example I add an
auto_init_xtimermodule and changes the gauards inauto_init.cto reflect this. IMO this could be done for all modules inauto_init, but that would mean a lot of changes, so maybe better to introduce when needed?Testing procedure
green murdock
try disabling a module, I added a
#errorin:and compiled with and without disabling
DISABLE_MODULE+=auto_init_xtimer make -C tests/xtimer_usleepIssues/PRs references
Though of this because of #13052