Bug 14459 - RRECOMMENDS hides unsatisfiable IMAGE_INSTALL
Summary: RRECOMMENDS hides unsatisfiable IMAGE_INSTALL
Status: RESOLVED FIXED
Alias: None
Product: opkg
Classification: Yocto Project Subprojects
Component: opkg (show other bugs)
Version: 0.4.5
Hardware: x86 Multiple
: Undecided major
Target Milestone: 0.6.0
Assignee: Alex Stewart
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2021-06-28 13:04 UTC by Rasmus Villemoes
Modified: 2022-05-27 20:00 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
Reproducing regression test (1.00 KB, text/x-python)
2021-08-05 12:28 UTC, Alex Stewart
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rasmus Villemoes 2021-06-28 13:04:19 UTC
If an image recipe has

IMAGE_INSTALL += "kernel-module-foo"

but the kernel was not built with foo modular, the build fails as expected. However, if at the same time some package that happens to get installed in the same image says

RRECOMMENDS_${PN} += "kernel-module-foo"

the build silently succeeds. With the latter line by itself, this is expected, but the build should fail when the image explicitly declares an item to install which cannot be satisfied, regardless of whether some other random package rrecommends that item.

This only seems to happen with ipk, not rpm. It should be trivial to reproduce.
Comment 1 Alejandro del Castillo 2021-06-28 14:02:53 UTC
Re-assigning to Alex, since he is the maintainer now.
Comment 2 Alex Stewart 2021-07-08 14:47:48 UTC
As I said on the yocto ML, could you identify the calls which OE is making to opkg, and how they change between when RRECOMMENDS is asserted and when it is not.

I think its unlikely that opkg is doing something exotic with the kernel module packages, based on OE state.
Comment 3 Rasmus Villemoes 2021-07-27 08:22:14 UTC
See the ML; it seems that opkg is invoked with kernel-module-foo in the list of packages to install whether or not the RRECOMMENDS is in effect.
Comment 4 Alex Stewart 2021-07-28 20:46:23 UTC
OE-Core ML thread of this discussion, which has more context and OE logs:
https://lists.openembedded.org/g/openembedded-core/topic/83779506

Based on the do_rootfs log, it definitely does seem like opkg is doing something wrongly. I suspect there may be a bug with how we construct the libsolv model, in the special case that: the user is explicitly asking for a package to be installed (eg. `install ... foobar`) AND that same package is a recommends for another package being installed.

Marking as high-sev, since the reproducing case implies that the affected package doesn't get installed, even though the user explicitly requests it.
Comment 5 Alex Stewart 2021-08-05 12:28:26 UTC
Created attachment 4818 [details]
Reproducing regression test

More triage:

Built a regression test (attached), which reproduces the issue.

This issue only affects the libsolv solver. The internal solver correctly identifies and reports that the user has requested to install a nonexistent package, and returns code 255.

The libsolv solver also (correctly) errors when package `a` does not *recommend* `dne`. So that further confirms that we are incorrectly building the libsolv model.

Since solving this issue means changing the return codes of high-level `opkg` operations, it could break users which were depending on the old behavior; I'm targeting it to the `next-minor` rev, for that reason.
Comment 6 Alex Stewart 2022-05-27 20:00:18 UTC
This bug should be resolved by cvadrevu's commit 5d715fc396388f3e321816a2226cdad039a0e16f [1].

[1] https://git.yoctoproject.org/opkg/commit/?id=5d715fc396388f3e321816a2226cdad039a0e16f