diff mbox series

[meta-filesystems] e2tools: Add ptest

Message ID 20240222134140.2367805-1-William.Lyu@windriver.com
State Accepted
Headers show
Series [meta-filesystems] e2tools: Add ptest | expand

Commit Message

Lyu, William Feb. 22, 2024, 1:41 p.m. UTC
From: William Lyu <William.Lyu@windriver.com>

Signed-off-by: William Lyu <William.Lyu@windriver.com>
---
 .../recipes-utils/e2tools/e2tools_git.bb      | 51 ++++++++++++++++++-
 .../recipes-utils/e2tools/files/run-ptest     |  5 ++
 2 files changed, 54 insertions(+), 2 deletions(-)
 create mode 100644 meta-filesystems/recipes-utils/e2tools/files/run-ptest

Comments

Khem Raj Feb. 28, 2024, 4:05 p.m. UTC | #1
I am running into this error on some builders on AB

stdio: ERROR: Task
(/home/pokybuild/yocto-worker/meta-oe/build/meta/recipes-support/libexif/libexif_0.6.24.bb:do_package_qa)
failed with exit code '1'
stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: QA Issue:
/usr/lib/e2tools/ptest/git/.git/hooks/update.sample contained in
package e2tools-ptest requires /usr/bin/sh, but no providers found in
RDEPENDS:e2tools-ptest? [file-rdeps]
stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: Fatal QA errors were
found, failing task.
stdio: ERROR: Logfile of failure stored in:
/home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/e2tools/0.1.0+git/temp/log.do_package_qa.3114961

On Thu, Feb 22, 2024 at 5:56 AM Lyu, William via
lists.openembedded.org
<william.lyu=windriver.com@lists.openembedded.org> wrote:
>
> From: William Lyu <William.Lyu@windriver.com>
>
> Signed-off-by: William Lyu <William.Lyu@windriver.com>
> ---
>  .../recipes-utils/e2tools/e2tools_git.bb      | 51 ++++++++++++++++++-
>  .../recipes-utils/e2tools/files/run-ptest     |  5 ++
>  2 files changed, 54 insertions(+), 2 deletions(-)
>  create mode 100644 meta-filesystems/recipes-utils/e2tools/files/run-ptest
>
> diff --git a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> index caf0025c8..a80b6f598 100644
> --- a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> +++ b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> @@ -9,17 +9,64 @@ SECTION = "base"
>  LICENSE = "GPL-2.0-only"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
>
> -DEPENDS += "e2fsprogs"
> +DEPENDS += "coreutils e2fsprogs"
>
>  PV = "0.1.0+git"
>
>  SRC_URI = " \
>             git://github.com/e2tools/e2tools;protocol=https;branch=master \
> +           file://run-ptest \
>  "
> +
>  SRCREV = "fd092754a6b65c3a769f74f888668c066f09c36d"
>
>  S = "${WORKDIR}/git"
>
> -inherit autotools pkgconfig
> +inherit autotools pkgconfig ptest
> +
> +do_configure:prepend() {
> +    git -C "${WORKDIR}/git" reset --hard HEAD
> +
> +    # To install ptest for this package, special configuration needs to be
> +    # done before do_configure(). So, do_configure_ptest() which is scheduled
> +    # after do_configure() cannot be used.
> +
> +    # We only do special configuration if we are installing ptest for this
> +    # package.
> +    if [ "${@d.getVar('PTEST_ENABLED')}" -eq "1" ]; then
> +        # Since we guarantee run-time dependency when installing the ptest for
> +        # this package, we do not need the check macros under section "checks
> +        # for programs" in "configure.ac". Plus, these check macros set the
> +        # ouput variables to incorrect values as these checks are performed on
> +        # the host environment. Still, we need these variables outputted from
> +        # these check macros. So, we insert the following lines to manually
> +        # set these output variables to the correct value in "configure.ac".
> +
> +        # Note that HAVE_DD_COMMAND and HAVE_MKE2FS_COMMAND are only ever used
> +        # in tests/Makefile-files which determines whether to include the test
> +        # cases. As for output variables CHMOD, DD, and MKE2FS, they only
> +        # point to the programs which test cases need to run. Since these
> +        # commands are guaranteed to be present due to RDEPENDS and are
> +        # guaranteed to be accessible under PATH environment variable on the
> +        # target, we only need to specify the name of these programs.
> +
> +        perl -i -0777 -pe 's/(^dnl\s*=+\s*^dnl\s*Checks for compiler flags\s*^dnl\s*=+)/
> +AC_SUBST([CHMOD], 'chmod')
> +AC_SUBST([DD], 'dd')
> +AC_SUBST([MKE2FS], 'mke2fs')
> +AM_CONDITIONAL([HAVE_DD_COMMAND], [true])
> +AM_CONDITIONAL([HAVE_MKE2FS_COMMAND], [true])
> +\1/ms' "${WORKDIR}/git/configure.ac"
> +    fi
> +}
> +
> +do_install_ptest() {
> +    rm -rf "${D}${PTEST_PATH}/*"
> +    cp -r ../build "${D}${PTEST_PATH}"
> +    cp -r "${S}/build-aux" "${D}${PTEST_PATH}/build"
> +    cp -r "${S}" "${D}${PTEST_PATH}"
> +}
> +
> +RDEPENDS:${PN}-ptest += "bash coreutils e2fsprogs e2tools gawk make perl"
>
>  BBCLASSEXTEND = "native"
> diff --git a/meta-filesystems/recipes-utils/e2tools/files/run-ptest b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
> new file mode 100644
> index 000000000..3d4dd9cf3
> --- /dev/null
> +++ b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
> @@ -0,0 +1,5 @@
> +#!/bin/sh
> +
> +set -e
> +
> +make -C build check
> --
> 2.43.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#108987): https://lists.openembedded.org/g/openembedded-devel/message/108987
> Mute This Topic: https://lists.openembedded.org/mt/104508347/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Lyu, William March 1, 2024, 8:20 p.m. UTC | #2
> I am running into this error on some builders on AB
>
> stdio: ERROR: Task
> (/home/pokybuild/yocto-worker/meta-oe/build/meta/recipes-support/libexif/libexif_0.6.24.bb:do_package_qa)
> failed with exit code '1'
> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: QA Issue:
> /usr/lib/e2tools/ptest/git/.git/hooks/update.sample contained in
> package e2tools-ptest requires /usr/bin/sh, but no providers found in
> RDEPENDS:e2tools-ptest? [file-rdeps]

File "update.sample" is from ".git" directory. I do not actually need this
file or anything from ".git" directory. I only need the source tree for ptest
to run.

However, I am a bit confused about this QA issue because:
-   I do not see any file that has "#!/usr/bin/sh". Even "update.sample" has
    "#!/bin/sh" as the first line. There are files in the source tree (not
    under ".git" directory) that have "#!/bin/sh" as the first line.
-   "/bin/sh" is referring to the default POSIX shell, and the "bash" in the
    RDEPENDS:e2tools-ptest should already fulfill this runtime dependency,
-   I am not yet able to reproduce this issue using poky. I assume this is
    because the QA Issue checker "file-rdeps" in poky do not check "sh" by
    default (excerpt taken from "meta/classes-global/insane.bbclass"):

    if "file-rdeps" not in skip:
        ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env', 'rtld(GNU_HASH)'])
        if bb.utils.contains('DISTRO_FEATURES', 'usrmerge', True, False, d):
            ignored_file_rdeps |= set(['/usr/bin/sh'])
        if bb.data.inherits_class('nativesdk', d):
            ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl', 'perl'])
            if bb.utils.contains('DISTRO_FEATURES', 'usrmerge', True, False, d):
                ignored_file_rdeps |= set(['/usr/bin/bash'])

William

> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: Fatal QA errors were
> found, failing task.
> stdio: ERROR: Logfile of failure stored in:
> /home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/e2tools/0.1.0+git/temp/log.do_package_qa.3114961
>
> On Thu, Feb 22, 2024 at 5:56 AM Lyu, William via
> lists.openembedded.org
> <william.lyu=windriver.com@lists.openembedded.org> wrote:
>>
>> From: William Lyu <William.Lyu@windriver.com>
>>
>> Signed-off-by: William Lyu <William.Lyu@windriver.com>
>> ---
>>  .../recipes-utils/e2tools/e2tools_git.bb      | 51 ++++++++++++++++++-
>>  .../recipes-utils/e2tools/files/run-ptest     |  5 ++
>>  2 files changed, 54 insertions(+), 2 deletions(-)
>>  create mode 100644 meta-filesystems/recipes-utils/e2tools/files/run-ptest
>>
>> diff --git a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>> index caf0025c8..a80b6f598 100644
>> --- a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>> +++ b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>> @@ -9,17 +9,64 @@ SECTION = "base"
>>  LICENSE = "GPL-2.0-only"
>>  LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
>>
>> -DEPENDS += "e2fsprogs"
>> +DEPENDS += "coreutils e2fsprogs"
>>
>>  PV = "0.1.0+git"
>>
>>  SRC_URI = " \
>>             git://github.com/e2tools/e2tools;protocol=https;branch=master \
>> +           file://run-ptest \
>>  "
>> +
>>  SRCREV = "fd092754a6b65c3a769f74f888668c066f09c36d"
>>
>>  S = "${WORKDIR}/git"
>>
>> -inherit autotools pkgconfig
>> +inherit autotools pkgconfig ptest
>> +
>> +do_configure:prepend() {
>> +    git -C "${WORKDIR}/git" reset --hard HEAD
>> +
>> +    # To install ptest for this package, special configuration needs to be
>> +    # done before do_configure(). So, do_configure_ptest() which is scheduled
>> +    # after do_configure() cannot be used.
>> +
>> +    # We only do special configuration if we are installing ptest for this
>> +    # package.
>> +    if [ "${@d.getVar('PTEST_ENABLED')}" -eq "1" ]; then
>> +        # Since we guarantee run-time dependency when installing the ptest for
>> +        # this package, we do not need the check macros under section "checks
>> +        # for programs" in "configure.ac". Plus, these check macros set the
>> +        # ouput variables to incorrect values as these checks are performed on
>> +        # the host environment. Still, we need these variables outputted from
>> +        # these check macros. So, we insert the following lines to manually
>> +        # set these output variables to the correct value in "configure.ac".
>> +
>> +        # Note that HAVE_DD_COMMAND and HAVE_MKE2FS_COMMAND are only ever used
>> +        # in tests/Makefile-files which determines whether to include the test
>> +        # cases. As for output variables CHMOD, DD, and MKE2FS, they only
>> +        # point to the programs which test cases need to run. Since these
>> +        # commands are guaranteed to be present due to RDEPENDS and are
>> +        # guaranteed to be accessible under PATH environment variable on the
>> +        # target, we only need to specify the name of these programs.
>> +
>> +        perl -i -0777 -pe 's/(^dnl\s*=+\s*^dnl\s*Checks for compiler flags\s*^dnl\s*=+)/
>> +AC_SUBST([CHMOD], 'chmod')
>> +AC_SUBST([DD], 'dd')
>> +AC_SUBST([MKE2FS], 'mke2fs')
>> +AM_CONDITIONAL([HAVE_DD_COMMAND], [true])
>> +AM_CONDITIONAL([HAVE_MKE2FS_COMMAND], [true])
>> +\1/ms' "${WORKDIR}/git/configure.ac"
>> +    fi
>> +}
>> +
>> +do_install_ptest() {
>> +    rm -rf "${D}${PTEST_PATH}/*"
>> +    cp -r ../build "${D}${PTEST_PATH}"
>> +    cp -r "${S}/build-aux" "${D}${PTEST_PATH}/build"
>> +    cp -r "${S}" "${D}${PTEST_PATH}"
>> +}
>> +
>> +RDEPENDS:${PN}-ptest += "bash coreutils e2fsprogs e2tools gawk make perl"
>>
>>  BBCLASSEXTEND = "native"
>> diff --git a/meta-filesystems/recipes-utils/e2tools/files/run-ptest b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>> new file mode 100644
>> index 000000000..3d4dd9cf3
>> --- /dev/null
>> +++ b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>> @@ -0,0 +1,5 @@
>> +#!/bin/sh
>> +
>> +set -e
>> +
>> +make -C build check
>> --
>> 2.43.0
>>
>>
>>
Khem Raj March 1, 2024, 9:52 p.m. UTC | #3
On Fri, Mar 1, 2024 at 12:20 PM Lyu, William <William.Lyu@windriver.com> wrote:
>
> > I am running into this error on some builders on AB
> >
> > stdio: ERROR: Task
> > (/home/pokybuild/yocto-worker/meta-oe/build/meta/recipes-support/libexif/libexif_0.6.24.bb:do_package_qa)
> > failed with exit code '1'
> > stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: QA Issue:
> > /usr/lib/e2tools/ptest/git/.git/hooks/update.sample contained in
> > package e2tools-ptest requires /usr/bin/sh, but no providers found in
> > RDEPENDS:e2tools-ptest? [file-rdeps]
>
> File "update.sample" is from ".git" directory. I do not actually need this
> file or anything from ".git" directory. I only need the source tree for ptest
> to run.
>
> However, I am a bit confused about this QA issue because:
> -   I do not see any file that has "#!/usr/bin/sh". Even "update.sample" has
>     "#!/bin/sh" as the first line. There are files in the source tree (not
>     under ".git" directory) that have "#!/bin/sh" as the first line.
> -   "/bin/sh" is referring to the default POSIX shell, and the "bash" in the
>     RDEPENDS:e2tools-ptest should already fulfill this runtime dependency,
> -   I am not yet able to reproduce this issue using poky. I assume this is
>     because the QA Issue checker "file-rdeps" in poky do not check "sh" by
>     default (excerpt taken from "meta/classes-global/insane.bbclass"):
>
>     if "file-rdeps" not in skip:
>         ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env', 'rtld(GNU_HASH)'])
>         if bb.utils.contains('DISTRO_FEATURES', 'usrmerge', True, False, d):
>             ignored_file_rdeps |= set(['/usr/bin/sh'])
>         if bb.data.inherits_class('nativesdk', d):
>             ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl', 'perl'])
>             if bb.utils.contains('DISTRO_FEATURES', 'usrmerge', True, False, d):
>                 ignored_file_rdeps |= set(['/usr/bin/bash'])
>
> William

