WIP RFC Replace usage of USEPKG by USEMODULE.#9307
WIP RFC Replace usage of USEPKG by USEMODULE.#9307cladmi wants to merge 16 commits intoRIOT-OS:masterfrom
Conversation
f9a16e2 to
6ec0f95
Compare
|
The incremental changes also allow to possibly stop on a previous commit if preferred, or split this PR. |
|
I also remember there are some packages pre-cleanup included that I can do in sub PRs. |
505d17c to
b1faef2
Compare
|
|
||
| # Detect if an application or Makefile.dep defined USEPKG | ||
| ifneq (,$(USEPKG)) | ||
| ifeq ($(origin USEPKG), file) |
There was a problem hiding this comment.
I currently need this because USEPKG is exported in vars.inc.mk and it seems already set before executing make in murdock.
I could remove the export in vars.inc.mk maybe, but I still do not get why it has a value when passing through here for the moment (I did not investigate).
There was a problem hiding this comment.
There is currently a usage in sys/shell/commands that should be updated to use USEMODULE. I will try to go early in that direction.
|
I fixed the broken builds, remaining task is to move packages dependencies out of the main Makefile.dep. |
|
Still remaining dependencies not migrated to
|
d5de2fd to
3a55494
Compare
|
There's a weird lwip failure in the Murdock logs. Maybe needs a rebase? |
3a55494 to
15d7e18
Compare
|
I moved the |
|
Looks still broken, I will investigate. I expected this as some of the dependencies definition are order specific. |
15d7e18 to
d58a167
Compare
|
I moved the "default implementation" selection at the end of |
9f66e5e to
bf34391
Compare
|
Will need to rebase due to #9884 |
|
@cladmi how is this coming? I think this is a nice cleanup, if you need help on testing: I'm in. |
|
Thanks for the update. It got somehow lost in my todo list, and was waiting for the "Get maintainers feedback on the solution" and "Check if the updated documentation is enough ! ! !" parts so did not put more work on it recently. If you like this current solution, or tell me what I should change, I can start splitting parts. |
INCLUDE is now set by the packages pkg/<pkg_name>/Makefile.include file.
There is no such thing as a required order to define this.
It is assumed they are in 'RIOTPKG/pkgname' and that there is a module named 'pkgname'.
Prepare for specifying dependencies to packages only by putting them in `USEMODULE`. USEPKG would be an internal only variable similar to DIRS.
Prepare for specifying dependencies to packages only by putting them in `USEMODULE`.
Prepare for specifying dependencies to packages only by putting them in `USEMODULE`.
… as USEPKG to USEMODULE Prepare for secifying dependencies to packages only by putting them in `USEMODULE`.
Prepare for secifying dependencies to packages only by putting them in `USEMODULE`.
Prepare for secifying dependencies to packages only by putting them in `USEMODULE`.
Prepare for secifying dependencies to packages only by putting them in `USEMODULE`.
Replace declaring dependency of packages using USEPKG to using USEMODULE. Setting USEPKG to the list of used packages will be done by the build system. RIOT-OS#6668 Currently, if a package has sub modules, like pkg_name_sub_module it would still require to have in the main Makefile.dep a dependency from pkg_name_sub_module to pkg_name module.
Allow to safely include all pkg/*/Makefile.dep before knowing if they are used or not. This allows using "USEMODULE += pkg_name_submodule_name" in applications and define the 'pkg_name_submodule_name' dependency to 'pkg_name' in the package itself.
This allows packages to declare there sub modules dependencies directly in the package directory instead of the main Makefile.dep. It however requires all packages to protect Makefile.dep to only set dependencies if the package is used.
Move most of the packages dependencies to pkg/*/Makefile.dep.
Still some weird cases are handled in Makefile.dep.
I used this command to check for non migrated packages
grep $(ls -d pkg/*/ | sed 's|^pkg/|-e |;s|/||') Makefile.dep
1be18e9 to
73b9fc6
Compare
|
I did a blind stupid rebase on master. May not be working right now. From the first version I did, I would like to change the handling to do the dependencies first to allow deprecating incompatible things earlier without breaking anything. I see some steps to go forward with this in parallel:
|
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Contribution description
This addresses the inconsistent use of USEPKG mentioned in #6668.
Currently USEPKG is required to tell the build system to take
pkg/PKG_NAMEinto account.It was argued that it makes the user aware he is using a package as he is required to put USEPKG, but packages are being pulled as dependencies for some cpu. And also, some packages, like
lwipare implemented by several modules and doingUSEMODULE = lwip_ipv6triggers the inclusion of the package transparently.This PR tries to implement the proposed solution
The build system modification is done around these changes:
and fixing packages so
pkg/*/Makefile.depcan be included even if the module is not required. Like done in the normal Makefile.dep anyway.This goes in the direction of making packages self contained like #9003
API CHANGE
It requires all packages
Makefile.depto be protected by theifneqpattern.It also require to remove all
USEPKGin applications (which should be asserted right now).Implementation
The commits have been designed to be incremental and always be in a working state. But this was not tested.
I count on murdock to help finding if there are issues and fixing them in the right place.
TODO
pkg/*/Makefile.dep(this could be done in subsequent PRs also)Issues/PRs references
pkg: USEPKG vs USEMODULE #6668