mbox series

[v2,00/12] Confusing and invalid conditional appends

Message ID 20260317-fix-invalid-appends-v2-0-5c65ae5787d9@gmail.com
Headers show
Series Confusing and invalid conditional appends | expand

Message

Michal Sieron March 17, 2026, 12:03 a.m. UTC
This patchset 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.

In most places the override that was happening was harmless as there was
no value that was being overriden, but that wasn't the case 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 "

---
Changes in v2:
- Split initial single commit into smaller ones
- Described actual impact on the overriden variables
- Added some recipes that I missed last time
- Link to v1: https://lore.kernel.org/r/20260314-fix-invalid-appends-v1-1-03ec0bff6942@gmail.com

---
Michal Sieron (12):
      libffi: Fix invalid conditional append
      coreutils: Convert confusing append to override syntax
      expat: Convert confusing append to override syntax
      tune-power[567]: Remove confusing overrides
      no-gplv3.inc: Convert confusing appends to override syntax
      bootchart2: Convert confusing appends to override syntax
      pigz: Convert confusing append to override syntax
      systemtap: Convert confusing append to override syntax
      ovmf: Convert confusing append to override syntax
      dnf: Convert confusing append to override syntax
      qemu: Convert confusing append to override syntax
      recipes-devtools/python: Convert confusing appends to override syntax

 meta/conf/distro/include/no-gplv3.inc                    |  4 ++--
 meta/conf/machine/include/powerpc/tune-power5.inc        |  3 +--
 meta/conf/machine/include/powerpc/tune-power6.inc        |  3 +--
 meta/conf/machine/include/powerpc/tune-power7.inc        |  3 +--
 meta/recipes-core/coreutils/coreutils_9.10.bb            |  4 ++--
 meta/recipes-core/expat/expat_2.7.4.bb                   |  2 +-
 meta/recipes-core/ovmf/ovmf_git.bb                       |  2 +-
 meta/recipes-devtools/bootchart2/bootchart2_0.14.9.bb    | 10 +++++-----
 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-extended/pigz/pigz_2.8.bb                   |  2 +-
 meta/recipes-kernel/systemtap/systemtap_5.4.bb           |  2 +-
 meta/recipes-support/libffi/libffi_3.5.2.bb              |  2 +-
 22 files changed, 30 insertions(+), 33 deletions(-)
---
base-commit: f5e62a13cbe17947baa387c723422bc8ca766d34
change-id: 20260314-fix-invalid-appends-cf5197ef2f07

Best regards,

Comments

Khem Raj March 17, 2026, 12:50 a.m. UTC | #1
If you have scripted it then it would be great to see this run on
meta-openembedded repository as well and see if there are some
instances existing there too.

On Mon, Mar 16, 2026 at 5:03 PM Michal Sieron via lists.openembedded.org
<michalwsieron=gmail.com@lists.openembedded.org> wrote:

> This patchset 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.
>
> In most places the override that was happening was harmless as there was
> no value that was being overriden, but that wasn't the case 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 "
>
> ---
> Changes in v2:
> - Split initial single commit into smaller ones
> - Described actual impact on the overriden variables
> - Added some recipes that I missed last time
> - Link to v1:
> https://lore.kernel.org/r/20260314-fix-invalid-appends-v1-1-03ec0bff6942@gmail.com
>
> ---
> Michal Sieron (12):
>       libffi: Fix invalid conditional append
>       coreutils: Convert confusing append to override syntax
>       expat: Convert confusing append to override syntax
>       tune-power[567]: Remove confusing overrides
>       no-gplv3.inc: Convert confusing appends to override syntax
>       bootchart2: Convert confusing appends to override syntax
>       pigz: Convert confusing append to override syntax
>       systemtap: Convert confusing append to override syntax
>       ovmf: Convert confusing append to override syntax
>       dnf: Convert confusing append to override syntax
>       qemu: Convert confusing append to override syntax
>       recipes-devtools/python: Convert confusing appends to override syntax
>
>  meta/conf/distro/include/no-gplv3.inc                    |  4 ++--
>  meta/conf/machine/include/powerpc/tune-power5.inc        |  3 +--
>  meta/conf/machine/include/powerpc/tune-power6.inc        |  3 +--
>  meta/conf/machine/include/powerpc/tune-power7.inc        |  3 +--
>  meta/recipes-core/coreutils/coreutils_9.10.bb            |  4 ++--
>  meta/recipes-core/expat/expat_2.7.4.bb                   |  2 +-
>  meta/recipes-core/ovmf/ovmf_git.bb                       |  2 +-
>  meta/recipes-devtools/bootchart2/bootchart2_0.14.9.bb    | 10 +++++-----
>  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-extended/pigz/pigz_2.8.bb                   |  2 +-
>  meta/recipes-kernel/systemtap/systemtap_5.4.bb           |  2 +-
>  meta/recipes-support/libffi/libffi_3.5.2.bb              |  2 +-
>  22 files changed, 30 insertions(+), 33 deletions(-)
> ---
> base-commit: f5e62a13cbe17947baa387c723422bc8ca766d34
> change-id: 20260314-fix-invalid-appends-cf5197ef2f07
>
> Best regards,
> --
> Michal Sieron <michalwsieron@gmail.com>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#233273):
> https://lists.openembedded.org/g/openembedded-core/message/233273
> Mute This Topic: https://lists.openembedded.org/mt/118356432/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Michal Sieron March 17, 2026, 7:09 p.m. UTC | #2
I actually extended existing check in oelint-adv [1] and did run it on meta-openembedded already [2].
I first wanted to see what is the response from upstream and how those changes should look like.
Once oe-core changes are merged and I find time, I will split and cleanup that commit for meta-oe.

[1]: https://github.com/priv-kweihmann/oelint-adv/pull/857
[2]: https://github.com/michalsieron/meta-openembedded/commit/cc5d9c473c337b9830d102c2e235e53f4a8a4b6a