ztimer: relocate PSEUDOMODULES definitions #14123
Conversation
|
I think @maribu may also should have a look, as he proposed the build system's sanity-check. |
|
I wonder if it wouldn't be simpler to move the include of Lines 367 to 369 in 4adb8ab below here: Lines 396 to 397 in 4adb8ab The ifneq (,$(filter ztimer_xtimer_compat,$(USEMODULE))
# Don't link in xtimer when ztimer_xtimer_compat is used
PSEUDOMOUDLES += xtimer
endif |
|
@leandrolanzieri and @fjmolinas, care to share your thoughts on this? |
Up to recently pseudo-module where declarative I preferred that, so I lean more to what I suggested in #13661 (comment), but its not something I would insist on.
But for me this is just an argument in favor of keeping them declarative. |
Declarative IMO is easier to maintain. Other than that, +1 for the sanity check. |
|
Seem that my comment unintentionally blocked this one, that was not my intention. I don't really mind either way. We are targeting changing inclusion order pretty soon, I think we can watch out to not to add the conditional |
@jue89 if you want to take the approach suggested by @maribu I fine as well. |
|
I think there might be something to learn in this for the Kconfig migration. It would be good if one module could "provide" another module. Specifically, Update: Fixed typo (no --> now), which changes the meaning of the last sentence |
From what I understand what you are referring too will be easy to model in Kconfig, in our current structure what it needs it a module that just represents the api. In the example above that could be Anyway, this might be something we will need to address eventually when trying to migrate dependency resolution or otherwise it might be difficult to compare with kconfig. I kconfig terms I could see this as (ping @leandrolanzieri on this :) ): |
|
An the
|
|
Anyway, my two last comments, are addressing a broader subject than this PR. I still like this PR in the sense that the exception is contained, and a static check is added to avoid it being added in Makefile.dep. The broader subject can be addressed in another PR. So ACK, on my side @maribu, I take your thumbs up as you being OK with the PR as well. I'll merge tomorrow in case you want to add something else :) |
|
Hmm, I wonder if it might make sense to tread modules and APIs completely independent. So that a module is no longer allowed to depend on a module, but rather on an API. And the This distinction would allow adding alternative implementations of an API later on quite easily. It should also allow detecting conflicts easier. E.g. if two modules provide the same API, they implicitly conflict. Regarding the PR: I'm fine with merging :-) |
Would be nice to have @leandrolanzieri point of view on this. |
Yes. I think in Kconfig this can be modelled as features provided by modules. |
Contribution description
The discussion in #13661 pointed out that
ztimeris the only module touchingPSEUDOMUDLESwithin itsMakefile.dep. To be aligned to the current dependency resolution system of RIOT, this PR relocates these definitions.Testing procedure
env USEMODULE="ztimer xtimer_on_ztimer" make -C tests/xtimer_msg clean all testenv USEMODULE="ztimer ztimer_xtimer_compat" make -C tests/xtimer_msg clean all test./dist/tools/buildsystem_sanity_check/check.shIssues/PRs references
#13661