Bug 11374

Summary: The "build-deps" QA check mistakenly checks an empty package
Product: [Build System, Metadata & Runtime] BitBake Reporter: Dmitry Rozhkov <dmitry.rojkov>
Component: bitbakeAssignee: Yau Wai Gan <yau.wai.gan>
Status: VERIFIED FIXED QA Contact: Ashwin Soman <ashwinx.soman>
Severity: normal    
Priority: Medium+ CC: ashwinx.soman, ee.peng.yeoh, poky.bs.watcher, poky.watcher, sgw
Version: unspecified   
Target Milestone: 2.4 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Unknown (Hard to categorize)
Verified: Documentation change: No (bug/feature does not impact docs)

Description Dmitry Rozhkov 2017-04-18 12:33:30 UTC
To reproduce the bug

1. put the line

> PACKAGECONFIG_remove_pn-libxml2 = "python"
> PACKAGECONFIG_remove_pn-libxml2-native = "python"

to a distro config;

2. run `bitbake libxml2`

The result is these errors:

WARNING: libxml2-2.9.4-r0 do_fetch: Failed to fetch URL ftp://xmlsoft.org/libxml2/libxml2-2.9.4.tar.gz;name=libtar, attempting MIRRORS if available
ERROR: libxml2-2.9.4-r0 do_package_qa: QA Issue: libxml2-python rdepends on python-core, but it isn't a build dependency, missing python in DEPENDS or PACKAGECONFIG? [build-deps]
ERROR: libxml2-2.9.4-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
ERROR: libxml2-2.9.4-r0 do_package_qa: Function failed: do_package_qa
ERROR: Logfile of failure stored in: /home/rojkov/work/refkit/build/tmp-glibc/work/corei7-64-refkit-linux/libxml2/2.9.4-r0/temp/log.do_package_qa.7742
ERROR: Task (/home/rojkov/work/refkit/openembedded-core/meta/recipes-core/libxml/libxml2_2.9.4.bb:do_package_qa) failed with exit code '1'

Whereas the expcted result should be a successful build because libxml2-python is an empty package in this case.

Also this bug is not reproducible if the package is configured with a .bbappend, that is if

> PACKAGECONFIG_remove = "python"

is put in a distro specific libxml2_%.bbappend.

The problem seems to be in a way how variable values are expanded in the DataSmart class.

In the function package_qa_check_rdepends() of insane.bbclass the variable localdata is a local copy of d. Ater calling localdata.setVar('OVERRIDES', 'libxml2-python') its method getVar() starts to return a whitespace (" ") for localdata.getVar('RDEPENDS') if libxml2-python is made an empty package with PACKAGECONFIG_remove = "python" in a bbappend

But if libxml2-python is made an empty package with PACKAGECONFIG_remove_pn-libxml2 = "python" in a distro config then localdata.getVar('RDEPENDS') returns " python-core" and that breaks the 'build-deps' QA check because it thinks that libxml2-python actually exists even if it's empty.
Comment 1 Yau Wai Gan 2017-06-07 02:20:05 UTC
Fix implemented and merged.

OE-Core rev:60d28dd72daee235150ab6605cbf953f1ea691df
Comment 2 Ashwin Soman 2017-10-11 08:02:56 UTC
Bug is resolved and tested .
Logs before applying patch:
WARNING: libxml2-2.9.4-r0 do_fetch: Failed to fetch URL ftp://xmlsoft.org/libxml2/libxml2-2.9.4.tar.gz;name=libtar, attempting MIRRORS if available
WARNING: libxml2-2.9.4-r0 do_package_qa: QA Issue: libxml2-python rdepends on python3-core, but it isn't a build dependency? [build-deps]
NOTE: Tasks Summary: Attempted 563 tasks of which 0 didn't need to be rerun and all succeeded.

Summary: There was 2 WARNING message shown.
pokyuser@7d7eb8a67e63:/workdir/build$


Logs after applying patch:
pokyuser@7d7eb8a67e63:/workdir/build$ bitbake libxml2
WARNING: libxml2-2.9.4-r0 do_fetch: Failed to fetch URL ftp://xmlsoft.org/libxml2/libxml2-2.9.4.tar.gz;name=libtar, attempting MIRRORS if available
NOTE: Tasks Summary: Attempted 525 tasks of which 0 didn't need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.


Note : In current release the error message is replaced by warning for the same .
Comment 3 Ashwin Soman 2017-11-08 05:43:25 UTC
Bug have been resolved and verified