Skip to contentSkip to conversation

package QA & missing runtime dependency alerting (thud)

DISCUSSION Peter Morrow 2 participants 3 messages Feb 19, 2020

lore
Share & tools
lore
#0 lore raw

Hello,

We occasionally see our build fail due to package QA issues, specifically:

ERROR: gawk-4.2.1-r0 do_package_qa: QA Issue:
/usr/lib/gawk/ptest/test/fcall_exit.awk contained in package gawk-ptest requires /bin/awk, but no providers found in RDEPENDS_gawk-ptest? [file-rdeps],

I'm wondering how yocto has made the decision that "/bin/awk" is a runtime dependency for gawk-ptest (it is, so this is good). Does yocto read /usr/lib/gawk/ptest/test/fcall_exit.awk looking for anything that matches on a shbang then alert us to this as a missing RDEPENDS?

I think this is what is happening but cannot see this in the documentation error. Something to back this hunch up:

http://lists.openembedded.org/pipermail/openembedded-core/2016-November/128419.html

I'm about to send patches upstream to gawk to remove some more shbangs from awk scripts and thus would like to check the yocto behaviour before I do so.

Thanks,
Peter.

#1 lore raw
Quoted 10 lines · Peter Morrow via Lists.Yoctoproject.Org

Hello,

We occasionally see our build fail due to package QA issues, specifically:

ERROR: gawk-4.2.1-r0 do_package_qa: QA Issue:
/usr/lib/gawk/ptest/test/fcall_exit.awk contained in package gawk-ptest requires /bin/awk, but no providers found in RDEPENDS_gawk-ptest? [file-rdeps],

Quoted 4 lines

I'm wondering how yocto has made the decision that "/bin/awk" is a runtime dependency for gawk-ptest (it is, so this is good). Does yocto read /usr/lib/gawk/ptest/test/fcall_exit.awk looking for anything that matches on a shbang then alert us to this as a missing RDEPENDS?

Yes, it does look at the sheabangs of the scripts. Please refer to the manual and the insane.bbclass imeplementation
https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#ref-classes-insane

Quoted 17 lines

I think this is what is happening but cannot see this in the documentation error. Something to back this hunch up:

http://lists.openembedded.org/pipermail/openembedded-core/2016-November/128419.html

I'm about to send patches upstream to gawk to remove some more shbangs from awk scripts and thus would like to check the yocto behaviour before I do so.

Thanks,
Peter.

Signature · 4 lines
Maciej Pijanowski
Embedded Systems Engineer
GPG: 9963C36AAC3B2B46
https://3mdeb.com | @3mdeb_com
#2 lore raw
Quoted 21 lines · Maciej Pijanowski via Lists.Yoctoproject.Org
Quoted 11 lines · Peter Morrow via Lists.Yoctoproject.Org

Hello,

We occasionally see our build fail due to package QA issues, specifically:

ERROR: gawk-4.2.1-r0 do_package_qa: QA Issue:
/usr/lib/gawk/ptest/test/fcall_exit.awk contained in package gawk- ptest
requires /bin/awk, but no providers found in RDEPENDS_gawk-ptest? [file-rdeps],

Quoted 6 lines

I'm wondering how yocto has made the decision that "/bin/awk" is a runtime dependency for gawk-ptest (it is, so this is good). Does yocto read /usr/lib/gawk/ptest/test/fcall_exit.awk looking for anything
that matches on a shbang then alert us to this as a missing RDEPENDS?

Quoted 4 lines

Yes, it does look at the sheabangs of the scripts. Please refer to
the manual
and the insane.bbclass imeplementation
https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#ref-classes-insane

Thanks Maciej,

I'm wondering also about the specific failure I'm seeing here, i.e. gawk-ptest RDEPENDS on /bin/awk. Looking at the recipe for gawk in thud I see:

inherit autotools gettext texinfo update-alternatives

FILES_${PN} += "${datadir}/awk"
FILES_${PN}-dev += "${libdir}/${BPN}/*.la"

ALTERNATIVE_${PN} = "awk"
ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
ALTERNATIVE_PRIORITY = "100"

do_install_append() {

    # remove the link since we don't package it
    rm ${D}${bindir}/awk
}

So awk is an alternative for gawk. In the version of yocto I'm using (thud) the ptest.bbclass does not add a dependency on the package that is being tested (this appears fixed in more recent versions of yocto). Thus I added the dependency on gawk from gawk-ptest in a bbappend file for gawk (to fix other package QA issues):

RDEPENDS_${PN}-ptest += " gawk"

So the question then becomes are alternatives also honoured in the file-rdeps check of the insane bbclass? I.e. if a file-rdeps check finds /bin/awk in a file, since "awk" is not explicitly in the RDEPENDS list (but gawk is) is this flagged as a false positive?

I'd prefer not to add INSANE_SKIP_${PN} = "file-rdeps" for gawk if possible.

Thanks,
Peter.

Quoted 27 lines
Quoted 18 lines

I think this is what is happening but cannot see this in the documentation error. Something to back this hunch up:

http://lists.openembedded.org/pipermail/openembedded-core/2016-November/128419.html

I'm about to send patches upstream to gawk to remove some more shbangs
from awk scripts and thus would like to check the yocto behaviour before I do so.

Thanks,
Peter.

Signature · 5 lines
Maciej Pijanowski
Embedded Systems Engineer
GPG: 9963C36AAC3B2B46
https://3mdeb.com
 | @3mdeb_com