mbox series

[v2,0/7] Add new packagefeed recipe class

Message ID 20230816200931.2577181-1-charlie.johnston@ni.com
Headers show
Series Add new packagefeed recipe class | expand

Message

Charlie Johnston Aug. 16, 2023, 8:08 p.m. UTC
Currently, the only way to build a feed natively in OE is to build all the desired packages and then manually run bitbake package-index. This approach has a few drawbacks:
- The index creation methods ONLY work on the package deploy directory. If there are packages that are not meant to be in the feed in the deploy directory, they will be included in the package index. Also, multiple feeds cannot be built in one command due to this limitation.
- If a package feed depends on another package feed being side-by-side to it (that is, if packages in Feed A depend on packages in Feed B and users of Feed B are required to use Feed A) a user would have to manually remove duplicate packages from the deploy directory before making Feed B's index.

To address this, this patch set creates a new packagefeed.bbclass that enables the creation of feeds in a new deploy directory location for feeds. The patch set updates existing logic in the package_manager class that was previously used to create a temporary feed when building a rootfs. That logic is then used to create a feed and exclude any packages which might be included in any provided side-by-side feeds. 

Note that currently the class does not make use of sstate. Since the individual packages are cached, there did not seem to be anything to be gained from the extra effort required to cache the feed. Caching the whole feed was not space efficient, and reworking package index creation to be compatible with caching didn't seem worth the effort given that operation is fairly inexpensive.

I've tested this in oe-core by creating a few sample recipes and running with each combination of the PACKAGE_CLASSES variable. The testimage cases for dnf were also updated to use the new packagefeed creation mechanism and several images were run with testimage to confirm proper behavior.

Changes since v1:
- Added example of implementation to bbclass comments.
- Updated testimage to use do_packagefeed for dnf tests and ran testimage on several images with and without dnf tests.

Changes since RFC v2: 
- maps used to look up configurations for each package class have been updated to use nested dicts to clarify what each item is.
- DEPLOY_DIR_FEED_<pkg type> definitions now include the ${PN} in the paths instead of relying on adding it in the bbclass.

Regards,
Charlie Johnston