Skip to content

pkg: USEPKG vs USEMODULE #6668

@miri64

Description

@miri64

There seem to be some confusion all throughout the code-base about the USEPKG macro and how to use it. My interpretation at this point: USEPKG pulls the package in (i.e. just downloads and patches it), USEMODULE then builds modules that are part of that module. Yes, USEPKG lets the buildsystem step into the package's path, but I see it more like updating DIRS in sys or net/gnrc. However, this does not seem to be the case with all packages. Some use USEPKG and USEMODULE interchangeably, or even require the user only to provide USEPKG, while failing to build if a user provides it in USEMODULE. I think my interpretation makes sense in terms of user-friendliness for several reasons:

  • It provides a clear semantic between what a package (a mechanism for building and patching an external module) is and what a module (a build-unit provided to the RIOT image) is
  • It allows a package to have sub-modules (see lwIP) or modules that have nothing to do with the project they belong to (see nanocoap, which belongs to @kaspar030's sock project), while not desturbing the above mentioned semantics
  • It allows for pulling in packages transparently to the user: USEMODULE += lwip_ipv6 can update USEPKG += lwip in Makefile.dep without making lwip all that different from other modules.

Metadata

Metadata

Labels

Area: build systemArea: Build systemArea: pkgArea: External package portsDiscussion: RFCThe issue/PR is used as a discussion starting point about the item of the issue/PRState: don't staleState: Tell state-bot to ignore this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions