Bug 11692 - Recipe sub-pkg RDEPENDS being installed in image even with sub-pkg is not
Summary: Recipe sub-pkg RDEPENDS being installed in image even with sub-pkg is not
Status: RESOLVED NOTABUG
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.4
Assignee: Mark
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-06-20 18:10 UTC by Mark
Modified: 2017-06-28 02:20 UTC (History)
5 users (show)

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


Attachments
Sample recipe (947 bytes, application/x-bzip)
2017-06-20 18:13 UTC, Mark
no flags Details
updated sample .bb (757 bytes, application/x-bzip)
2017-06-27 20:36 UTC, Mark
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark 2017-06-20 18:10:55 UTC
If I create a recipe which has additional PACKAGES added and distinct RDEPENDS are added to this 'sub' package. Then install only the main pkg (not the sub-pkg) the RDEPENDS will be included in the image despite no actual dependencies.

So for example I can create a simple recipe such as

---meta/recipes-extended/sample/sample_1.0.bb---

LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""

PACKAGES += "${PN}-extra"

S = "${WORKDIR}"

RDEPENDS_${PN}-extra += "findutils"

# No information for SRC_URI yet (only an external source tree was specified)
SRC_URI = "file://sample.txt"

# NOTE: no Makefile found, unable to determine what needs to be done

do_configure () {
        # Specify any needed configure commands here
        :
}

do_compile () {
        # Specify compilation commands here
        :
}

do_install () {
        install -d ${D}/${datadir}/${BPN}
        install ${S}/sample.txt ${D}/${datadir}/${BPN}/.
}
---
[create the needed sample.txt file]

Then setup a bog standard yocto build by sourcing 'oe-init-build-env'. Edit the local.conf to include [CORE_IMAGE_EXTRA_INSTALL += "sample"].

Build and run. You will discover that findutils is installed and available in the rootfs image, since the -extra sub-pkg is not being requested to be included in the image, this is unexpected.

NOTE: this is using dnf, as per the default build setup.
Comment 1 Mark 2017-06-20 18:13:40 UTC
Created attachment 3834 [details]
Sample recipe
Comment 2 Ross Burton 2017-06-22 14:47:39 UTC
Do you have dev-pkgs or dbg-pkgs enabled in the image?
Comment 3 Ross Burton 2017-06-22 14:54:04 UTC
With the sample recipe, PN-extras isn't generated so anything there is a red herring.

My hunch is that you've dev-pkgs IMAGE_FEATURE enabled which means that sample-dev is installed.  As dev packages depend on the -dev form of all build dependencies this means that sample-dev RDEPENDS on findutils-dev, which depends on findutils.

Marking as NEEDINFO, Mark can you verify that this hypothesis is correct or not.
Comment 4 Mark 2017-06-26 18:53:55 UTC
Ross,

'bitbake core-image-minimal -e' where I have CORE_IMAGE_EXTRA_INSTALL += "sample", I see:

IMAGE_FEATURES="debug-tweaks ptest-pkgs"

My sample may not be complete enough but if you do add to it the outcome remains the same. The presence of the sub-pkg RDEPENDS will cause these pkgs to be installed in the image.
Comment 5 Jussi Kukkonen 2017-06-27 16:13:39 UTC
(In reply to comment #4)
> My sample may not be complete enough but if you do add to it the outcome
> remains the same. The presence of the sub-pkg RDEPENDS will cause these pkgs
> to be installed in the image.

There's probably something else still at play here -- adding "sample" to an image just doesn't bring findutils with it here.
Comment 6 Mark 2017-06-27 20:18:58 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > My sample may not be complete enough but if you do add to it the outcome
> > remains the same. The presence of the sub-pkg RDEPENDS will cause these pkgs
> > to be installed in the image.
> 
> There's probably something else still at play here -- adding "sample" to an
> image just doesn't bring findutils with it here.

I am checking the 'sample' recipe again. I might have to abandon it in favour of the real recipe I am seeing this with (openvswitch in meta-virt). Will let you know.
Comment 7 Mark 2017-06-27 20:36:33 UTC
Created attachment 3846 [details]
updated sample .bb
Comment 8 Mark 2017-06-27 20:41:01 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > My sample may not be complete enough but if you do add to it the outcome
> > > remains the same. The presence of the sub-pkg RDEPENDS will cause these pkgs
> > > to be installed in the image.
> > 
> > There's probably something else still at play here -- adding "sample" to an
> > image just doesn't bring findutils with it here.
> 
> I am checking the 'sample' recipe again. I might have to abandon it in
> favour of the real recipe I am seeing this with (openvswitch in meta-virt).
> Will let you know.

OK, attached is the updated sample .bb which matches more closely the recipe I encountered this issue with. Note that I still only have

  CORE_IMAGE_EXTRA_INSTALL += "sample"

yet you can see that findutils is being installed

  Installing       : findutils-4.6.0-r0.i586                               6/17 

I am investigating ptest.bbclass for clues as it seems to be involved, though I thought I had seen this reproduced without ptest.

Mark
Comment 9 Mark 2017-06-27 20:57:17 UTC
Still having trouble making the 'sample' recipe behave in the way I am seeing with the openvswitch recipe. Rather than waste folks time let me do some more investigation and update the case once I can put together a proper reproducer.
Comment 10 Mark 2017-06-28 02:20:27 UTC
I went back and looked at the dependencies closer after failing to make the sample recipe behave the same as the recipe I was seeing the issue, looking more closely at Ross' comment #2. Turns out findutils was being pulled in via the -dev package.