diff mbox series

Fix invalid conditional appends

Message ID 20260314-fix-invalid-appends-v1-1-03ec0bff6942@gmail.com
State New
Headers show
Series Fix invalid conditional appends | expand

Commit Message

Michal Sieron March 14, 2026, 6:03 p.m. UTC
Using `A:class-target += " b"` actually appends to `A:class-target`,
which will later override `A`. Most likely what was originally intended
is conditional append to `A`.

Signed-off-by: Michal Sieron <michalwsieron@gmail.com>
---
This patch (or patches if it turns out I should split it) fixes several
findings for variable assignments of form:
    A:someoverride += "foo"
and transforms them into:
    A:append:someoverride = " foo"

In most of those cases I assume the original intent was to have a
conditional append, but what was actually happening was append to
a conditional override.

I first noticed such problem in our internal recipes and bbappends, but
then I decided to check if similar issue exists upstream and turns out
it does.

Here are results from bitbake-getvar for libffi.
Before patch:
    $ grep EXTRA_OECONF /path/to/layers/openembedded-core/meta/recipes-support/libffi/libffi_3.5.2.bb
    EXTRA_OECONF += "--disable-builddir --disable-exec-static-tramp"
    EXTRA_OECONF:class-native += "--with-gcc-arch=generic"
    $ bitbake-getvar -r libffi-native EXTRA_OECONF
    #
    # $EXTRA_OECONF [6 operations]
    #   set /path/to/layers/openembedded-core/meta/conf/bitbake.conf:590
    #     ""
    #   :append /path/to/layers/openembedded-core/meta/conf/distro/include/no-static-libs.inc:24
    #     "${DISABLE_STATIC}"
    #   set /path/to/layers/openembedded-core/meta/conf/documentation.conf:164
    #     [doc] "Additional configure script options."
    #   append /path/to/layers/openembedded-core/meta/recipes-support/libffi/libffi_3.5.2.bb:18
    #     "--disable-builddir --disable-exec-static-tramp"
    #   :append /path/to/layers/openembedded-core/meta/classes-recipe/autotools.bbclass:134
    #     " ${PACKAGECONFIG_CONFARGS}"
    #   override[class-native]:append /path/to/layers/openembedded-core/meta/recipes-support/libffi/libffi_3.5.2.bb:19
    #     "--with-gcc-arch=generic"
    # pre-expansion value:
    #   " --with-gcc-arch=generic${DISABLE_STATIC} ${PACKAGECONFIG_CONFARGS}"
    EXTRA_OECONF=" --with-gcc-arch=generic --disable-static "

After patch:
    $ grep EXTRA_OECONF /path/to/layers/openembedded-core/meta/recipes-support/libffi/libffi_3.5.2.bb
    EXTRA_OECONF += "--disable-builddir --disable-exec-static-tramp"
    EXTRA_OECONF:append:class-native = " --with-gcc-arch=generic"
    $ bitbake-getvar -r libffi-native EXTRA_OECONF#
    # $EXTRA_OECONF [6 operations]
    #   set /path/to/layers/openembedded-core/meta/conf/bitbake.conf:590
    #     ""
    #   :append /path/to/layers/openembedded-core/meta/conf/distro/include/no-static-libs.inc:24
    #     "${DISABLE_STATIC}"
    #   set /path/to/layers/openembedded-core/meta/conf/documentation.conf:164
    #     [doc] "Additional configure script options."
    #   append /path/to/layers/openembedded-core/meta/recipes-support/libffi/libffi_3.5.2.bb:18
    #     "--disable-builddir --disable-exec-static-tramp"
    #   :append[class-native] /path/to/layers/openembedded-core/meta/recipes-support/libffi/libffi_3.5.2.bb:19
    #     " --with-gcc-arch=generic"
    #   :append /path/to/layers/openembedded-core/meta/classes-recipe/autotools.bbclass:134
    #     " ${PACKAGECONFIG_CONFARGS}"
    # pre-expansion value:
    #   " --disable-builddir --disable-exec-static-tramp${DISABLE_STATIC} --with-gcc-arch=generic ${PACKAGECONFIG_CONFARGS}"
    EXTRA_OECONF=" --disable-builddir --disable-exec-static-tramp --disable-static --with-gcc-arch=generic "

