Skip to contentSkip to conversation

is there any reason for a ptest-enabled recipe to conditionally SRC_URI run-ptest?

DISCUSSION Robert P. J. Day 2 participants 3 messages Dec 8, 2025

lore
Share & tools
lore
#0 lore raw

working on a tutorial for ptest and i ran across an oddity under
meta-openembedded, not sure if it means something or is just leftover cruft from days gone by. i found three recipes with the following construct (reformatted slightly for visual aesthetics):

$ grep -r "PTEST_ENABLED.*run-ptest" *

meta-oe/recipes-dbs/mysql/mariadb_11.4.9.bb:SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)}"

meta-oe/recipes-devtools/lapack/lapack_3.12.1.bb:
${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)} \

meta-oe/recipes-support/re2/re2_2024.03.01.bb:
${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)} \

all three recipes check whether PTEST_ENABLED = 1 before adding
file://run-ptest to SRC_URI.

is there any reason for this? all three recipes inherit ptest, so it
seems that they *must* provide a run-ptest file. and even if one does not enable that setting with DISTRO_FEATURES += "ptest", if a recipe inherits ptest, does that not *require* that recipe to make sure a run-ptest file is available if called upon? or am i misreading something?

rday

p.s. i might ask a similar question about this snippet from ptest.bbclass:

    do_install_ptest_base() {
        if [ -f ${UNPACKDIR}/run-ptest ]; then
            install -D ${UNPACKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
        fi

if run-ptest does not come from UNPACKDIR, where would it come from? might the recipe generate that file dynamically upon package creation?

#1 lore raw
Quoted 15 lines · Robert P. J. Day via lists.openembedded.org

working on a tutorial for ptest and i ran across an oddity under
meta-openembedded, not sure if it means something or is just leftover cruft from days gone by. i found three recipes with the following construct (reformatted slightly for visual aesthetics):

$ grep -r "PTEST_ENABLED.*run-ptest" *

meta-oe/recipes-dbs/mysql/mariadb_11.4.9.bb:SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)}"

meta-oe/recipes-devtools/lapack/lapack_3.12.1.bb:
${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)} \

Quoted 7 lines

meta-oe/recipes-support/re2/re2_2024.03.01.bb:
${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)} \

all three recipes check whether PTEST_ENABLED = 1 before adding
file://run-ptest to SRC_URI.

is there any reason for this?

All three gained ptest support in 2023, two from the same author... my money's on copy and paste from another recipe.

Quoted 12 lines

all three recipes inherit ptest, so it
seems that they *must* provide a run-ptest file. and even if one does not enable that setting with DISTRO_FEATURES += "ptest", if a recipe inherits ptest, does that not *require* that recipe to make sure a run-ptest file is available if called upon? or am i misreading something?

rday

p.s. i might ask a similar question about this snippet from ptest.bbclass:

Quoted 8 lines
    do_install_ptest_base() {
        if [ -f ${UNPACKDIR}/run-ptest ]; then
            install -D ${UNPACKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
        fi

if run-ptest does not come from UNPACKDIR, where would it come from? might the recipe generate that file dynamically upon package creation?

The golang classes do exactly that.

Quoted 8 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#227392): https://lists.openembedded.org/g/openembedded-core/message/227392
Mute This Topic: https://lists.openembedded.org/mt/116674580/3618097
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 1 line
Alex Kiernan
#2 lore raw
Quoted 21 lines · Alex Kiernan
Quoted 18 lines · Robert P. J. Day via lists.openembedded.org

working on a tutorial for ptest and i ran across an oddity under
meta-openembedded, not sure if it means something or is just leftover cruft from days gone by. i found three recipes with the following construct (reformatted slightly for visual aesthetics):

$ grep -r "PTEST_ENABLED.*run-ptest" *

meta-oe/recipes-dbs/mysql/mariadb_11.4.9.bb:SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)}"

meta-oe/recipes-devtools/lapack/lapack_3.12.1.bb:
${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)} \

meta-oe/recipes-support/re2/re2_2024.03.01.bb:
${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)} \

Quoted 7 lines
Quoted 4 lines

all three recipes check whether PTEST_ENABLED = 1 before adding
file://run-ptest to SRC_URI.

is there any reason for this?

All three gained ptest support in 2023, two from the same author... my money's on copy and paste from another recipe.

so you would agree that while the above PTEST_ENABLED conditional is
technically acceptable in any recipe that provides a *static* file://run-ptest, it's really unnecessary and might as well use the simpler non-conditional form for overall consistency.

Quoted 17 lines
Quoted 17 lines

all three recipes inherit ptest, so it
seems that they *must* provide a run-ptest file. and even if one does not enable that setting with DISTRO_FEATURES += "ptest", if a recipe inherits ptest, does that not *require* that recipe to make sure a run-ptest file is available if called upon? or am i misreading something?

rday

p.s. i might ask a similar question about this snippet from ptest.bbclass:

    do_install_ptest_base() {
        if [ -f ${UNPACKDIR}/run-ptest ]; then
            install -D ${UNPACKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
        fi
Quoted 5 lines
Quoted 3 lines

if run-ptest does not come from UNPACKDIR, where would it come from? might the recipe generate that file dynamically upon package creation?

The golang classes do exactly that.

ah, perfect, that was the sort of example i was looking for. and in
cases like that, SRC_URI would obviously *not* include 'file://run-ptest' as that file would not exist.

good, clarifying stuff a little at a time, thanks.

rday