what distro features do you have enabled ? perhaps try it with and
without usermerge in DISTRO_FEATURES
and rebuild this package after doing cleansstate to ensure its being
rebuilt in both cases.

>
> > stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: Fatal QA errors were
> > found, failing task.
> > stdio: ERROR: Logfile of failure stored in:
> > /home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/e2tools/0.1.0+git/temp/log.do_package_qa.3114961
> >
> > On Thu, Feb 22, 2024 at 5:56 AM Lyu, William via
> > lists.openembedded.org
> > <william.lyu=windriver.com@lists.openembedded.org> wrote:
> >>
> >> From: William Lyu <William.Lyu@windriver.com>
> >>
> >> Signed-off-by: William Lyu <William.Lyu@windriver.com>
> >> ---
> >>  .../recipes-utils/e2tools/e2tools_git.bb      | 51 ++++++++++++++++++-
> >>  .../recipes-utils/e2tools/files/run-ptest     |  5 ++
> >>  2 files changed, 54 insertions(+), 2 deletions(-)
> >>  create mode 100644 meta-filesystems/recipes-utils/e2tools/files/run-ptest
> >>
> >> diff --git a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> >> index caf0025c8..a80b6f598 100644
> >> --- a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> >> +++ b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> >> @@ -9,17 +9,64 @@ SECTION = "base"
> >>  LICENSE = "GPL-2.0-only"
> >>  LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
> >>
> >> -DEPENDS += "e2fsprogs"
> >> +DEPENDS += "coreutils e2fsprogs"
> >>
> >>  PV = "0.1.0+git"
> >>
> >>  SRC_URI = " \
> >>             git://github.com/e2tools/e2tools;protocol=https;branch=master \
> >> +           file://run-ptest \
> >>  "
> >> +
> >>  SRCREV = "fd092754a6b65c3a769f74f888668c066f09c36d"
> >>
> >>  S = "${WORKDIR}/git"
> >>
> >> -inherit autotools pkgconfig
> >> +inherit autotools pkgconfig ptest
> >> +
> >> +do_configure:prepend() {
> >> +    git -C "${WORKDIR}/git" reset --hard HEAD
> >> +
> >> +    # To install ptest for this package, special configuration needs to be
> >> +    # done before do_configure(). So, do_configure_ptest() which is scheduled
> >> +    # after do_configure() cannot be used.
> >> +
> >> +    # We only do special configuration if we are installing ptest for this
> >> +    # package.
> >> +    if [ "${@d.getVar('PTEST_ENABLED')}" -eq "1" ]; then
> >> +        # Since we guarantee run-time dependency when installing the ptest for
> >> +        # this package, we do not need the check macros under section "checks
> >> +        # for programs" in "configure.ac". Plus, these check macros set the
> >> +        # ouput variables to incorrect values as these checks are performed on
> >> +        # the host environment. Still, we need these variables outputted from
> >> +        # these check macros. So, we insert the following lines to manually
> >> +        # set these output variables to the correct value in "configure.ac".
> >> +
> >> +        # Note that HAVE_DD_COMMAND and HAVE_MKE2FS_COMMAND are only ever used
> >> +        # in tests/Makefile-files which determines whether to include the test
> >> +        # cases. As for output variables CHMOD, DD, and MKE2FS, they only
> >> +        # point to the programs which test cases need to run. Since these
> >> +        # commands are guaranteed to be present due to RDEPENDS and are
> >> +        # guaranteed to be accessible under PATH environment variable on the
> >> +        # target, we only need to specify the name of these programs.
> >> +
> >> +        perl -i -0777 -pe 's/(^dnl\s*=+\s*^dnl\s*Checks for compiler flags\s*^dnl\s*=+)/
> >> +AC_SUBST([CHMOD], 'chmod')
> >> +AC_SUBST([DD], 'dd')
> >> +AC_SUBST([MKE2FS], 'mke2fs')
> >> +AM_CONDITIONAL([HAVE_DD_COMMAND], [true])
> >> +AM_CONDITIONAL([HAVE_MKE2FS_COMMAND], [true])
> >> +\1/ms' "${WORKDIR}/git/configure.ac"
> >> +    fi
> >> +}
> >> +
> >> +do_install_ptest() {
> >> +    rm -rf "${D}${PTEST_PATH}/*"
> >> +    cp -r ../build "${D}${PTEST_PATH}"
> >> +    cp -r "${S}/build-aux" "${D}${PTEST_PATH}/build"
> >> +    cp -r "${S}" "${D}${PTEST_PATH}"
> >> +}
> >> +
> >> +RDEPENDS:${PN}-ptest += "bash coreutils e2fsprogs e2tools gawk make perl"
> >>
> >>  BBCLASSEXTEND = "native"
> >> diff --git a/meta-filesystems/recipes-utils/e2tools/files/run-ptest b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
> >> new file mode 100644
> >> index 000000000..3d4dd9cf3
> >> --- /dev/null
> >> +++ b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
> >> @@ -0,0 +1,5 @@
> >> +#!/bin/sh
> >> +
> >> +set -e
> >> +
> >> +make -C build check
> >> --
> >> 2.43.0
> >>
> >>
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >> Links: You receive all messages sent to this group.
> >> View/Reply Online (#108987): https://lists.openembedded.org/g/openembedded-devel/message/108987
> >> Mute This Topic: https://lists.openembedded.org/mt/104508347/1997914
> >> Group Owner: openembedded-devel+owner@lists.openembedded.org
> >> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> >> -=-=-=-=-=-=-=-=-=-=-=-
Lyu, William March 4, 2024, 5:41 a.m. UTC | #4
On 3/1/2024 4:52 PM, Khem Raj wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> On Fri, Mar 1, 2024 at 12:20 PM Lyu, William <William.Lyu@windriver.com> wrote:
>>
>>> I am running into this error on some builders on AB
>>>
>>> stdio: ERROR: Task
>>> (/home/pokybuild/yocto-worker/meta-oe/build/meta/recipes-support/libexif/libexif_0.6.24.bb:do_package_qa)
>>> failed with exit code '1'
>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: QA Issue:
>>> /usr/lib/e2tools/ptest/git/.git/hooks/update.sample contained in
>>> package e2tools-ptest requires /usr/bin/sh, but no providers found in
>>> RDEPENDS:e2tools-ptest? [file-rdeps]
>>
>> File "update.sample" is from ".git" directory. I do not actually need this
>> file or anything from ".git" directory. I only need the source tree for ptest
>> to run.
>>
>> However, I am a bit confused about this QA issue because:
>> -   I do not see any file that has "#!/usr/bin/sh". Even "update.sample" has
>>      "#!/bin/sh" as the first line. There are files in the source tree (not
>>      under ".git" directory) that have "#!/bin/sh" as the first line.
>> -   "/bin/sh" is referring to the default POSIX shell, and the "bash" in the
>>      RDEPENDS:e2tools-ptest should already fulfill this runtime dependency,
>> -   I am not yet able to reproduce this issue using poky. I assume this is
>>      because the QA Issue checker "file-rdeps" in poky do not check "sh" by
>>      default (excerpt taken from "meta/classes-global/insane.bbclass"):
>>
>>      if "file-rdeps" not in skip:
>>          ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env', 'rtld(GNU_HASH)'])
>>          if bb.utils.contains('DISTRO_FEATURES', 'usrmerge', True, False, d):
>>              ignored_file_rdeps |= set(['/usr/bin/sh'])
>>          if bb.data.inherits_class('nativesdk', d):
>>              ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl', 'perl'])
>>              if bb.utils.contains('DISTRO_FEATURES', 'usrmerge', True, False, d):
>>                  ignored_file_rdeps |= set(['/usr/bin/bash'])
>>
>> William
> 
> what distro features do you have enabled ? perhaps try it with and
> without usermerge in DISTRO_FEATURES
> and rebuild this package after doing cleansstate to ensure its being
> rebuilt in both cases.

I have not been able to reproduce this "QA Issue" error yet. Is it 
possible that the [file-rdeps] checker on the autobuilder (AB) where you 
saw this issue is defined differently than the default poky? The 
following are the details regarding my previous and new builds.

For my previous builds, there are no specified DISTRO_FEATURES. In 
conf/local.conf, I only added the following line. The build command I 
used was "bitbake core-image-minimal".

IMAGE_INSTALL:append = " libexif e2tools e2tools-ptest"

I tried a new build with the following line added to conf/local.conf.

DISTRO_FEATURES:append = " usermerge"

I also did "bitbake -c cleansstate e2tools" and "bitbake -c cleansstate 
core-image-minimal" before each build.

William

> 
>>
>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: Fatal QA errors were
>>> found, failing task.
>>> stdio: ERROR: Logfile of failure stored in:
>>> /home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/e2tools/0.1.0+git/temp/log.do_package_qa.3114961
>>>
>>> On Thu, Feb 22, 2024 at 5:56 AM Lyu, William via
>>> lists.openembedded.org
>>> <william.lyu=windriver.com@lists.openembedded.org> wrote:
>>>>
>>>> From: William Lyu <William.Lyu@windriver.com>
>>>>
>>>> Signed-off-by: William Lyu <William.Lyu@windriver.com>
>>>> ---
>>>>   .../recipes-utils/e2tools/e2tools_git.bb      | 51 ++++++++++++++++++-
>>>>   .../recipes-utils/e2tools/files/run-ptest     |  5 ++
>>>>   2 files changed, 54 insertions(+), 2 deletions(-)
>>>>   create mode 100644 meta-filesystems/recipes-utils/e2tools/files/run-ptest
>>>>
>>>> diff --git a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>>>> index caf0025c8..a80b6f598 100644
>>>> --- a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>>>> +++ b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>>>> @@ -9,17 +9,64 @@ SECTION = "base"
>>>>   LICENSE = "GPL-2.0-only"
>>>>   LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
>>>>
>>>> -DEPENDS += "e2fsprogs"
>>>> +DEPENDS += "coreutils e2fsprogs"
>>>>
>>>>   PV = "0.1.0+git"
>>>>
>>>>   SRC_URI = " \
>>>>              git://github.com/e2tools/e2tools;protocol=https;branch=master \
>>>> +           file://run-ptest \
>>>>   "
>>>> +
>>>>   SRCREV = "fd092754a6b65c3a769f74f888668c066f09c36d"
>>>>
>>>>   S = "${WORKDIR}/git"
>>>>
>>>> -inherit autotools pkgconfig
>>>> +inherit autotools pkgconfig ptest
>>>> +
>>>> +do_configure:prepend() {
>>>> +    git -C "${WORKDIR}/git" reset --hard HEAD
>>>> +
>>>> +    # To install ptest for this package, special configuration needs to be
>>>> +    # done before do_configure(). So, do_configure_ptest() which is scheduled
>>>> +    # after do_configure() cannot be used.
>>>> +
>>>> +    # We only do special configuration if we are installing ptest for this
>>>> +    # package.
>>>> +    if [ "${@d.getVar('PTEST_ENABLED')}" -eq "1" ]; then
>>>> +        # Since we guarantee run-time dependency when installing the ptest for
>>>> +        # this package, we do not need the check macros under section "checks
>>>> +        # for programs" in "configure.ac". Plus, these check macros set the
>>>> +        # ouput variables to incorrect values as these checks are performed on
>>>> +        # the host environment. Still, we need these variables outputted from
>>>> +        # these check macros. So, we insert the following lines to manually
>>>> +        # set these output variables to the correct value in "configure.ac".
>>>> +
>>>> +        # Note that HAVE_DD_COMMAND and HAVE_MKE2FS_COMMAND are only ever used
>>>> +        # in tests/Makefile-files which determines whether to include the test
>>>> +        # cases. As for output variables CHMOD, DD, and MKE2FS, they only
>>>> +        # point to the programs which test cases need to run. Since these
>>>> +        # commands are guaranteed to be present due to RDEPENDS and are
>>>> +        # guaranteed to be accessible under PATH environment variable on the
>>>> +        # target, we only need to specify the name of these programs.
>>>> +
>>>> +        perl -i -0777 -pe 's/(^dnl\s*=+\s*^dnl\s*Checks for compiler flags\s*^dnl\s*=+)/
>>>> +AC_SUBST([CHMOD], 'chmod')
>>>> +AC_SUBST([DD], 'dd')
>>>> +AC_SUBST([MKE2FS], 'mke2fs')
>>>> +AM_CONDITIONAL([HAVE_DD_COMMAND], [true])
>>>> +AM_CONDITIONAL([HAVE_MKE2FS_COMMAND], [true])
>>>> +\1/ms' "${WORKDIR}/git/configure.ac"
>>>> +    fi
>>>> +}
>>>> +
>>>> +do_install_ptest() {
>>>> +    rm -rf "${D}${PTEST_PATH}/*"
>>>> +    cp -r ../build "${D}${PTEST_PATH}"
>>>> +    cp -r "${S}/build-aux" "${D}${PTEST_PATH}/build"
>>>> +    cp -r "${S}" "${D}${PTEST_PATH}"
>>>> +}
>>>> +
>>>> +RDEPENDS:${PN}-ptest += "bash coreutils e2fsprogs e2tools gawk make perl"
>>>>
>>>>   BBCLASSEXTEND = "native"
>>>> diff --git a/meta-filesystems/recipes-utils/e2tools/files/run-ptest b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>>>> new file mode 100644
>>>> index 000000000..3d4dd9cf3
>>>> --- /dev/null
>>>> +++ b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>>>> @@ -0,0 +1,5 @@
>>>> +#!/bin/sh
>>>> +
>>>> +set -e
>>>> +
>>>> +make -C build check
>>>> --
>>>> 2.43.0
>>>>
>>>>
>>>>
Lyu, William March 4, 2024, 6:01 a.m. UTC | #5
On 3/4/2024 12:41 AM, Lyu, William wrote:
> On 3/1/2024 4:52 PM, Khem Raj wrote:
>> CAUTION: This email comes from a non Wind River email account!
>> Do not click links or open attachments unless you recognize the sender 
>> and know the content is safe.
>>
>> On Fri, Mar 1, 2024 at 12:20 PM Lyu, William 
>> <William.Lyu@windriver.com> wrote:
>>>
>>>> I am running into this error on some builders on AB
>>>>
>>>> stdio: ERROR: Task
>>>> (/home/pokybuild/yocto-worker/meta-oe/build/meta/recipes-support/libexif/libexif_0.6.24.bb:do_package_qa)
>>>> failed with exit code '1'
>>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: QA Issue:
>>>> /usr/lib/e2tools/ptest/git/.git/hooks/update.sample contained in
>>>> package e2tools-ptest requires /usr/bin/sh, but no providers found in
>>>> RDEPENDS:e2tools-ptest? [file-rdeps]
>>>
>>> File "update.sample" is from ".git" directory. I do not actually need 
>>> this
>>> file or anything from ".git" directory. I only need the source tree 
>>> for ptest
>>> to run.
>>>
>>> However, I am a bit confused about this QA issue because:
>>> -   I do not see any file that has "#!/usr/bin/sh". Even 
>>> "update.sample" has
>>>      "#!/bin/sh" as the first line. There are files in the source 
>>> tree (not
>>>      under ".git" directory) that have "#!/bin/sh" as the first line.
>>> -   "/bin/sh" is referring to the default POSIX shell, and the "bash" 
>>> in the
>>>      RDEPENDS:e2tools-ptest should already fulfill this runtime 
>>> dependency,
>>> -   I am not yet able to reproduce this issue using poky. I assume 
>>> this is
>>>      because the QA Issue checker "file-rdeps" in poky do not check 
>>> "sh" by
>>>      default (excerpt taken from "meta/classes-global/insane.bbclass"):
>>>
>>>      if "file-rdeps" not in skip:
>>>          ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env', 
>>> 'rtld(GNU_HASH)'])
>>>          if bb.utils.contains('DISTRO_FEATURES', 'usrmerge', True, 
>>> False, d):
>>>              ignored_file_rdeps |= set(['/usr/bin/sh'])
>>>          if bb.data.inherits_class('nativesdk', d):
>>>              ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl', 
>>> 'perl'])
>>>              if bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 
>>> True, False, d):
>>>                  ignored_file_rdeps |= set(['/usr/bin/bash'])
>>>
>>> William
>>
>> what distro features do you have enabled ? perhaps try it with and
>> without usermerge in DISTRO_FEATURES
>> and rebuild this package after doing cleansstate to ensure its being
>> rebuilt in both cases.
> 
> I have not been able to reproduce this "QA Issue" error yet. Is it 
> possible that the [file-rdeps] checker on the autobuilder (AB) where you 
> saw this issue is defined differently than the default poky? The 
> following are the details regarding my previous and new builds.
> 
> For my previous builds, there are no specified DISTRO_FEATURES. In 
> conf/local.conf, I only added the following line. The build command I 
> used was "bitbake core-image-minimal".
> 
> IMAGE_INSTALL:append = " libexif e2tools e2tools-ptest"
> 
> I tried a new build with the following line added to conf/local.conf.
> 
> DISTRO_FEATURES:append = " usermerge"
> 
> I also did "bitbake -c cleansstate e2tools" and "bitbake -c cleansstate 
> core-image-minimal" before each build.
> 
> William