Now there are some cases where I am not sure if the override was needed
in the first place. Actually most `:class-target` overrides seem
unnecessary. Please let me know if I should actually delete the override
and keep `+=` for them.
---
 meta/recipes-devtools/bootchart2/bootchart2_0.14.9.bb    | 4 ++--
 meta/recipes-devtools/dnf/dnf_4.24.0.bb                  | 2 +-
 meta/recipes-devtools/python/python3-asn1crypto_1.5.1.bb | 2 +-
 meta/recipes-devtools/python/python3-bcrypt_5.0.0.bb     | 2 +-
 meta/recipes-devtools/python/python3-chardet_5.2.0.bb    | 2 +-
 meta/recipes-devtools/python/python3-cython_3.2.4.bb     | 4 ++--
 meta/recipes-devtools/python/python3-ply_3.11.bb         | 2 +-
 meta/recipes-devtools/python/python3-pyasn1_0.6.2.bb     | 2 +-
 meta/recipes-devtools/python/python3-pycparser_3.0.bb    | 4 ++--
 meta/recipes-devtools/python/python3-pysocks_1.7.1.bb    | 2 +-
 meta/recipes-devtools/python/python3-pytz_2025.2.bb      | 2 +-
 meta/recipes-devtools/qemu/qemu_10.2.0.bb                | 2 +-
 meta/recipes-kernel/systemtap/systemtap_5.4.bb           | 2 +-
 13 files changed, 16 insertions(+), 16 deletions(-)


---
base-commit: c05ef14f2840e9c0cb9fc7a5bf52cbfa9ccedc1a
change-id: 20260314-fix-invalid-appends-cf5197ef2f07

Best regards,

Comments

patchtest@automation.yoctoproject.org March 14, 2026, 6:15 p.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/Fix-invalid-conditional-appends.patch

FAIL: test shortlog format: Commit shortlog (first line of commit message) should follow the format "<target>: <summary>" (test_mbox.TestMbox.test_shortlog_format)

PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
diff mbox series

Patch

diff --git a/meta/recipes-devtools/bootchart2/bootchart2_0.14.9.bb b/meta/recipes-devtools/bootchart2/bootchart2_0.14.9.bb
index 922e665028..0d1937a5f9 100644
--- a/meta/recipes-devtools/bootchart2/bootchart2_0.14.9.bb
+++ b/meta/recipes-devtools/bootchart2/bootchart2_0.14.9.bb
@@ -150,8 +150,8 @@  do_install () {
 PACKAGES =+ "pybootchartgui"
 FILES:pybootchartgui += "${PYTHON_SITEPACKAGES_DIR}/pybootchartgui ${bindir}/pybootchartgui"
 RDEPENDS:pybootchartgui = "python3-pycairo python3-compression python3-image python3-math python3-shell python3-compression python3-codecs"
-RDEPENDS:${PN}:class-target += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}"
-RDEPENDS:${PN}:class-target += "lsb-release"
+RDEPENDS:${PN}:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}"
+RDEPENDS:${PN}:append:class-target = " lsb-release"
 DEPENDS:append:class-native = " python3-pycairo-native"
 
 PACKAGES =+ "bootchartd-stop-initscript"
diff --git a/meta/recipes-devtools/dnf/dnf_4.24.0.bb b/meta/recipes-devtools/dnf/dnf_4.24.0.bb
index d40b85c4b0..832b96c929 100644
--- a/meta/recipes-devtools/dnf/dnf_4.24.0.bb
+++ b/meta/recipes-devtools/dnf/dnf_4.24.0.bb
@@ -55,7 +55,7 @@  RDEPENDS:${PN} += " \
 
 RDEPENDS:${PN}:class-native = ""
 
-RRECOMMENDS:${PN}:class-target += "gnupg"
+RRECOMMENDS:${PN}:append:class-target = " gnupg"
 
 # Create a symlink called 'dnf' as 'make install' does not do it, but
 # .spec file in dnf source tree does (and then Fedora and dnf documentation
