Bug 14720 - PACKAGE_EXCLUDE doesn't work with opkg 0.5
Summary: PACKAGE_EXCLUDE doesn't work with opkg 0.5
Status: RESOLVED NOTABUG
Alias: None
Product: opkg
Classification: Yocto Project Subprojects
Component: opkg (show other bugs)
Version: 0.5
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: next-patch
Assignee: Samuli Piippo
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2022-02-11 15:09 UTC by Samuli Piippo
Modified: 2022-02-25 13:14 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuli Piippo 2022-02-11 15:09:43 UTC
After opkg was upgraded to 0.5.0 (9e2a5d6557ca7d2c3aea39cfe18003e35310db34), PACKAGE_EXCLUDE no longer works.

with configurations:

PACKAGE_CLASSES = "package_ipk"
IMAGE_FEATURES += "dev-pkgs"
PACKAGE_EXCLUDE += "base-files-dev"

core-image-minimal build fails:

ERROR: core-image-minimal-1.0-r0 do_rootfs: Unable to install packages. Command '/home/qt/build-core/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/bin/opkg --volatile-cache -f /home/qt/build-core/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/opkg.conf -t /home/qt/build-core/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/temp/ipktemp/ -o /home/qt/build-core/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/rootfs  --force_postinstall --prefer-arch-to-version  --add-exclude base-files-dev --add-exclude base-files-dev install base-files-dev base-passwd-dev busybox-dev eudev-dev init-ifupdown-dev init-system-helpers-dev initscripts-dev kmod-dev libc6-dev libz-dev modutils-initscripts-dev netbase-dev packagegroup-core-boot-dev run-postinsts-dev sysvinit-dev sysvinit-inittab-dev update-rc.d-dev util-linux-dev v86d-dev' returned 1:
 * Solver encountered 1 problem(s):
 * Problem 1/1:
 *   - package base-files-dev-3.0.14-r89.qemux86_64 can only be installed by a direct request
 *   - conflicting requests
 * 
 * Solution 1:
 *   - install base-files-dev-3.0.14-r89.qemux86_64

 * Solution 2:
 *   - do not ask to install a package providing base-files-dev
Comment 1 Randy MacLeod 2022-02-17 15:34:44 UTC
Regression, can you work on this Alex?
Comment 2 Randy MacLeod 2022-02-17 16:31:19 UTC
Alex, I may have botched the Product, Component, Milestone for this bug.
The intent is that this should be fixed ASAP since M3 is early next week.
Comment 3 Alex Stewart 2022-02-17 16:52:05 UTC
@rmacleod, @spiippo
I would guess that this bug is almost certainly hitting the behavior added in opkg commit 4517d1bc87e9bfc0877d565230a4aeb42c474ba9 [1]. Previously, packages given to opkg via the `--add-exclude` argument were not propagated to libsolv, meaning that you could end up with an invalid set of installed packages in cases where the 'excluded' package conflicts.

So in the BB output capture, libsolv/opkg is saying "you have asked me to install packages, but some of them depend on `base-files-dev` - which you have said is supposed to be 'excluded' from the solution".

My reading of the `PACKAGE_EXCLUDE` BB var [2] suggests that is a correct interpretation of the variable. So I believe that opkg's behavior has changed since 0.4.5, but I'm not convinced that opkg is incorrect here.

Some arguments which would change my mind:

(1) If none of the packages which are being 'installed' have a dependency on `base-files-dev`, then opkg shouldn't be complaining. Is that the case?

(2) If my interpretation of the `PACKAGE_EXCLUDE` BB variable is incongruous with the rest of the community, and everyone else reads it as: "these are files which should be included in the package-solve, but not installed by opkg afterwards." (which could leave opkg in an invalid state; I don't like that.)

Thoughts?

---

[1] https://git.yoctoproject.org/opkg/commit/?id=4517d1bc87e9bfc0877d565230a4aeb42c474ba9
[2] https://docs.yoctoproject.org/current/ref-manual/variables.html?highlight=package_exclude#term-PACKAGE_EXCLUDE
Comment 4 Randy MacLeod 2022-02-17 21:41:25 UTC
Thanks for the explaination Alex.
I don't have time right now to develop an opinion.... Samuli?
Comment 5 Samuli Piippo 2022-02-25 13:14:17 UTC
Looks like this is user error after all.
When using the IMAGE_FEATURES globs, PACKAGE_EXCLUDE_COMPLEMENTARY should be used instead of PACKAGE_EXCLUDE.