Just in case the [file-rdeps] checker is somehow not working, I removed 
"bash" from "RDEPENDS:${PN}-ptest". I indeed get the following error 
message as expected when building "bitbake core-image-minimal":

ERROR: QA Issue: /usr/lib/e2tools/ptest/build/config.status contained in 
package e2tools-ptest requires /bin/bash, but no providers found in 
RDEPENDS:e2tools-ptest? [file-rdeps]

William

> 
>>
>>>
>>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: Fatal QA errors were
>>>> found, failing task.
>>>> stdio: ERROR: Logfile of failure stored in:
>>>> /home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/e2tools/0.1.0+git/temp/log.do_package_qa.3114961
>>>>
>>>> On Thu, Feb 22, 2024 at 5:56 AM Lyu, William via
>>>> lists.openembedded.org
>>>> <william.lyu=windriver.com@lists.openembedded.org> wrote:
>>>>>
>>>>> From: William Lyu <William.Lyu@windriver.com>
>>>>>
>>>>> Signed-off-by: William Lyu <William.Lyu@windriver.com>
>>>>> ---
>>>>>   .../recipes-utils/e2tools/e2tools_git.bb      | 51 
>>>>> ++++++++++++++++++-
>>>>>   .../recipes-utils/e2tools/files/run-ptest     |  5 ++
>>>>>   2 files changed, 54 insertions(+), 2 deletions(-)
>>>>>   create mode 100644 
>>>>> meta-filesystems/recipes-utils/e2tools/files/run-ptest
>>>>>
>>>>> diff --git a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb 
>>>>> b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>>>>> index caf0025c8..a80b6f598 100644
>>>>> --- a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>>>>> +++ b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>>>>> @@ -9,17 +9,64 @@ SECTION = "base"
>>>>>   LICENSE = "GPL-2.0-only"
>>>>>   LIC_FILES_CHKSUM = 
>>>>> "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
>>>>>
>>>>> -DEPENDS += "e2fsprogs"
>>>>> +DEPENDS += "coreutils e2fsprogs"
>>>>>
>>>>>   PV = "0.1.0+git"
>>>>>
>>>>>   SRC_URI = " \
>>>>>              
>>>>> git://github.com/e2tools/e2tools;protocol=https;branch=master \
>>>>> +           file://run-ptest \
>>>>>   "
>>>>> +
>>>>>   SRCREV = "fd092754a6b65c3a769f74f888668c066f09c36d"
>>>>>
>>>>>   S = "${WORKDIR}/git"
>>>>>
>>>>> -inherit autotools pkgconfig
>>>>> +inherit autotools pkgconfig ptest
>>>>> +
>>>>> +do_configure:prepend() {
>>>>> +    git -C "${WORKDIR}/git" reset --hard HEAD
>>>>> +
>>>>> +    # To install ptest for this package, special configuration 
>>>>> needs to be
>>>>> +    # done before do_configure(). So, do_configure_ptest() which 
>>>>> is scheduled
>>>>> +    # after do_configure() cannot be used.
>>>>> +
>>>>> +    # We only do special configuration if we are installing ptest 
>>>>> for this
>>>>> +    # package.
>>>>> +    if [ "${@d.getVar('PTEST_ENABLED')}" -eq "1" ]; then
>>>>> +        # Since we guarantee run-time dependency when installing 
>>>>> the ptest for
>>>>> +        # this package, we do not need the check macros under 
>>>>> section "checks
>>>>> +        # for programs" in "configure.ac". Plus, these check 
>>>>> macros set the
>>>>> +        # ouput variables to incorrect values as these checks are 
>>>>> performed on
>>>>> +        # the host environment. Still, we need these variables 
>>>>> outputted from
>>>>> +        # these check macros. So, we insert the following lines to 
>>>>> manually
>>>>> +        # set these output variables to the correct value in 
>>>>> "configure.ac".
>>>>> +
>>>>> +        # Note that HAVE_DD_COMMAND and HAVE_MKE2FS_COMMAND are 
>>>>> only ever used
>>>>> +        # in tests/Makefile-files which determines whether to 
>>>>> include the test
>>>>> +        # cases. As for output variables CHMOD, DD, and MKE2FS, 
>>>>> they only
>>>>> +        # point to the programs which test cases need to run. 
>>>>> Since these
>>>>> +        # commands are guaranteed to be present due to RDEPENDS 
>>>>> and are
>>>>> +        # guaranteed to be accessible under PATH environment 
>>>>> variable on the
>>>>> +        # target, we only need to specify the name of these programs.
>>>>> +
>>>>> +        perl -i -0777 -pe 's/(^dnl\s*=+\s*^dnl\s*Checks for 
>>>>> compiler flags\s*^dnl\s*=+)/
>>>>> +AC_SUBST([CHMOD], 'chmod')
>>>>> +AC_SUBST([DD], 'dd')
>>>>> +AC_SUBST([MKE2FS], 'mke2fs')
>>>>> +AM_CONDITIONAL([HAVE_DD_COMMAND], [true])
>>>>> +AM_CONDITIONAL([HAVE_MKE2FS_COMMAND], [true])
>>>>> +\1/ms' "${WORKDIR}/git/configure.ac"
>>>>> +    fi
>>>>> +}
>>>>> +
>>>>> +do_install_ptest() {
>>>>> +    rm -rf "${D}${PTEST_PATH}/*"
>>>>> +    cp -r ../build "${D}${PTEST_PATH}"
>>>>> +    cp -r "${S}/build-aux" "${D}${PTEST_PATH}/build"
>>>>> +    cp -r "${S}" "${D}${PTEST_PATH}"
>>>>> +}
>>>>> +
>>>>> +RDEPENDS:${PN}-ptest += "bash coreutils e2fsprogs e2tools gawk 
>>>>> make perl"
>>>>>
>>>>>   BBCLASSEXTEND = "native"
>>>>> diff --git a/meta-filesystems/recipes-utils/e2tools/files/run-ptest 
>>>>> b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>>>>> new file mode 100644
>>>>> index 000000000..3d4dd9cf3
>>>>> --- /dev/null
>>>>> +++ b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>>>>> @@ -0,0 +1,5 @@
>>>>> +#!/bin/sh
>>>>> +
>>>>> +set -e
>>>>> +
>>>>> +make -C build check
>>>>> -- 
>>>>> 2.43.0
>>>>>
>>>>>
>>>>>
Khem Raj March 4, 2024, 6:34 a.m. UTC | #6
its happening quite consistently now on all kinds of AB workers, see
recent 4-5 failures on