diff --git a/meta/recipes-devtools/python/python3-asn1crypto_1.5.1.bb b/meta/recipes-devtools/python/python3-asn1crypto_1.5.1.bb
index 322497b09b..0449438ebe 100644
--- a/meta/recipes-devtools/python/python3-asn1crypto_1.5.1.bb
+++ b/meta/recipes-devtools/python/python3-asn1crypto_1.5.1.bb
@@ -10,7 +10,7 @@  SRC_URI[sha256sum] = "13ae38502be632115abf8a24cbe5f4da52e3b5231990aff31123c80530
 
 inherit pypi setuptools3
 
-RDEPENDS:${PN}:class-target += " \
+RDEPENDS:${PN}:append:class-target = " \
     python3-codecs \
     python3-crypt \
     python3-ctypes \
diff --git a/meta/recipes-devtools/python/python3-bcrypt_5.0.0.bb b/meta/recipes-devtools/python/python3-bcrypt_5.0.0.bb
index 6397ecd818..f803f28ddf 100644
--- a/meta/recipes-devtools/python/python3-bcrypt_5.0.0.bb
+++ b/meta/recipes-devtools/python/python3-bcrypt_5.0.0.bb
@@ -14,7 +14,7 @@  CARGO_SRC_DIR = "src/_bcrypt"
 
 require ${BPN}-crates.inc
 
-RDEPENDS:${PN}:class-target += "\
+RDEPENDS:${PN}:append:class-target = " \
     python3-cffi \
     python3-ctypes \
     python3-shell \
diff --git a/meta/recipes-devtools/python/python3-chardet_5.2.0.bb b/meta/recipes-devtools/python/python3-chardet_5.2.0.bb
index 9acbeeb3f2..1b4600f00b 100644
--- a/meta/recipes-devtools/python/python3-chardet_5.2.0.bb
+++ b/meta/recipes-devtools/python/python3-chardet_5.2.0.bb
@@ -14,7 +14,7 @@  FILES:${PN}-cli += " \
 
 RDEPENDS:${PN}-cli = "${PN} "
 
-RDEPENDS:${PN}:class-target += " \
+RDEPENDS:${PN}:append:class-target = " \
     python3-logging \
 "
 
diff --git a/meta/recipes-devtools/python/python3-cython_3.2.4.bb b/meta/recipes-devtools/python/python3-cython_3.2.4.bb
index 3e889857e1..c39473be7b 100644
--- a/meta/recipes-devtools/python/python3-cython_3.2.4.bb
+++ b/meta/recipes-devtools/python/python3-cython_3.2.4.bb
@@ -25,7 +25,7 @@  do_install:append() {
     mv ${D}${bindir}/cygdb ${D}${bindir}/cygdb3
 }
 
-RDEPENDS:${PN}:class-target += "\
+RDEPENDS:${PN}:append:class-target = " \
     python3-misc \
     python3-netserver \
     python3-pkgutil \
@@ -35,7 +35,7 @@  RDEPENDS:${PN}:class-target += "\
     python3-xml \
 "
 
-RDEPENDS:${PN}:class-nativesdk += "\
+RDEPENDS:${PN}:append:class-nativesdk = " \
     nativesdk-python3-misc \
     nativesdk-python3-netserver \
     nativesdk-python3-pkgutil \
diff --git a/meta/recipes-devtools/python/python3-ply_3.11.bb b/meta/recipes-devtools/python/python3-ply_3.11.bb
index 2c5fa3f215..69c0b839c6 100644
--- a/meta/recipes-devtools/python/python3-ply_3.11.bb
+++ b/meta/recipes-devtools/python/python3-ply_3.11.bb
@@ -9,7 +9,7 @@  SRC_URI[sha256sum] = "00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446
 
 inherit pypi setuptools3
 
-RDEPENDS:${PN}:class-target += "\
+RDEPENDS:${PN}:append:class-target = " \
     python3-netclient \
     python3-shell \
 "
diff --git a/meta/recipes-devtools/python/python3-pyasn1_0.6.2.bb b/meta/recipes-devtools/python/python3-pyasn1_0.6.2.bb
index 01157e251e..a6eb561bf4 100644
--- a/meta/recipes-devtools/python/python3-pyasn1_0.6.2.bb
+++ b/meta/recipes-devtools/python/python3-pyasn1_0.6.2.bb
@@ -7,7 +7,7 @@  SRC_URI[sha256sum] = "9b59a2b25ba7e4f8197db7686c09fb33e658b98339fadb826e95126290
 
 inherit pypi python_setuptools_build_meta ptest-python-pytest
 
