Search code examples
yoctobitbake

How can I determine what is causing an unwanted package to be built in Yocto?


I am trying to build an console image for an RPi using the core-image-base recipe, but somewhere in my configuration, I seem to have switched something on that is increasing the number of recipes built by around 1000 which include many things that don't feel like they belong in a console image (libx11, gnome-desktop-testing, etc.)

I am trying to track down why these recipes are being included in my build. My method so far has been to run the following commands:

# Generate a massive dot file with all the dependencies in it
bitbake -g core-image-base

# grep through that file to find out what is bringing in
# gnome-desktop-testing.
cat task-depends.dot | grep -i gnome-desktop-testing | grep -vi do_package_write_rpm

I removed do_package_write_rpm from the matching since everything seems to match against it. This leaves the following:

"core-image-base.do_build" -> "gnome-desktop-testing.do_build"
"core-image-base.do_rootfs" -> "gnome-desktop-testing.do_package_qa"
"core-image-base.do_rootfs" -> "gnome-desktop-testing.do_packagedata"
"core-image-base.do_rootfs" -> "gnome-desktop-testing.do_populate_lic"
"glib-2.0.do_package_qa" -> "gnome-desktop-testing.do_packagedata"
(followed by many dependencies between the tasks of the gnome-desktop-testing recipe)

So, if my interpretation is correct, it seems that core-image-base is depending directly on gnome-desktop-testing. This seems unusual since core-image-base is supposed to be a console only image.

I tried adding PACKAGE_EXCLUDE = "gnome-desktop-testing" to my local.conf hoping that it would give back some more information, but the build just seems to proceed regardless of this variable's setting :/

How can I figure out why gnome-desktop-testing is being built by Yocto? Ideally I would like to have a solution not involving toaster.


Solution

  • I ran into this issue and so I thought I would post the answer.

    First, I removed the recipe, rebuilt and then looked at the first dependency chain.

    NOTE: Runtime target 'shared-mime-info' is unbuildable, removing...
    Missing or unbuildable dependency chain was: ['shared-mime-info', 'glib-2.0', 'gnome-desktop-testing']
    

    Then we look in the recipe to see that glib-ptest has an RDEPENDS on gnome-desktop-testing.

    RDEPENDS_${PN}-ptest += "\
                coreutils \
                libgcc \
                dbus \
                gnome-desktop-testing \
                tzdata \
    

    So then to fix that you will need to disable "ptest". This can be done from the your distro configuration (meta-layer/conf/distro/*.conf).