https://autobuilder.yoctoproject.org/typhoon/#/builders/88

On Sun, Mar 3, 2024 at 10:01 PM Lyu, William <William.Lyu@windriver.com> wrote:
>
> On 3/4/2024 12:41 AM, Lyu, William wrote:
> > On 3/1/2024 4:52 PM, Khem Raj wrote:
> >> CAUTION: This email comes from a non Wind River email account!
> >> Do not click links or open attachments unless you recognize the sender
> >> and know the content is safe.
> >>
> >> On Fri, Mar 1, 2024 at 12:20 PM Lyu, William
> >> <William.Lyu@windriver.com> wrote:
> >>>
> >>>> I am running into this error on some builders on AB
> >>>>
> >>>> stdio: ERROR: Task
> >>>> (/home/pokybuild/yocto-worker/meta-oe/build/meta/recipes-support/libexif/libexif_0.6.24.bb:do_package_qa)
> >>>> failed with exit code '1'
> >>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: QA Issue:
> >>>> /usr/lib/e2tools/ptest/git/.git/hooks/update.sample contained in
> >>>> package e2tools-ptest requires /usr/bin/sh, but no providers found in
> >>>> RDEPENDS:e2tools-ptest? [file-rdeps]
> >>>
> >>> File "update.sample" is from ".git" directory. I do not actually need
> >>> this
> >>> file or anything from ".git" directory. I only need the source tree
> >>> for ptest
> >>> to run.
> >>>
> >>> However, I am a bit confused about this QA issue because:
> >>> -   I do not see any file that has "#!/usr/bin/sh". Even
> >>> "update.sample" has
> >>>      "#!/bin/sh" as the first line. There are files in the source
> >>> tree (not
> >>>      under ".git" directory) that have "#!/bin/sh" as the first line.
> >>> -   "/bin/sh" is referring to the default POSIX shell, and the "bash"
> >>> in the
> >>>      RDEPENDS:e2tools-ptest should already fulfill this runtime
> >>> dependency,
> >>> -   I am not yet able to reproduce this issue using poky. I assume
> >>> this is
> >>>      because the QA Issue checker "file-rdeps" in poky do not check
> >>> "sh" by
> >>>      default (excerpt taken from "meta/classes-global/insane.bbclass"):
> >>>
> >>>      if "file-rdeps" not in skip:
> >>>          ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env',
> >>> 'rtld(GNU_HASH)'])
> >>>          if bb.utils.contains('DISTRO_FEATURES', 'usrmerge', True,
> >>> False, d):
> >>>              ignored_file_rdeps |= set(['/usr/bin/sh'])
> >>>          if bb.data.inherits_class('nativesdk', d):
> >>>              ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl',
> >>> 'perl'])
> >>>              if bb.utils.contains('DISTRO_FEATURES', 'usrmerge',
> >>> True, False, d):
> >>>                  ignored_file_rdeps |= set(['/usr/bin/bash'])
> >>>
> >>> William
> >>
> >> what distro features do you have enabled ? perhaps try it with and
> >> without usermerge in DISTRO_FEATURES
> >> and rebuild this package after doing cleansstate to ensure its being
> >> rebuilt in both cases.
> >
> > I have not been able to reproduce this "QA Issue" error yet. Is it
> > possible that the [file-rdeps] checker on the autobuilder (AB) where you
> > saw this issue is defined differently than the default poky? The
> > following are the details regarding my previous and new builds.
> >
> > For my previous builds, there are no specified DISTRO_FEATURES. In
> > conf/local.conf, I only added the following line. The build command I
> > used was "bitbake core-image-minimal".
> >
> > IMAGE_INSTALL:append = " libexif e2tools e2tools-ptest"
> >
> > I tried a new build with the following line added to conf/local.conf.
> >
> > DISTRO_FEATURES:append = " usermerge"
> >
> > I also did "bitbake -c cleansstate e2tools" and "bitbake -c cleansstate
> > core-image-minimal" before each build.
> >
> > William
>
> Just in case the [file-rdeps] checker is somehow not working, I removed
> "bash" from "RDEPENDS:${PN}-ptest". I indeed get the following error
> message as expected when building "bitbake core-image-minimal":
>
> ERROR: QA Issue: /usr/lib/e2tools/ptest/build/config.status contained in
> package e2tools-ptest requires /bin/bash, but no providers found in
> RDEPENDS:e2tools-ptest? [file-rdeps]
>
> William
>
> >
> >>
> >>>
> >>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: Fatal QA errors were
> >>>> found, failing task.
> >>>> stdio: ERROR: Logfile of failure stored in:
> >>>> /home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/e2tools/0.1.0+git/temp/log.do_package_qa.3114961
> >>>>
> >>>> On Thu, Feb 22, 2024 at 5:56 AM Lyu, William via
> >>>> lists.openembedded.org
> >>>> <william.lyu=windriver.com@lists.openembedded.org> wrote:
> >>>>>
> >>>>> From: William Lyu <William.Lyu@windriver.com>
> >>>>>
> >>>>> Signed-off-by: William Lyu <William.Lyu@windriver.com>
> >>>>> ---
> >>>>>   .../recipes-utils/e2tools/e2tools_git.bb      | 51
> >>>>> ++++++++++++++++++-
> >>>>>   .../recipes-utils/e2tools/files/run-ptest     |  5 ++
> >>>>>   2 files changed, 54 insertions(+), 2 deletions(-)
> >>>>>   create mode 100644
> >>>>> meta-filesystems/recipes-utils/e2tools/files/run-ptest
> >>>>>
> >>>>> diff --git a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> >>>>> b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> >>>>> index caf0025c8..a80b6f598 100644
> >>>>> --- a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> >>>>> +++ b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> >>>>> @@ -9,17 +9,64 @@ SECTION = "base"
> >>>>>   LICENSE = "GPL-2.0-only"
> >>>>>   LIC_FILES_CHKSUM =
> >>>>> "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
> >>>>>
> >>>>> -DEPENDS += "e2fsprogs"
> >>>>> +DEPENDS += "coreutils e2fsprogs"
> >>>>>
> >>>>>   PV = "0.1.0+git"
> >>>>>
> >>>>>   SRC_URI = " \
> >>>>>
> >>>>> git://github.com/e2tools/e2tools;protocol=https;branch=master \
> >>>>> +           file://run-ptest \
> >>>>>   "
> >>>>> +
> >>>>>   SRCREV = "fd092754a6b65c3a769f74f888668c066f09c36d"
> >>>>>
> >>>>>   S = "${WORKDIR}/git"
> >>>>>
> >>>>> -inherit autotools pkgconfig
> >>>>> +inherit autotools pkgconfig ptest
> >>>>> +
> >>>>> +do_configure:prepend() {
> >>>>> +    git -C "${WORKDIR}/git" reset --hard HEAD
> >>>>> +
> >>>>> +    # To install ptest for this package, special configuration
> >>>>> needs to be
> >>>>> +    # done before do_configure(). So, do_configure_ptest() which
> >>>>> is scheduled
> >>>>> +    # after do_configure() cannot be used.
> >>>>> +
> >>>>> +    # We only do special configuration if we are installing ptest
> >>>>> for this
> >>>>> +    # package.
> >>>>> +    if [ "${@d.getVar('PTEST_ENABLED')}" -eq "1" ]; then
> >>>>> +        # Since we guarantee run-time dependency when installing
> >>>>> the ptest for
> >>>>> +        # this package, we do not need the check macros under
> >>>>> section "checks
> >>>>> +        # for programs" in "configure.ac". Plus, these check
> >>>>> macros set the
> >>>>> +        # ouput variables to incorrect values as these checks are
> >>>>> performed on
> >>>>> +        # the host environment. Still, we need these variables
> >>>>> outputted from
> >>>>> +        # these check macros. So, we insert the following lines to
> >>>>> manually
> >>>>> +        # set these output variables to the correct value in
> >>>>> "configure.ac".
> >>>>> +
> >>>>> +        # Note that HAVE_DD_COMMAND and HAVE_MKE2FS_COMMAND are
> >>>>> only ever used
> >>>>> +        # in tests/Makefile-files which determines whether to
> >>>>> include the test
> >>>>> +        # cases. As for output variables CHMOD, DD, and MKE2FS,
> >>>>> they only
> >>>>> +        # point to the programs which test cases need to run.
> >>>>> Since these
> >>>>> +        # commands are guaranteed to be present due to RDEPENDS
> >>>>> and are
> >>>>> +        # guaranteed to be accessible under PATH environment
> >>>>> variable on the
> >>>>> +        # target, we only need to specify the name of these programs.
> >>>>> +
> >>>>> +        perl -i -0777 -pe 's/(^dnl\s*=+\s*^dnl\s*Checks for
> >>>>> compiler flags\s*^dnl\s*=+)/
> >>>>> +AC_SUBST([CHMOD], 'chmod')
> >>>>> +AC_SUBST([DD], 'dd')
> >>>>> +AC_SUBST([MKE2FS], 'mke2fs')
> >>>>> +AM_CONDITIONAL([HAVE_DD_COMMAND], [true])
> >>>>> +AM_CONDITIONAL([HAVE_MKE2FS_COMMAND], [true])
> >>>>> +\1/ms' "${WORKDIR}/git/configure.ac"
> >>>>> +    fi
> >>>>> +}
> >>>>> +
> >>>>> +do_install_ptest() {
> >>>>> +    rm -rf "${D}${PTEST_PATH}/*"
> >>>>> +    cp -r ../build "${D}${PTEST_PATH}"
> >>>>> +    cp -r "${S}/build-aux" "${D}${PTEST_PATH}/build"
> >>>>> +    cp -r "${S}" "${D}${PTEST_PATH}"
> >>>>> +}
> >>>>> +
> >>>>> +RDEPENDS:${PN}-ptest += "bash coreutils e2fsprogs e2tools gawk
> >>>>> make perl"
> >>>>>
> >>>>>   BBCLASSEXTEND = "native"
> >>>>> diff --git a/meta-filesystems/recipes-utils/e2tools/files/run-ptest
> >>>>> b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
> >>>>> new file mode 100644
> >>>>> index 000000000..3d4dd9cf3
> >>>>> --- /dev/null
> >>>>> +++ b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
> >>>>> @@ -0,0 +1,5 @@
> >>>>> +#!/bin/sh
> >>>>> +
> >>>>> +set -e
> >>>>> +
> >>>>> +make -C build check
> >>>>> --
> >>>>> 2.43.0
> >>>>>
> >>>>>
> >>>>> -=-=-=-=-=-=-=-=-=-=-=-
> >>>>> Links: You receive all messages sent to this group.
> >>>>> View/Reply Online (#108987):
> >>>>> https://lists.openembedded.org/g/openembedded-devel/message/108987
> >>>>> Mute This Topic: https://lists.openembedded.org/mt/104508347/1997914
> >>>>> Group Owner: openembedded-devel+owner@lists.openembedded.org
> >>>>> Unsubscribe:
> >>>>> https://lists.openembedded.org/g/openembedded-devel/unsub
> >>>>> [raj.khem@gmail.com]
> >>>>> -=-=-=-=-=-=-=-=-=-=-=-
Lyu, William March 6, 2024, 3:59 p.m. UTC | #7
I see that you pushed a commit that adds command removing unnecessary 
files and host paths in the e2tools recipe.

https://github.com/openembedded/meta-openembedded/commit/92b6825a870fde291b1244193dba8d7c1051c53f

I have tested this latest e2tools recipe locally using the latest poky. 
I built an image using "bitbake core-image-minimal" with e2tools and its 
ptest package. The build was successful (still no QA errors) and the 
ptest for e2tools ran without any issue.

Are you still seeing the [file-rdeps] QA issues on the Yocto Autobuilder?

Thank you for removing the unnecessary files and improving the e2tools 
recipe.

On 3/4/2024 1:34 AM, Khem Raj wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> its happening quite consistently now on all kinds of AB workers, see
> recent 4-5 failures on
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/88
> 
> On Sun, Mar 3, 2024 at 10:01 PM Lyu, William <William.Lyu@windriver.com> wrote:
>>
>> On 3/4/2024 12:41 AM, Lyu, William wrote:
>>> On 3/1/2024 4:52 PM, Khem Raj wrote:
>>>> CAUTION: This email comes from a non Wind River email account!
>>>> Do not click links or open attachments unless you recognize the sender
>>>> and know the content is safe.
>>>>
>>>> On Fri, Mar 1, 2024 at 12:20 PM Lyu, William
>>>> <William.Lyu@windriver.com> wrote:
>>>>>
>>>>>> I am running into this error on some builders on AB
>>>>>>
>>>>>> stdio: ERROR: Task
>>>>>> (/home/pokybuild/yocto-worker/meta-oe/build/meta/recipes-support/libexif/libexif_0.6.24.bb:do_package_qa)
>>>>>> failed with exit code '1'
>>>>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: QA Issue:
>>>>>> /usr/lib/e2tools/ptest/git/.git/hooks/update.sample contained in
>>>>>> package e2tools-ptest requires /usr/bin/sh, but no providers found in
>>>>>> RDEPENDS:e2tools-ptest? [file-rdeps]
>>>>>
>>>>> File "update.sample" is from ".git" directory. I do not actually need
>>>>> this
>>>>> file or anything from ".git" directory. I only need the source tree
>>>>> for ptest
>>>>> to run.
>>>>>
>>>>> However, I am a bit confused about this QA issue because:
>>>>> -   I do not see any file that has "#!/usr/bin/sh". Even
>>>>> "update.sample" has
>>>>>       "#!/bin/sh" as the first line. There are files in the source
>>>>> tree (not
>>>>>       under ".git" directory) that have "#!/bin/sh" as the first line.
>>>>> -   "/bin/sh" is referring to the default POSIX shell, and the "bash"
>>>>> in the
>>>>>       RDEPENDS:e2tools-ptest should already fulfill this runtime
>>>>> dependency,
>>>>> -   I am not yet able to reproduce this issue using poky. I assume
>>>>> this is
>>>>>       because the QA Issue checker "file-rdeps" in poky do not check
>>>>> "sh" by
>>>>>       default (excerpt taken from "meta/classes-global/insane.bbclass"):
>>>>>
>>>>>       if "file-rdeps" not in skip:
>>>>>           ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env',
>>>>> 'rtld(GNU_HASH)'])
>>>>>           if bb.utils.contains('DISTRO_FEATURES', 'usrmerge', True,
>>>>> False, d):
>>>>>               ignored_file_rdeps |= set(['/usr/bin/sh'])
>>>>>           if bb.data.inherits_class('nativesdk', d):
>>>>>               ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl',
>>>>> 'perl'])
>>>>>               if bb.utils.contains('DISTRO_FEATURES', 'usrmerge',
>>>>> True, False, d):
>>>>>                   ignored_file_rdeps |= set(['/usr/bin/bash'])
>>>>>
>>>>> William
>>>>
>>>> what distro features do you have enabled ? perhaps try it with and
>>>> without usermerge in DISTRO_FEATURES