-RDEPENDS:${PN}:class-target += " \
+RDEPENDS:${PN}:append:class-target = " \
     python3-codecs \
     python3-logging \
     python3-math \
diff --git a/meta/recipes-devtools/python/python3-pycparser_3.0.bb b/meta/recipes-devtools/python/python3-pycparser_3.0.bb
index c17be9b2d4..ef6f48d0e5 100644
--- a/meta/recipes-devtools/python/python3-pycparser_3.0.bb
+++ b/meta/recipes-devtools/python/python3-pycparser_3.0.bb
@@ -9,11 +9,11 @@  inherit pypi python_setuptools_build_meta
 
 BBCLASSEXTEND = "native nativesdk"
 
-RDEPENDS:${PN}:class-target += "\
+RDEPENDS:${PN}:append:class-target = " \
     python3-netclient \
 "
 
-RSUGGESTS:${PN}:class-target += "\
+RSUGGESTS:${PN}:append:class-target = " \
     cpp \
     cpp-symlinks \
     "
diff --git a/meta/recipes-devtools/python/python3-pysocks_1.7.1.bb b/meta/recipes-devtools/python/python3-pysocks_1.7.1.bb
index dbf0fb0ee6..ce7f0fb7cf 100644
--- a/meta/recipes-devtools/python/python3-pysocks_1.7.1.bb
+++ b/meta/recipes-devtools/python/python3-pysocks_1.7.1.bb
@@ -10,7 +10,7 @@  UPSTREAM_CHECK_PYPI_PACKAGE = "${PYPI_PACKAGE}"
 
 inherit pypi setuptools3
 
-RDEPENDS:${PN}:class-target += "\
+RDEPENDS:${PN}:append:class-target = " \
     python3-email \
     python3-io \
     python3-logging \
diff --git a/meta/recipes-devtools/python/python3-pytz_2025.2.bb b/meta/recipes-devtools/python/python3-pytz_2025.2.bb
index 86bfceadc8..07ae7ac702 100644
--- a/meta/recipes-devtools/python/python3-pytz_2025.2.bb
+++ b/meta/recipes-devtools/python/python3-pytz_2025.2.bb
@@ -9,7 +9,7 @@  PTEST_PYTEST_DIR = "pytz/tests"
 
 SRC_URI[sha256sum] = "360b9e3dbb49a209c21ad61809c7fb453643e048b38924c765813546746e81c3"
 
-RDEPENDS:${PN}:class-target += "\
+RDEPENDS:${PN}:append:class-target = " \
     python3-datetime \
     python3-doctest \
     python3-io \
diff --git a/meta/recipes-devtools/qemu/qemu_10.2.0.bb b/meta/recipes-devtools/qemu/qemu_10.2.0.bb
index 5d544d8d13..1abc035a47 100644
--- a/meta/recipes-devtools/qemu/qemu_10.2.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_10.2.0.bb
@@ -9,7 +9,7 @@  DEPENDS:append:libc-musl = " libucontext"
 CFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', '-DEGL_NO_X11=1', d)}"
 LDFLAGS:append:toolchain-clang:x86 = " -latomic"
 
-RDEPENDS:${PN}-common:class-target += "bash"
+RDEPENDS:${PN}-common:append:class-target = " bash"
 
 EXTRA_OECONF:append:class-target = " --target-list=${@get_qemu_target_list(d)}"
 EXTRA_OECONF:append:class-target:mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}"
diff --git a/meta/recipes-kernel/systemtap/systemtap_5.4.bb b/meta/recipes-kernel/systemtap/systemtap_5.4.bb
index 254bac4d6f..f319aa54fd 100644
--- a/meta/recipes-kernel/systemtap/systemtap_5.4.bb
+++ b/meta/recipes-kernel/systemtap/systemtap_5.4.bb
@@ -52,7 +52,7 @@  FILES:${PN}-runtime = "\
  ${bindir}/stapsh \
  ${libexecdir}/${BPN}/stapio \
 "
-RDEPENDS:${PN}:class-target += "${PN}-runtime"
+RDEPENDS:${PN}:append:class-target = " ${PN}-runtime"
 
 PACKAGES =+ "${PN}-examples"
 FILES:${PN}-examples = "${datadir}/${BPN}/examples/"