-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[PoC] Module dependency modelling using Kconfig #14055
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
[PoC] Module dependency modelling using Kconfig #14055
Conversation
96f2b23
to
479cf8b
Compare
This adds not-visible modules like 'sys' or 'cpu' and some other modules that usually are active like 'core_msg', and 'auto_init'.
This models cortexm_common and cortexm_common_periph modules. It also models the architecture-specific symbols and defines CPU common symbols when using this architecture.
479cf8b
to
bf21ed6
Compare
Rescheduled in favor of release notes, which I want to get into the release branch ASAP |
@@ -8,3 +8,9 @@ config BOARD | |||
string | |||
help | |||
Name of the currently selected board. | |||
|
|||
config MOD_BOARD |
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.
Can't we use an explicit MODULE
prefix instead of MOD
?
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.
Yes, once the migration is completed we could just change that. But the MODULE_
prefix is currently being used to get the information of the modules added via USEMODULE
, which allows to show only relevant configurations:
Lines 94 to 102 in 06dca07
# Build a Kconfig file defining all used modules and packages. This is done by | |
# defining symbols like 'MODULE_<MODULE_NAME>' or PKG_<PACKAGE_NAME> which | |
# default to 'y'. Then, every module and package Kconfig menu will depend on | |
# that symbol being set to show its options. | |
$(KCONFIG_GENERATED_DEPENDENCIES): FORCE | $(GENERATED_DIR) | |
$(Q)printf "%s " $(USEMODULE_W_PREFIX) $(USEPKG_W_PREFIX) \ | |
| awk 'BEGIN {RS=" "}{ gsub("-", "_", $$0); \ | |
printf "config %s\n\tbool\n\tdefault y\n", toupper($$0)}' \ | |
| $(LAZYSPONGE) $(LAZYSPONGE_FLAGS) $@ |
Contribution description
This PR is a proposal of how we could model module's dependencies in Kconfig. Although there are many commits, this models the minimum to get
examples/gnrc_networking
to compile forsamr21-xpro
. It's to have an idea of how this can look like.As presented before, the approach for module selection is bottom-up. This means that all dependencies of a module need to be active in order to select that module. Opposite to the current approach where some modules are selected and its dependencies are included (some sort of top-down approach).
Documentation has been added and split into:
Reviewing this
I tried to make each commit as self-contained as possible, mostly modelling a module per commit. Nonetheless there are a lot of changes so I will point out some things which might be nice to take a look at:
I based most of the dependencies on our Makefile.dep files, but the current modelling is not definitive as some dependencies might still be missing, and some modules that are always used may be hidden.
Example of configuration
Selecting source seed and implementation for random

Usage
examples/gnrc_networking
runTEST_KCONFIG=1
allows to switch between the usage of Kconfig and Makefile.dep to get the module list to compile.Kconfig will load the configuration file present in the application folder.
If you need to clean the application take into account that for now
make clean
andmake all
should be called separately.