Bug 5531 - QA issue: check whether PACKAGES matches the really generated packages
Summary: QA issue: check whether PACKAGES matches the really generated packages
Status: VERIFIED DUPLICATE of bug 6420
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.6
Hardware: All Multiple
: Medium enhancement
Target Milestone: 1.9 M3
Assignee: Hongxu Jia
QA Contact: Cristina Agurida
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-11-14 08:51 UTC by Robert Yang
Modified: 2015-07-03 11:32 UTC (History)
8 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Yang 2013-11-14 08:51:28 UTC
Need a QA check on whether the PACKAGES matches the really generated binary pakages, see 5529 for an example.
Comment 1 Paul Eggleton 2013-11-14 16:13:18 UTC
So not generating empty packages is a deliberate feature of the system and I'm not sure if we need a global check for that.

However, what I think would be useful is a check to ensure that if there is a dependency (RDEPENDS) on a package and that package is empty and not produced, we error out as soon as possible (probably at the end of do_package of the recipe that should have produced the package). This is something I've been thinking about for a while and some of the changes that Richard has been working on to make dependency information accessible to the metadata may help with this.
Comment 2 Robert Yang 2013-11-15 02:41:19 UTC
(In reply to comment #1)
> So not generating empty packages is a deliberate feature of the system and
> I'm not sure if we need a global check for that.
> 

Hi Paul,

Yes, not generating empty packages by default is a good feature, but we'd better not leave the nonexistence packages in the PACKAGES, this would cause confusion to the user, such a QA check will help us to cleanup the PACKAGES, and it would be helpful for debug (for example "bitbake -e recipe | grep '^PACKAGES=' " will show the packages that we will really get except the PACKAGES_DYNAMIC), and also helpful when the user add a pkg to PACKAGES, but it isn't generated.

> However, what I think would be useful is a check to ensure that if there is
> a dependency (RDEPENDS) on a package and that package is empty and not
> produced, we error out as soon as possible (probably at the end of
> do_package of the recipe that should have produced the package). This is
> something I've been thinking about for a while and some of the changes that
> Richard has been working on to make dependency information accessible to the
> metadata may help with this.

Sounds greate.
Comment 3 Paul Eggleton 2014-06-10 16:50:46 UTC
Just so that it's independent, I've now entered bug 6420 to specifically track detecting missing RDEPENDS.
Comment 4 Hongxu Jia 2014-12-12 01:31:21 UTC
Test Steps:

1. Edit xz and gzip recipe, to simulate a package missing situation (the manually added
rdepends is not real but):
..............
diff --git a/meta/recipes-extended/gzip/gzip.inc b/meta/recipes-extended/gzip/gzip.inc
index 671b1eb..7e643e5 100644
--- a/meta/recipes-extended/gzip/gzip.inc
+++ b/meta/recipes-extended/gzip/gzip.inc
@@ -32,3 +32,8 @@ ALTERNATIVE_LINK_NAME[gzip] = "${base_bindir}/gzip"
 ALTERNATIVE_LINK_NAME[zcat] = "${base_bindir}/zcat"
 
 export CONFIG_SHELL="/bin/sh"
+
+PACKAGES =+ "${PN}-missing1 ${PN}-missing2"
+FILES_${PN}-missing1 = ""
+FILES_${PN}-missing2 = ""
+RPROVIDES_${PN}-missing1 = "${PN}-missing"
diff --git a/meta/recipes-extended/xz/xz_5.1.3alpha.bb b/meta/recipes-extended/xz/xz_5.1.3alpha.bb
index 168e383..c5d8b57 100644
--- a/meta/recipes-extended/xz/xz_5.1.3alpha.bb
+++ b/meta/recipes-extended/xz/xz_5.1.3alpha.bb
@@ -37,6 +37,9 @@ FILES_liblzma-dev = "${includedir}/lzma* ${libdir}/liblzma*${SOLIBSDEV} ${libdir
 FILES_liblzma-staticdev = "${libdir}/liblzma.a"
 FILES_liblzma-dbg = "${libdir}/.debug/liblzma*"
 
+
+RDEPENDS_${PN}_class-target += "gzip-missing gzip-missing2"
+
 BBCLASSEXTEND = "native nativesdk"
 
 export CONFIG_SHELL="/bin/sh"
..............

2. Vim local.conf
...
IMAGE_INSTALL_append = " xz"
WARN_QA_append = " package-missing"
...

3. bitbake core-image-minimal
..............
|WARNING: QA Issue: package gzip-missing1 not generated, but listed in PACKAGES
|Compute rdepends chains, '-->' means 'runtime depends'
|("gzip-missing1" rprovides "gzip-missing")
|"xz" -> "gzip-missing"
| [package-missing]
|WARNING: QA Issue: package gzip-missing2 not generated, but listed in PACKAGES
|Compute rdepends chains, '-->' means 'runtime depends'
|"xz" -> "gzip-missing2"
| [package-missing]
|ERROR: Unable to install packages. Command '/home/jiahongxu/yocto/build-2014120
2-mips/tmp/sysroots/x86_64-linux/usr/bin/smart --quiet --data-dir=/home/jiahongx
u/yocto/build-20141202-mips/tmp/work/qemumips-poky-linux/core-image-minimal/1.0
-r0/rootfs/var/lib/smart install -y xz@mips32r2 run-postinsts@all packagegroup-
core-boot@qemumips' returned 1:
error: Can't install xz-5.1.3alpha-r0@mips32r2: no package provides gzip-missing


|ERROR: Function failed: do_rootfs
|ERROR: Logfile of failure stored in: /home/jiahongxu/yocto/build-20141202-mips/
tmp/work/qemumips-poky-linux/core-image-minimal/1.0-r0/temp/log.do_rootfs.24338
|ERROR: Task 7 (/home/jiahongxu/yocto/poky/meta/recipes-core/images/core-image-
minimal.bb, do_rootfs) failed with exit code '1'
..............

//Hongxu
Comment 5 Hongxu Jia 2015-06-02 02:11:32 UTC
This is rejected by RP:

...
This tells me what the change does. What it doesn't say is why we need
this?

Its a fairly invasive set of changes but I don't see the usecase...

Cheers,

Richard

...

*** This bug has been marked as a duplicate of bug 6420 ***
Comment 6 Cristina Agurida 2015-07-03 11:32:41 UTC
I'm marking this issue as verified duplicated.