For the sake of documentation and preventing confusion for anyone 
stumbling upon this email thread, I would like to confirm if "usermerge" 
here is a typo. Is it correct that you meant "usrmerge"?

William

>>>> and rebuild this package after doing cleansstate to ensure its being
>>>> rebuilt in both cases.
>>>
>>> I have not been able to reproduce this "QA Issue" error yet. Is it
>>> possible that the [file-rdeps] checker on the autobuilder (AB) where you
>>> saw this issue is defined differently than the default poky? The
>>> following are the details regarding my previous and new builds.
>>>
>>> For my previous builds, there are no specified DISTRO_FEATURES. In
>>> conf/local.conf, I only added the following line. The build command I
>>> used was "bitbake core-image-minimal".
>>>
>>> IMAGE_INSTALL:append = " libexif e2tools e2tools-ptest"
>>>
>>> I tried a new build with the following line added to conf/local.conf.
>>>
>>> DISTRO_FEATURES:append = " usermerge"
>>>
>>> I also did "bitbake -c cleansstate e2tools" and "bitbake -c cleansstate
>>> core-image-minimal" before each build.
>>>
>>> William
>>
>> Just in case the [file-rdeps] checker is somehow not working, I removed
>> "bash" from "RDEPENDS:${PN}-ptest". I indeed get the following error
>> message as expected when building "bitbake core-image-minimal":
>>
>> ERROR: QA Issue: /usr/lib/e2tools/ptest/build/config.status contained in
>> package e2tools-ptest requires /bin/bash, but no providers found in
>> RDEPENDS:e2tools-ptest? [file-rdeps]
>>
>> William
>>
>>>
>>>>
>>>>>
>>>>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: Fatal QA errors were
>>>>>> found, failing task.
>>>>>> stdio: ERROR: Logfile of failure stored in:
>>>>>> /home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/e2tools/0.1.0+git/temp/log.do_package_qa.3114961
>>>>>>
>>>>>> On Thu, Feb 22, 2024 at 5:56 AM Lyu, William via
>>>>>> lists.openembedded.org
>>>>>> <william.lyu=windriver.com@lists.openembedded.org> wrote:
>>>>>>>
>>>>>>> From: William Lyu <William.Lyu@windriver.com>
>>>>>>>
>>>>>>> Signed-off-by: William Lyu <William.Lyu@windriver.com>
>>>>>>> ---
>>>>>>>    .../recipes-utils/e2tools/e2tools_git.bb      | 51
>>>>>>> ++++++++++++++++++-
>>>>>>>    .../recipes-utils/e2tools/files/run-ptest     |  5 ++
>>>>>>>    2 files changed, 54 insertions(+), 2 deletions(-)
>>>>>>>    create mode 100644
>>>>>>> meta-filesystems/recipes-utils/e2tools/files/run-ptest
>>>>>>>
>>>>>>> diff --git a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>>>>>>> b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>>>>>>> index caf0025c8..a80b6f598 100644
>>>>>>> --- a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>>>>>>> +++ b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>>>>>>> @@ -9,17 +9,64 @@ SECTION = "base"
>>>>>>>    LICENSE = "GPL-2.0-only"
>>>>>>>    LIC_FILES_CHKSUM =
>>>>>>> "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
>>>>>>>
>>>>>>> -DEPENDS += "e2fsprogs"
>>>>>>> +DEPENDS += "coreutils e2fsprogs"
>>>>>>>
>>>>>>>    PV = "0.1.0+git"
>>>>>>>
>>>>>>>    SRC_URI = " \
>>>>>>>
>>>>>>> git://github.com/e2tools/e2tools;protocol=https;branch=master \
>>>>>>> +           file://run-ptest \
>>>>>>>    "
>>>>>>> +
>>>>>>>    SRCREV = "fd092754a6b65c3a769f74f888668c066f09c36d"
>>>>>>>
>>>>>>>    S = "${WORKDIR}/git"
>>>>>>>
>>>>>>> -inherit autotools pkgconfig
>>>>>>> +inherit autotools pkgconfig ptest
>>>>>>> +
>>>>>>> +do_configure:prepend() {
>>>>>>> +    git -C "${WORKDIR}/git" reset --hard HEAD
>>>>>>> +
>>>>>>> +    # To install ptest for this package, special configuration
>>>>>>> needs to be
>>>>>>> +    # done before do_configure(). So, do_configure_ptest() which
>>>>>>> is scheduled
>>>>>>> +    # after do_configure() cannot be used.
>>>>>>> +
>>>>>>> +    # We only do special configuration if we are installing ptest
>>>>>>> for this
>>>>>>> +    # package.
>>>>>>> +    if [ "${@d.getVar('PTEST_ENABLED')}" -eq "1" ]; then
>>>>>>> +        # Since we guarantee run-time dependency when installing
>>>>>>> the ptest for
>>>>>>> +        # this package, we do not need the check macros under
>>>>>>> section "checks
>>>>>>> +        # for programs" in "configure.ac". Plus, these check
>>>>>>> macros set the
>>>>>>> +        # ouput variables to incorrect values as these checks are
>>>>>>> performed on
>>>>>>> +        # the host environment. Still, we need these variables
>>>>>>> outputted from
>>>>>>> +        # these check macros. So, we insert the following lines to
>>>>>>> manually
>>>>>>> +        # set these output variables to the correct value in
>>>>>>> "configure.ac".
>>>>>>> +
>>>>>>> +        # Note that HAVE_DD_COMMAND and HAVE_MKE2FS_COMMAND are
>>>>>>> only ever used
>>>>>>> +        # in tests/Makefile-files which determines whether to
>>>>>>> include the test
>>>>>>> +        # cases. As for output variables CHMOD, DD, and MKE2FS,
>>>>>>> they only
>>>>>>> +        # point to the programs which test cases need to run.
>>>>>>> Since these
>>>>>>> +        # commands are guaranteed to be present due to RDEPENDS
>>>>>>> and are
>>>>>>> +        # guaranteed to be accessible under PATH environment
>>>>>>> variable on the
>>>>>>> +        # target, we only need to specify the name of these programs.
>>>>>>> +
>>>>>>> +        perl -i -0777 -pe 's/(^dnl\s*=+\s*^dnl\s*Checks for
>>>>>>> compiler flags\s*^dnl\s*=+)/
>>>>>>> +AC_SUBST([CHMOD], 'chmod')
>>>>>>> +AC_SUBST([DD], 'dd')
>>>>>>> +AC_SUBST([MKE2FS], 'mke2fs')
>>>>>>> +AM_CONDITIONAL([HAVE_DD_COMMAND], [true])
>>>>>>> +AM_CONDITIONAL([HAVE_MKE2FS_COMMAND], [true])
>>>>>>> +\1/ms' "${WORKDIR}/git/configure.ac"
>>>>>>> +    fi
>>>>>>> +}
>>>>>>> +
>>>>>>> +do_install_ptest() {
>>>>>>> +    rm -rf "${D}${PTEST_PATH}/*"
>>>>>>> +    cp -r ../build "${D}${PTEST_PATH}"
>>>>>>> +    cp -r "${S}/build-aux" "${D}${PTEST_PATH}/build"
>>>>>>> +    cp -r "${S}" "${D}${PTEST_PATH}"
>>>>>>> +}
>>>>>>> +
>>>>>>> +RDEPENDS:${PN}-ptest += "bash coreutils e2fsprogs e2tools gawk
>>>>>>> make perl"
>>>>>>>
>>>>>>>    BBCLASSEXTEND = "native"
>>>>>>> diff --git a/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>>>>>>> b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>>>>>>> new file mode 100644
>>>>>>> index 000000000..3d4dd9cf3
>>>>>>> --- /dev/null
>>>>>>> +++ b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>>>>>>> @@ -0,0 +1,5 @@
>>>>>>> +#!/bin/sh
>>>>>>> +
>>>>>>> +set -e
>>>>>>> +
>>>>>>> +make -C build check
>>>>>>> --
>>>>>>> 2.43.0
>>>>>>>
>>>>>>>
>>>>>>>
Khem Raj March 6, 2024, 4:02 p.m. UTC | #8
On Wed, Mar 6, 2024 at 8:00 AM Lyu, William <William.Lyu@windriver.com>
wrote:

