Bug 16083 - Improve error message when trying to install a non-generated package
Summary: Improve error message when trying to install a non-generated package
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: oe-core other (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 6.1
Assignee: Sundeep Kokkonda
QA Contact:
URL:
Whiteboard: NEWCOMER
Depends on:
Blocks:
 
Reported: 2025-11-28 08:59 UTC by Yoann Congal
Modified: 2026-08-20 15:30 UTC (History)
4 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 Yoann Congal 2025-11-28 08:59:00 UTC
When trying to install a package that is not generated (e.g. disabled by PACKAGECONFIG) the error message is:
  <package> is neither a recipe nor a generated package.

This could be improved with a message "<recipe> RPROVIDES <package> (but <package> has not been generated)" to help the user find where to fix this.

Code responsible is here: https://git.openembedded.org/openembedded-core/tree/meta/lib/oe/package_manager/__init__.py?id=ac7327583aef83fd400190506f3147623de38b68#n466

This idea comes from https://irc.yoctoproject.org/irc/%23yocto.2025-11-28.log.html#yocto.2025-11-28.log.html#t2025-11-28T01:51:57

Side note: I think this can be NEWCOMER bug.
Comment 1 Randy MacLeod 2025-12-11 15:34:54 UTC
 Swaminathan . Let us know if you have any questions.
Comment 2 Swaminathan K 2025-12-15 06:26:08 UTC
I will study the code and get back with my understanding of the required changes.
Comment 3 Swaminathan K 2025-12-23 15:51:29 UTC
I guess adding a  new line next to the existing line like this would suffice ? 

       reason = "%s is neither a recipe nor a generated package.\n" % pkg
       reason += ("It might be declared in RPROVIDES but was not generated, "
                       "or the recipe is not included in this build.\n")

I tried to find out if I could some more helpful information.  I am not sure how/if I could do that . Any pointers would help
Comment 4 Randy MacLeod 2026-01-14 17:16:16 UTC
Your change would help but I think Yoann's idea was to give the user
package-specific guidance.

I suggest that you either:
1. check that the recipe name is valid and then check if there are any packages that it *could* RPROVIDE.
2. look at the code that tries to help users who made a typo and use that to learn about pattern matching:
Eg.
❯ bitbake -g coreutilslslsls
...
Loaded 2049 entries from dependency cache.
ERROR: Nothing PROVIDES 'coreutilslslsls'. Close matches:
  coreutils

...

Also, 
You can look through the oe-core layer for examples:

❯ rg getVar.*PACKAGECONFIG  | wc -l
24

One example usage is:
❯ ../../oe-core.git/scripts/contrib/list-packageconfig-flags.py -p
... (takes a while) ...
Gathering recipe data...
RECIPE NAME                      PACKAGECONFIG FLAGS
====================================================
alsa-plugins                     aaf jack libav maemo-plugin maemo-resource-manager pulseaudio samplerate speexdsp
alsa-tools                       as10k1 echomixer envy24control hda-verb hdajackretask hdajacksensetest ...
alsa-utils                       bat manpages udev
...


To get more feedback, 
do something more than what you have so far but not so much that you spend days on the bug and then send a patch for review.

Does that help ?
Comment 5 Swaminathan K 2026-01-18 09:34:03 UTC
thanks a lot for your suggestions. I will study and get back
Comment 6 Randy MacLeod 2026-06-04 15:29:37 UTC
Move back to newcomer since Swaminathan seems to have drop off.
Take back as needed.
Comment 7 Mathieu Dubois-Briand 2026-08-20 12:45:25 UTC
This patch got merged: https://git.openembedded.org/openembedded-core/commit/?id=46ff3a8d2c18fcba87c711bb23dbdabae20eef84

Yoann, can we close the bug?
Comment 8 Randy MacLeod 2026-08-20 15:30:00 UTC
Paul Barker reviewed and agreed that we should close the defect as fixed.
Thanks.