On Sat, Mar 9, 2024 at 5:29 AM Robert P. J. Day <rpj...@crashcourse.ca> wrote:
>
>
> As ptest.bbclass defines the more intuitive ptest-related variable:
>

The ptest bbclass is in classes-recipe, while the distro feature is in
the global conf space.

They aren't really equivalent from that point of view.

The kernel bbclasses don't inherit ptest at all (and don't need to), so
using it in the kernel recipes won't actually do anything (except always
make sure the ptest options are not enabled).

Cheers,

Bruce


>   PTEST_ENABLED =
>     "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '1', '0', d)}"
>
> modify a number of obvious recipe ptest checks to use that simpler
> form.
>
> Signed-off-by: Robert P. J. Day <rpj...@crashcourse.ca>
>
> ---
>
>   i did a simple textual substitution so as long as that's all that's
> needed, this should work.
>
> diff --git a/meta/classes-global/insane.bbclass 
> b/meta/classes-global/insane.bbclass
> index e963001d09..bb01fa7466 100644
> --- a/meta/classes-global/insane.bbclass
> +++ b/meta/classes-global/insane.bbclass
> @@ -1371,7 +1371,7 @@ python do_qa_patch() {
>          return False
>
>      srcdir = d.getVar('S')
> -    if not bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
> +    if not bb.utils.contains('PTEST_ENABLED', '1', True, False, d):
>          pass
>      elif bb.data.inherits_class('ptest', d):
>          bb.note("Package %s QA: skipping unimplemented-ptest: ptest 
> implementation detected" % d.getVar('PN'))
> diff --git a/meta/recipes-devtools/lua/lua_5.4.6.bb 
> b/meta/recipes-devtools/lua/lua_5.4.6.bb
> index eabfc89575..6420b2231b 100644
> --- a/meta/recipes-devtools/lua/lua_5.4.6.bb
> +++ b/meta/recipes-devtools/lua/lua_5.4.6.bb
> @@ -6,7 +6,7 @@ HOMEPAGE = "http://www.lua.org/";
>
>  SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \
>             file://lua.pc.in \
> -           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 
> 'http://www.lua.org/tests/lua-${PV_testsuites}-tests.tar.gz;name=tarballtest 
> file://run-ptest ', '', d)} \
> +           ${@bb.utils.contains('PTEST_ENABLED', '1', 
> 'http://www.lua.org/tests/lua-${PV_testsuites}-tests.tar.gz;name=tarballtest 
> file://run-ptest ', '', d)} \
>             "
>
>  # if no test suite matches PV release of Lua exactly, download the suite for 
> the closest Lua release.
> diff --git a/meta/recipes-devtools/perl/perl-ptest.inc 
> b/meta/recipes-devtools/perl/perl-ptest.inc
> index e07355d3f5..98d7b1c2a2 100644
> --- a/meta/recipes-devtools/perl/perl-ptest.inc
> +++ b/meta/recipes-devtools/perl/perl-ptest.inc
> @@ -51,7 +51,7 @@ python populate_packages:prepend() {
>      # Put all *.t files from the lib dir in the ptest package
>      # do_split_packages requires a pair of () in the regex, but we have 
> nothing
>      # to match, so use an empty pair.
> -    if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
> +    if bb.utils.contains('PTEST_ENABLED', '1', True, False, d):
>          do_split_packages(d, d.expand('${libdir}/perl/${PV}'), r'.*\.t()',
>              '${PN}-ptest%s', '%s', recursive=True, match_path=True)
>  }
> diff --git a/meta/recipes-devtools/python/python3-bcrypt_4.1.2.bb 
> b/meta/recipes-devtools/python/python3-bcrypt_4.1.2.bb
> index 93fa645f33..4e6ca5e074 100644
> --- a/meta/recipes-devtools/python/python3-bcrypt_4.1.2.bb
> +++ b/meta/recipes-devtools/python/python3-bcrypt_4.1.2.bb
> @@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = 
> "file://LICENSE;md5=8f7bb094c7232b058c7e9f2e431f389c"
>  HOMEPAGE = "https://pypi.org/project/bcrypt/";
>
>  DEPENDS += "python3-cffi-native"
> -LDFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', ' 
> -fuse-ld=bfd', '', d)}"
> +LDFLAGS:append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' 
> -fuse-ld=bfd', '', d)}"
>
>  SRC_URI[sha256sum] = 
> "33313a1200a3ae90b75587ceac502b048b840fc69e7f7a0905b5f87fac7a1258"
>
> diff --git a/meta/recipes-devtools/valgrind/valgrind_3.22.0.bb 
> b/meta/recipes-devtools/valgrind/valgrind_3.22.0.bb
> index 74ac7ec9d5..c0f3784261 100644
> --- a/meta/recipes-devtools/valgrind/valgrind_3.22.0.bb
> +++ b/meta/recipes-devtools/valgrind/valgrind_3.22.0.bb
> @@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = 
> "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
>                      file://COPYING.DOCS;md5=24ea4c7092233849b4394699333b5c56"
>
>  DEPENDS = " \
> -           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'boost', '', d)} 
> \
> +           ${@bb.utils.contains('PTEST_ENABLED', '1', 'boost', '', d)} \
>          "
>
>  SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
> diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb 
> b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> index bd3e5a9406..dce9339643 100644
> --- a/meta/recipes-kernel/linux/linux-yocto-dev.bb
> +++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> @@ -60,7 +60,7 @@ KERNEL_FEATURES:append:qemuall=" cfg/virtio.scc 
> features/drm-bochs/drm-bochs.scc
>  KERNEL_FEATURES:append:qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
>  KERNEL_FEATURES:append:qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
>  KERNEL_FEATURES:append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " 
> cfg/x32.scc", "", d)}"
> -KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", 
> " features/scsi/scsi-debug.scc", "", d)}"
> -KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", 
> " features/gpio/mockup.scc features/gpio/sim.scc", "", d)}"
> +KERNEL_FEATURES:append = " ${@bb.utils.contains("PTEST_ENABLED", "1", " 
> features/scsi/scsi-debug.scc", "", d)}"
> +KERNEL_FEATURES:append = " ${@bb.utils.contains("PTEST_ENABLED", "1", " 
> features/gpio/mockup.scc features/gpio/sim.scc", "", d)}"
>
>  KERNEL_VERSION_SANITY_SKIP = "1"
> diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_6.6.bb 
> b/meta/recipes-kernel/linux/linux-yocto-rt_6.6.bb
> index e80594b45e..acf90b8f99 100644
> --- a/meta/recipes-kernel/linux/linux-yocto-rt_6.6.bb
> +++ b/meta/recipes-kernel/linux/linux-yocto-rt_6.6.bb
> @@ -44,5 +44,5 @@ KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}"
>  KERNEL_FEATURES:append:qemuall=" cfg/virtio.scc 
> features/drm-bochs/drm-bochs.scc"
>  KERNEL_FEATURES:append:qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
>  KERNEL_FEATURES:append:qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
> -KERNEL_FEATURES:append = "${@bb.utils.contains("DISTRO_FEATURES", "ptest", " 
> features/scsi/scsi-debug.scc", "", d)}"
> -KERNEL_FEATURES:append = "${@bb.utils.contains("DISTRO_FEATURES", "ptest", " 
> features/gpio/mockup.scc features/gpio/sim.scc", "", d)}"
> +KERNEL_FEATURES:append = "${@bb.utils.contains("PTEST_ENABLED", "1", " 
> features/scsi/scsi-debug.scc", "", d)}"
> +KERNEL_FEATURES:append = "${@bb.utils.contains("PTEST_ENABLED", "1", " 
> features/gpio/mockup.scc features/gpio/sim.scc", "", d)}"
> diff --git a/meta/recipes-kernel/linux/linux-yocto_6.6.bb 
> b/meta/recipes-kernel/linux/linux-yocto_6.6.bb
> index 0f62dea29a..c7e411b5fd 100644
> --- a/meta/recipes-kernel/linux/linux-yocto_6.6.bb
> +++ b/meta/recipes-kernel/linux/linux-yocto_6.6.bb
> @@ -62,8 +62,8 @@ KERNEL_FEATURES:append:qemuall=" cfg/virtio.scc 
> features/drm-bochs/drm-bochs.scc
>  KERNEL_FEATURES:append:qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
>  KERNEL_FEATURES:append:qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
>  KERNEL_FEATURES:append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " 
> cfg/x32.scc", "", d)}"
> -KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", 
> " features/scsi/scsi-debug.scc", "", d)}"
> -KERNEL_FEATURES:append = " ${@bb.utils.contains("DISTRO_FEATURES", "ptest", 
> " features/gpio/mockup.scc features/gpio/sim.scc", "", d)}"
> +KERNEL_FEATURES:append = " ${@bb.utils.contains("PTEST_ENABLED", "1", " 
> features/scsi/scsi-debug.scc", "", d)}"
> +KERNEL_FEATURES:append = " ${@bb.utils.contains("PTEST_ENABLED", "1", " 
> features/gpio/mockup.scc features/gpio/sim.scc", "", d)}"
>  KERNEL_FEATURES:append:powerpc =" arch/powerpc/powerpc-debug.scc"
>  KERNEL_FEATURES:append:powerpc64 =" arch/powerpc/powerpc-debug.scc"
>  KERNEL_FEATURES:append:powerpc64le =" arch/powerpc/powerpc-debug.scc"
>
>
>
>
> --
>
> rday
>
> 
>


--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196871): 
https://lists.openembedded.org/g/openembedded-core/message/196871
Mute This Topic: https://lists.openembedded.org/mt/104825491/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to