> I see that you pushed a commit that adds command removing unnecessary
> files and host paths in the e2tools recipe.
>
>
> https://github.com/openembedded/meta-openembedded/commit/92b6825a870fde291b1244193dba8d7c1051c53f
>
> I have tested this latest e2tools recipe locally using the latest poky.
> I built an image using "bitbake core-image-minimal" with e2tools and its
> ptest package. The build was successful (still no QA errors) and the
> ptest for e2tools ran without any issue.
>
> Are you still seeing the [file-rdeps] QA issues on the Yocto Autobuilder?
>
No
This patch fixes the issue this is what I have been asking for all along


> Thank you for removing the unnecessary files and improving the e2tools
> recipe.
>
> On 3/4/2024 1:34 AM, Khem Raj wrote:
> > CAUTION: This email comes from a non Wind River email account!
> > Do not click links or open attachments unless you recognize the sender
> and know the content is safe.
> >
> > its happening quite consistently now on all kinds of AB workers, see
> > recent 4-5 failures on
> >
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/88
> >
> > On Sun, Mar 3, 2024 at 10:01 PM Lyu, William <William.Lyu@windriver.com>
> wrote:
> >>
> >> On 3/4/2024 12:41 AM, Lyu, William wrote:
> >>> On 3/1/2024 4:52 PM, Khem Raj wrote:
> >>>> CAUTION: This email comes from a non Wind River email account!
> >>>> Do not click links or open attachments unless you recognize the sender
> >>>> and know the content is safe.
> >>>>
> >>>> On Fri, Mar 1, 2024 at 12:20 PM Lyu, William
> >>>> <William.Lyu@windriver.com> wrote:
> >>>>>
> >>>>>> I am running into this error on some builders on AB
> >>>>>>
> >>>>>> stdio: ERROR: Task
> >>>>>>
> (/home/pokybuild/yocto-worker/meta-oe/build/meta/recipes-support/libexif/libexif_0.6.24.bb:
> do_package_qa)
> >>>>>> failed with exit code '1'
> >>>>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: QA Issue:
> >>>>>> /usr/lib/e2tools/ptest/git/.git/hooks/update.sample contained in
> >>>>>> package e2tools-ptest requires /usr/bin/sh, but no providers found
> in
> >>>>>> RDEPENDS:e2tools-ptest? [file-rdeps]
> >>>>>
> >>>>> File "update.sample" is from ".git" directory. I do not actually need
> >>>>> this
> >>>>> file or anything from ".git" directory. I only need the source tree
> >>>>> for ptest
> >>>>> to run.
> >>>>>
> >>>>> However, I am a bit confused about this QA issue because:
> >>>>> -   I do not see any file that has "#!/usr/bin/sh". Even
> >>>>> "update.sample" has
> >>>>>       "#!/bin/sh" as the first line. There are files in the source
> >>>>> tree (not
> >>>>>       under ".git" directory) that have "#!/bin/sh" as the first
> line.
> >>>>> -   "/bin/sh" is referring to the default POSIX shell, and the "bash"
> >>>>> in the
> >>>>>       RDEPENDS:e2tools-ptest should already fulfill this runtime
> >>>>> dependency,
> >>>>> -   I am not yet able to reproduce this issue using poky. I assume
> >>>>> this is
> >>>>>       because the QA Issue checker "file-rdeps" in poky do not check
> >>>>> "sh" by
> >>>>>       default (excerpt taken from
> "meta/classes-global/insane.bbclass"):
> >>>>>
> >>>>>       if "file-rdeps" not in skip:
> >>>>>           ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env',
> >>>>> 'rtld(GNU_HASH)'])
> >>>>>           if bb.utils.contains('DISTRO_FEATURES', 'usrmerge', True,
> >>>>> False, d):
> >>>>>               ignored_file_rdeps |= set(['/usr/bin/sh'])
> >>>>>           if bb.data.inherits_class('nativesdk', d):
> >>>>>               ignored_file_rdeps |= set(['/bin/bash',
> '/usr/bin/perl',
> >>>>> 'perl'])
> >>>>>               if bb.utils.contains('DISTRO_FEATURES', 'usrmerge',
> >>>>> True, False, d):
> >>>>>                   ignored_file_rdeps |= set(['/usr/bin/bash'])
> >>>>>
> >>>>> William
> >>>>
> >>>> what distro features do you have enabled ? perhaps try it with and
> >>>> without usermerge in DISTRO_FEATURES
>
> For the sake of documentation and preventing confusion for anyone
> stumbling upon this email thread, I would like to confirm if "usermerge"
> here is a typo. Is it correct that you meant "usrmerge"?
>
> William
>
> >>>> and rebuild this package after doing cleansstate to ensure its being
> >>>> rebuilt in both cases.
> >>>
> >>> I have not been able to reproduce this "QA Issue" error yet. Is it
> >>> possible that the [file-rdeps] checker on the autobuilder (AB) where
> you
> >>> saw this issue is defined differently than the default poky? The
> >>> following are the details regarding my previous and new builds.
> >>>
> >>> For my previous builds, there are no specified DISTRO_FEATURES. In
> >>> conf/local.conf, I only added the following line. The build command I
> >>> used was "bitbake core-image-minimal".
> >>>
> >>> IMAGE_INSTALL:append = " libexif e2tools e2tools-ptest"
> >>>
> >>> I tried a new build with the following line added to conf/local.conf.
> >>>
> >>> DISTRO_FEATURES:append = " usermerge"
> >>>
> >>> I also did "bitbake -c cleansstate e2tools" and "bitbake -c cleansstate
> >>> core-image-minimal" before each build.
> >>>
> >>> William
> >>
> >> Just in case the [file-rdeps] checker is somehow not working, I removed
> >> "bash" from "RDEPENDS:${PN}-ptest". I indeed get the following error
> >> message as expected when building "bitbake core-image-minimal":
> >>
> >> ERROR: QA Issue: /usr/lib/e2tools/ptest/build/config.status contained in
> >> package e2tools-ptest requires /bin/bash, but no providers found in
> >> RDEPENDS:e2tools-ptest? [file-rdeps]
> >>
> >> William
> >>
> >>>
> >>>>
> >>>>>
> >>>>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: Fatal QA errors
> were
> >>>>>> found, failing task.
> >>>>>> stdio: ERROR: Logfile of failure stored in:
> >>>>>>
> /home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/e2tools/0.1.0+git/temp/log.do_package_qa.3114961
> >>>>>>
> >>>>>> On Thu, Feb 22, 2024 at 5:56 AM Lyu, William via
> >>>>>> lists.openembedded.org
> >>>>>> <william.lyu=windriver.com@lists.openembedded.org> wrote:
> >>>>>>>
> >>>>>>> From: William Lyu <William.Lyu@windriver.com>
> >>>>>>>
> >>>>>>> Signed-off-by: William Lyu <William.Lyu@windriver.com>
> >>>>>>> ---
> >>>>>>>    .../recipes-utils/e2tools/e2tools_git.bb      | 51
> >>>>>>> ++++++++++++++++++-
> >>>>>>>    .../recipes-utils/e2tools/files/run-ptest     |  5 ++
> >>>>>>>    2 files changed, 54 insertions(+), 2 deletions(-)
> >>>>>>>    create mode 100644
> >>>>>>> meta-filesystems/recipes-utils/e2tools/files/run-ptest
> >>>>>>>
> >>>>>>> diff --git a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> >>>>>>> b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> >>>>>>> index caf0025c8..a80b6f598 100644
> >>>>>>> --- a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> >>>>>>> +++ b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
> >>>>>>> @@ -9,17 +9,64 @@ SECTION = "base"
> >>>>>>>    LICENSE = "GPL-2.0-only"
> >>>>>>>    LIC_FILES_CHKSUM =
> >>>>>>> "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
> >>>>>>>
> >>>>>>> -DEPENDS += "e2fsprogs"
> >>>>>>> +DEPENDS += "coreutils e2fsprogs"
> >>>>>>>
> >>>>>>>    PV = "0.1.0+git"
> >>>>>>>
> >>>>>>>    SRC_URI = " \
> >>>>>>>
> >>>>>>> git://github.com/e2tools/e2tools;protocol=https;branch=master \
> >>>>>>> +           file://run-ptest \
> >>>>>>>    "
> >>>>>>> +
> >>>>>>>    SRCREV = "fd092754a6b65c3a769f74f888668c066f09c36d"
> >>>>>>>
> >>>>>>>    S = "${WORKDIR}/git"
> >>>>>>>
> >>>>>>> -inherit autotools pkgconfig
> >>>>>>> +inherit autotools pkgconfig ptest
> >>>>>>> +
> >>>>>>> +do_configure:prepend() {
> >>>>>>> +    git -C "${WORKDIR}/git" reset --hard HEAD
> >>>>>>> +
> >>>>>>> +    # To install ptest for this package, special configuration
> >>>>>>> needs to be
> >>>>>>> +    # done before do_configure(). So, do_configure_ptest() which
> >>>>>>> is scheduled
> >>>>>>> +    # after do_configure() cannot be used.
> >>>>>>> +
> >>>>>>> +    # We only do special configuration if we are installing ptest
> >>>>>>> for this
> >>>>>>> +    # package.
> >>>>>>> +    if [ "${@d.getVar('PTEST_ENABLED')}" -eq "1" ]; then
> >>>>>>> +        # Since we guarantee run-time dependency when installing
> >>>>>>> the ptest for
> >>>>>>> +        # this package, we do not need the check macros under
> >>>>>>> section "checks
> >>>>>>> +        # for programs" in "configure.ac". Plus, these check
> >>>>>>> macros set the
> >>>>>>> +        # ouput variables to incorrect values as these checks are
> >>>>>>> performed on
> >>>>>>> +        # the host environment. Still, we need these variables
> >>>>>>> outputted from
> >>>>>>> +        # these check macros. So, we insert the following lines to
> >>>>>>> manually
> >>>>>>> +        # set these output variables to the correct value in
> >>>>>>> "configure.ac".
> >>>>>>> +
> >>>>>>> +        # Note that HAVE_DD_COMMAND and HAVE_MKE2FS_COMMAND are
> >>>>>>> only ever used
> >>>>>>> +        # in tests/Makefile-files which determines whether to
> >>>>>>> include the test
> >>>>>>> +        # cases. As for output variables CHMOD, DD, and MKE2FS,
> >>>>>>> they only
> >>>>>>> +        # point to the programs which test cases need to run.
> >>>>>>> Since these
> >>>>>>> +        # commands are guaranteed to be present due to RDEPENDS
> >>>>>>> and are
> >>>>>>> +        # guaranteed to be accessible under PATH environment
> >>>>>>> variable on the
> >>>>>>> +        # target, we only need to specify the name of these
> programs.
> >>>>>>> +
> >>>>>>> +        perl -i -0777 -pe 's/(^dnl\s*=+\s*^dnl\s*Checks for
> >>>>>>> compiler flags\s*^dnl\s*=+)/
> >>>>>>> +AC_SUBST([CHMOD], 'chmod')
> >>>>>>> +AC_SUBST([DD], 'dd')
> >>>>>>> +AC_SUBST([MKE2FS], 'mke2fs')
> >>>>>>> +AM_CONDITIONAL([HAVE_DD_COMMAND], [true])
> >>>>>>> +AM_CONDITIONAL([HAVE_MKE2FS_COMMAND], [true])
> >>>>>>> +\1/ms' "${WORKDIR}/git/configure.ac"
> >>>>>>> +    fi
> >>>>>>> +}
> >>>>>>> +
> >>>>>>> +do_install_ptest() {
> >>>>>>> +    rm -rf "${D}${PTEST_PATH}/*"
> >>>>>>> +    cp -r ../build "${D}${PTEST_PATH}"
> >>>>>>> +    cp -r "${S}/build-aux" "${D}${PTEST_PATH}/build"
> >>>>>>> +    cp -r "${S}" "${D}${PTEST_PATH}"
> >>>>>>> +}
> >>>>>>> +
> >>>>>>> +RDEPENDS:${PN}-ptest += "bash coreutils e2fsprogs e2tools gawk
> >>>>>>> make perl"
> >>>>>>>
> >>>>>>>    BBCLASSEXTEND = "native"
> >>>>>>> diff --git a/meta-filesystems/recipes-utils/e2tools/files/run-ptest
> >>>>>>> b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
> >>>>>>> new file mode 100644
> >>>>>>> index 000000000..3d4dd9cf3
> >>>>>>> --- /dev/null
> >>>>>>> +++ b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
> >>>>>>> @@ -0,0 +1,5 @@
> >>>>>>> +#!/bin/sh
> >>>>>>> +
> >>>>>>> +set -e
> >>>>>>> +
> >>>>>>> +make -C build check
> >>>>>>> --
> >>>>>>> 2.43.0
> >>>>>>>
> >>>>>>>
> >>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
> >>>>>>> Links: You receive all messages sent to this group.
> >>>>>>> View/Reply Online (#108987):
> >>>>>>> https://lists.openembedded.org/g/openembedded-devel/message/108987
> >>>>>>> Mute This Topic:
> https://lists.openembedded.org/mt/104508347/1997914
> >>>>>>> Group Owner: openembedded-devel+owner@lists.openembedded.org
> >>>>>>> Unsubscribe:
> >>>>>>> https://lists.openembedded.org/g/openembedded-devel/unsub
> >>>>>>> [raj.khem@gmail.com]
> >>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>
Lyu, William March 6, 2024, 4:17 p.m. UTC | #9
On 3/6/2024 11:02 AM, Khem Raj wrote:
> **
> *CAUTION: This email comes from a non Wind River email account!*
> Do not click links or open attachments unless you recognize the sender 
> and know the content is safe.
> 
> 
> On Wed, Mar 6, 2024 at 8:00 AM Lyu, William <William.Lyu@windriver.com 
> <mailto:William.Lyu@windriver.com>> wrote:
> 
>     I see that you pushed a commit that adds command removing unnecessary
>     files and host paths in the e2tools recipe.
> 
>     https://github.com/openembedded/meta-openembedded/commit/92b6825a870fde291b1244193dba8d7c1051c53f <https://urldefense.com/v3/__https://github.com/openembedded/meta-openembedded/commit/92b6825a870fde291b1244193dba8d7c1051c53f__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLbbeO1Q0w$>
> 
>     I have tested this latest e2tools recipe locally using the latest poky.
>     I built an image using "bitbake core-image-minimal" with e2tools and
>     its
>     ptest package. The build was successful (still no QA errors) and the
>     ptest for e2tools ran without any issue.
> 
>     Are you still seeing the [file-rdeps] QA issues on the Yocto
>     Autobuilder?
> 
> No
> This patch fixes the issue this is what I have been asking for all along

Thanks for fixing this issue!

This fix still comes to me as a surprise. There are still existing files 
with "#!/bin/sh" as first line just like the "update.sample" before:

$ head run-ptest
#!/bin/sh
...

Would you mind directing me to where the [file-rdeps] checker is 
defined? Is the autobuilder (AB) using "poky" or "yoe"? I would like to 
do some investigation, because the [file-rdeps] QA checker was being 
misleading. It was seemingly complaining about something - missing 
/usr/bin/sh - other than the actual issue - something related to ".git". 
I would like to see how [file-rdeps] checker code logic reached such 
error message, and I would like to see how to potentially improve the 
error reporting from this checker.

William

> 
> 
>     Thank you for removing the unnecessary files and improving the e2tools
>     recipe.
> 
>     On 3/4/2024 1:34 AM, Khem Raj wrote:
>      > CAUTION: This email comes from a non Wind River email account!
>      > Do not click links or open attachments unless you recognize the
>     sender and know the content is safe.
>      >
>      > its happening quite consistently now on all kinds of AB workers, see
>      > recent 4-5 failures on
>      >
>      > https://autobuilder.yoctoproject.org/typhoon/#/builders/88
>     <https://urldefense.com/v3/__https://autobuilder.yoctoproject.org/typhoon/*/builders/88__;Iw!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLbGuduvbQ$>
>      >
>      > On Sun, Mar 3, 2024 at 10:01 PM Lyu, William
>     <William.Lyu@windriver.com <mailto:William.Lyu@windriver.com>> wrote:
>      >>
>      >> On 3/4/2024 12:41 AM, Lyu, William wrote:
>      >>> On 3/1/2024 4:52 PM, Khem Raj wrote:
>      >>>> CAUTION: This email comes from a non Wind River email account!
>      >>>> Do not click links or open attachments unless you recognize
>     the sender
>      >>>> and know the content is safe.
>      >>>>
>      >>>> On Fri, Mar 1, 2024 at 12:20 PM Lyu, William
>      >>>> <William.Lyu@windriver.com <mailto:William.Lyu@windriver.com>>
>     wrote:
>      >>>>>
>      >>>>>> I am running into this error on some builders on AB
>      >>>>>>
>      >>>>>> stdio: ERROR: Task
>      >>>>>>
>     (/home/pokybuild/yocto-worker/meta-oe/build/meta/recipes-support/libexif/libexif_0.6.24.bb <https://urldefense.com/v3/__http://libexif_0.6.24.bb__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLYrlPjd8Q$>:do_package_qa)
>      >>>>>> failed with exit code '1'
>      >>>>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: QA Issue:
>      >>>>>> /usr/lib/e2tools/ptest/git/.git/hooks/update.sample contained in
>      >>>>>> package e2tools-ptest requires /usr/bin/sh, but no providers
>     found in
>      >>>>>> RDEPENDS:e2tools-ptest? [file-rdeps]
>      >>>>>
>      >>>>> File "update.sample" is from ".git" directory. I do not
>     actually need
>      >>>>> this
>      >>>>> file or anything from ".git" directory. I only need the
>     source tree
>      >>>>> for ptest
>      >>>>> to run.
>      >>>>>
>      >>>>> However, I am a bit confused about this QA issue because:
>      >>>>> -   I do not see any file that has "#!/usr/bin/sh". Even
>      >>>>> "update.sample" has
>      >>>>>       "#!/bin/sh" as the first line. There are files in the
>     source
>      >>>>> tree (not
>      >>>>>       under ".git" directory) that have "#!/bin/sh" as the
>     first line.
>      >>>>> -   "/bin/sh" is referring to the default POSIX shell, and
>     the "bash"
>      >>>>> in the
>      >>>>>       RDEPENDS:e2tools-ptest should already fulfill this runtime
>      >>>>> dependency,
>      >>>>> -   I am not yet able to reproduce this issue using poky. I
>     assume
>      >>>>> this is
>      >>>>>       because the QA Issue checker "file-rdeps" in poky do
>     not check
>      >>>>> "sh" by
>      >>>>>       default (excerpt taken from
>     "meta/classes-global/insane.bbclass"):
>      >>>>>
>      >>>>>       if "file-rdeps" not in skip:
>      >>>>>           ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env',
>      >>>>> 'rtld(GNU_HASH)'])
>      >>>>>           if bb.utils.contains('DISTRO_FEATURES', 'usrmerge',
>     True,
>      >>>>> False, d):
>      >>>>>               ignored_file_rdeps |= set(['/usr/bin/sh'])
>      >>>>>           if bb.data.inherits_class('nativesdk', d):
>      >>>>>               ignored_file_rdeps |= set(['/bin/bash',
>     '/usr/bin/perl',
>      >>>>> 'perl'])
>      >>>>>               if bb.utils.contains('DISTRO_FEATURES', 'usrmerge',
>      >>>>> True, False, d):
>      >>>>>                   ignored_file_rdeps |= set(['/usr/bin/bash'])
>      >>>>>
>      >>>>> William
>      >>>>
>      >>>> what distro features do you have enabled ? perhaps try it with and
>      >>>> without usermerge in DISTRO_FEATURES
> 
>     For the sake of documentation and preventing confusion for anyone
>     stumbling upon this email thread, I would like to confirm if
>     "usermerge"
>     here is a typo. Is it correct that you meant "usrmerge"?
> 
>     William
> 
>      >>>> and rebuild this package after doing cleansstate to ensure its
>     being
>      >>>> rebuilt in both cases.
>      >>>
>      >>> I have not been able to reproduce this "QA Issue" error yet. Is it
>      >>> possible that the [file-rdeps] checker on the autobuilder (AB)
>     where you
>      >>> saw this issue is defined differently than the default poky? The
>      >>> following are the details regarding my previous and new builds.
>      >>>
>      >>> For my previous builds, there are no specified DISTRO_FEATURES. In
>      >>> conf/local.conf, I only added the following line. The build
>     command I
>      >>> used was "bitbake core-image-minimal".
>      >>>
>      >>> IMAGE_INSTALL:append = " libexif e2tools e2tools-ptest"
>      >>>
>      >>> I tried a new build with the following line added to
>     conf/local.conf.
>      >>>
>      >>> DISTRO_FEATURES:append = " usermerge"
>      >>>
>      >>> I also did "bitbake -c cleansstate e2tools" and "bitbake -c
>     cleansstate
>      >>> core-image-minimal" before each build.
>      >>>
>      >>> William
>      >>
>      >> Just in case the [file-rdeps] checker is somehow not working, I
>     removed
>      >> "bash" from "RDEPENDS:${PN}-ptest". I indeed get the following error
>      >> message as expected when building "bitbake core-image-minimal":
>      >>
>      >> ERROR: QA Issue: /usr/lib/e2tools/ptest/build/config.status
>     contained in
>      >> package e2tools-ptest requires /bin/bash, but no providers found in
>      >> RDEPENDS:e2tools-ptest? [file-rdeps]
>      >>
>      >> William
>      >>
>      >>>
>      >>>>
>      >>>>>
>      >>>>>> stdio: ERROR: e2tools-0.1.0+git-r0 do_package_qa: Fatal QA
>     errors were
>      >>>>>> found, failing task.
>      >>>>>> stdio: ERROR: Logfile of failure stored in:
>      >>>>>>
>     /home/pokybuild/yocto-worker/meta-oe/build/build/tmp/work/core2-64-poky-linux/e2tools/0.1.0+git/temp/log.do_package_qa.3114961
>      >>>>>>
>      >>>>>> On Thu, Feb 22, 2024 at 5:56 AM Lyu, William via
>      >>>>>> lists.openembedded.org
>     <https://urldefense.com/v3/__http://lists.openembedded.org__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLZU9ZtVCw$>
>      >>>>>> <william.lyu=windriver.com@lists.openembedded.org
>     <mailto:windriver.com@lists.openembedded.org>> wrote:
>      >>>>>>>
>      >>>>>>> From: William Lyu <William.Lyu@windriver.com
>     <mailto:William.Lyu@windriver.com>>
>      >>>>>>>
>      >>>>>>> Signed-off-by: William Lyu <William.Lyu@windriver.com
>     <mailto:William.Lyu@windriver.com>>
>      >>>>>>> ---
>      >>>>>>>    .../recipes-utils/e2tools/e2tools_git.bb
>     <https://urldefense.com/v3/__http://e2tools_git.bb__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLaa6TMqBQ$> | 51
>      >>>>>>> ++++++++++++++++++-
>      >>>>>>>    .../recipes-utils/e2tools/files/run-ptest     |  5 ++
>      >>>>>>>    2 files changed, 54 insertions(+), 2 deletions(-)
>      >>>>>>>    create mode 100644
>      >>>>>>> meta-filesystems/recipes-utils/e2tools/files/run-ptest
>      >>>>>>>
>      >>>>>>> diff --git
>     a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>     <https://urldefense.com/v3/__http://e2tools_git.bb__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLaa6TMqBQ$>
>      >>>>>>> b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>     <https://urldefense.com/v3/__http://e2tools_git.bb__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLaa6TMqBQ$>
>      >>>>>>> index caf0025c8..a80b6f598 100644
>      >>>>>>> --- a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>     <https://urldefense.com/v3/__http://e2tools_git.bb__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLaa6TMqBQ$>
>      >>>>>>> +++ b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
>     <https://urldefense.com/v3/__http://e2tools_git.bb__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLaa6TMqBQ$>
>      >>>>>>> @@ -9,17 +9,64 @@ SECTION = "base"
>      >>>>>>>    LICENSE = "GPL-2.0-only"
>      >>>>>>>    LIC_FILES_CHKSUM =
>      >>>>>>> "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
>      >>>>>>>
>      >>>>>>> -DEPENDS += "e2fsprogs"
>      >>>>>>> +DEPENDS += "coreutils e2fsprogs"
>      >>>>>>>
>      >>>>>>>    PV = "0.1.0+git"
>      >>>>>>>
>      >>>>>>>    SRC_URI = " \
>      >>>>>>>
>      >>>>>>>
>     git://github.com/e2tools/e2tools;protocol=https;branch=master
>     <https://urldefense.com/v3/__http://github.com/e2tools/e2tools;protocol=https;branch=master__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLZhJevx-g$> \
>      >>>>>>> +           file://run-ptest \
>      >>>>>>>    "
>      >>>>>>> +
>      >>>>>>>    SRCREV = "fd092754a6b65c3a769f74f888668c066f09c36d"
>      >>>>>>>
>      >>>>>>>    S = "${WORKDIR}/git"
>      >>>>>>>
>      >>>>>>> -inherit autotools pkgconfig
>      >>>>>>> +inherit autotools pkgconfig ptest
>      >>>>>>> +
>      >>>>>>> +do_configure:prepend() {
>      >>>>>>> +    git -C "${WORKDIR}/git" reset --hard HEAD
>      >>>>>>> +
>      >>>>>>> +    # To install ptest for this package, special configuration
>      >>>>>>> needs to be
>      >>>>>>> +    # done before do_configure(). So, do_configure_ptest()
>     which
>      >>>>>>> is scheduled
>      >>>>>>> +    # after do_configure() cannot be used.
>      >>>>>>> +
>      >>>>>>> +    # We only do special configuration if we are
>     installing ptest
>      >>>>>>> for this
>      >>>>>>> +    # package.
>      >>>>>>> +    if [ "${@d.getVar('PTEST_ENABLED')}" -eq "1" ]; then
>      >>>>>>> +        # Since we guarantee run-time dependency when
>     installing
>      >>>>>>> the ptest for
>      >>>>>>> +        # this package, we do not need the check macros under
>      >>>>>>> section "checks
>      >>>>>>> +        # for programs" in "configure.ac
>     <https://urldefense.com/v3/__http://configure.ac__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLa-bYwU0g$>". Plus, these check
>      >>>>>>> macros set the
>      >>>>>>> +        # ouput variables to incorrect values as these
>     checks are
>      >>>>>>> performed on
>      >>>>>>> +        # the host environment. Still, we need these variables
>      >>>>>>> outputted from
>      >>>>>>> +        # these check macros. So, we insert the following
>     lines to
>      >>>>>>> manually
>      >>>>>>> +        # set these output variables to the correct value in
>      >>>>>>> "configure.ac
>     <https://urldefense.com/v3/__http://configure.ac__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLa-bYwU0g$>".
>      >>>>>>> +
>      >>>>>>> +        # Note that HAVE_DD_COMMAND and
>     HAVE_MKE2FS_COMMAND are
>      >>>>>>> only ever used
>      >>>>>>> +        # in tests/Makefile-files which determines whether to
>      >>>>>>> include the test
>      >>>>>>> +        # cases. As for output variables CHMOD, DD, and
>     MKE2FS,
>      >>>>>>> they only
>      >>>>>>> +        # point to the programs which test cases need to run.
>      >>>>>>> Since these
>      >>>>>>> +        # commands are guaranteed to be present due to
>     RDEPENDS
>      >>>>>>> and are
>      >>>>>>> +        # guaranteed to be accessible under PATH environment
>      >>>>>>> variable on the
>      >>>>>>> +        # target, we only need to specify the name of
>     these programs.
>      >>>>>>> +
>      >>>>>>> +        perl -i -0777 -pe 's/(^dnl\s*=+\s*^dnl\s*Checks for
>      >>>>>>> compiler flags\s*^dnl\s*=+)/
>      >>>>>>> +AC_SUBST([CHMOD], 'chmod')
>      >>>>>>> +AC_SUBST([DD], 'dd')
>      >>>>>>> +AC_SUBST([MKE2FS], 'mke2fs')
>      >>>>>>> +AM_CONDITIONAL([HAVE_DD_COMMAND], [true])
>      >>>>>>> +AM_CONDITIONAL([HAVE_MKE2FS_COMMAND], [true])
>      >>>>>>> +\1/ms' "${WORKDIR}/git/configure.ac
>     <https://urldefense.com/v3/__http://configure.ac__;!!AjveYdw8EvQ!e6G0IIki5XY3woNYM7gDk_0dr6qbokIInABiyDrDNNz86gFHeFJIRd-HfusuUIhMDeXgPrvG1hJ3yLa-bYwU0g$>"
>      >>>>>>> +    fi
>      >>>>>>> +}
>      >>>>>>> +
>      >>>>>>> +do_install_ptest() {
>      >>>>>>> +    rm -rf "${D}${PTEST_PATH}/*"
>      >>>>>>> +    cp -r ../build "${D}${PTEST_PATH}"
>      >>>>>>> +    cp -r "${S}/build-aux" "${D}${PTEST_PATH}/build"
>      >>>>>>> +    cp -r "${S}" "${D}${PTEST_PATH}"
>      >>>>>>> +}
>      >>>>>>> +
>      >>>>>>> +RDEPENDS:${PN}-ptest += "bash coreutils e2fsprogs e2tools gawk
>      >>>>>>> make perl"
>      >>>>>>>
>      >>>>>>>    BBCLASSEXTEND = "native"
>      >>>>>>> diff --git
>     a/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>      >>>>>>> b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>      >>>>>>> new file mode 100644
>      >>>>>>> index 000000000..3d4dd9cf3
>      >>>>>>> --- /dev/null
>      >>>>>>> +++ b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
>      >>>>>>> @@ -0,0 +1,5 @@
>      >>>>>>> +#!/bin/sh
>      >>>>>>> +
>      >>>>>>> +set -e
>      >>>>>>> +
>      >>>>>>> +make -C build check
>      >>>>>>> --
>      >>>>>>> 2.43.0
>      >>>>>>>
>      >>>>>>>
>      >>>>>>> 
>
diff mbox series

Patch

diff --git a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
index caf0025c8..a80b6f598 100644
--- a/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
+++ b/meta-filesystems/recipes-utils/e2tools/e2tools_git.bb
@@ -9,17 +9,64 @@  SECTION = "base"
 LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
-DEPENDS += "e2fsprogs"
+DEPENDS += "coreutils e2fsprogs"
 
 PV = "0.1.0+git"
 
 SRC_URI = " \
            git://github.com/e2tools/e2tools;protocol=https;branch=master \
+           file://run-ptest \
 "
+
 SRCREV = "fd092754a6b65c3a769f74f888668c066f09c36d"
 
 S = "${WORKDIR}/git"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
+
+do_configure:prepend() {
+    git -C "${WORKDIR}/git" reset --hard HEAD
+
+    # To install ptest for this package, special configuration needs to be
+    # done before do_configure(). So, do_configure_ptest() which is scheduled
+    # after do_configure() cannot be used.
+
+    # We only do special configuration if we are installing ptest for this
+    # package.
+    if [ "${@d.getVar('PTEST_ENABLED')}" -eq "1" ]; then
+        # Since we guarantee run-time dependency when installing the ptest for
+        # this package, we do not need the check macros under section "checks
+        # for programs" in "configure.ac". Plus, these check macros set the
+        # ouput variables to incorrect values as these checks are performed on
+        # the host environment. Still, we need these variables outputted from
+        # these check macros. So, we insert the following lines to manually
+        # set these output variables to the correct value in "configure.ac".
+
+        # Note that HAVE_DD_COMMAND and HAVE_MKE2FS_COMMAND are only ever used
+        # in tests/Makefile-files which determines whether to include the test
+        # cases. As for output variables CHMOD, DD, and MKE2FS, they only
+        # point to the programs which test cases need to run. Since these
+        # commands are guaranteed to be present due to RDEPENDS and are
+        # guaranteed to be accessible under PATH environment variable on the
+        # target, we only need to specify the name of these programs.
+
+        perl -i -0777 -pe 's/(^dnl\s*=+\s*^dnl\s*Checks for compiler flags\s*^dnl\s*=+)/
+AC_SUBST([CHMOD], 'chmod')
+AC_SUBST([DD], 'dd')
+AC_SUBST([MKE2FS], 'mke2fs')
+AM_CONDITIONAL([HAVE_DD_COMMAND], [true])
+AM_CONDITIONAL([HAVE_MKE2FS_COMMAND], [true])
+\1/ms' "${WORKDIR}/git/configure.ac"
+    fi
+}
+
+do_install_ptest() {
+    rm -rf "${D}${PTEST_PATH}/*"
+    cp -r ../build "${D}${PTEST_PATH}"
+    cp -r "${S}/build-aux" "${D}${PTEST_PATH}/build"
+    cp -r "${S}" "${D}${PTEST_PATH}"
+}
+
+RDEPENDS:${PN}-ptest += "bash coreutils e2fsprogs e2tools gawk make perl"
 
 BBCLASSEXTEND = "native"
diff --git a/meta-filesystems/recipes-utils/e2tools/files/run-ptest b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
new file mode 100644
index 000000000..3d4dd9cf3
--- /dev/null
+++ b/meta-filesystems/recipes-utils/e2tools/files/run-ptest
@@ -0,0 +1,5 @@ 
+#!/bin/sh
+
+set -e
+
+make -C build check