mbox series

[0/4] switch from :append to +=

Message ID 20230216105640.147967-1-mikko.rapeli@linaro.org
Headers show
Series switch from :append to += | expand

Message

Mikko Rapeli Feb. 16, 2023, 10:56 a.m. UTC
When using meta-arm with product specific layers, it is hard to
update optee-os recipe to newer version while still using the main
recipe and include files from meta-arm. This is because meta-arm
recipe uses :append to apply changes to recipe variables and those can
not be easily overwritten in other layers via bbappends. Anything
added with :append can only be removed via explicit :remove for the same
string, e.g. patch file name which is not possible to know in advance.

If += is used in meta-arm side recipes, then bbappends in other layers
can overwrite the variables when they know better, for example when
updating optee-os recipe from version 3.19 to 3.20. This is done
in an optee-os_%.bbappend file by overwriting the SRC_URI,
PV and SRCREV variables.

This same pattern is used with a lot of variables so try to find and fix
all of them. Hopefully there are no regressions due to :append and +=
being applied in different order to the result variable.

Mikko Rapeli (4):
  meta-arm-bsp/conf: switch from :append to +=
  generic-arm64.conf: switch from :append to +=
  meta-arm: switch from :append to +=
  meta-arm-bsp: switch from :append to +=

 meta-arm-bsp/conf/machine/corstone500.conf    |  2 +-
 .../conf/machine/fvp-baser-aemv8r64.conf      |  4 +-
 .../conf/machine/include/corstone1000.inc     |  2 +-
 meta-arm-bsp/conf/machine/n1sdp.conf          |  2 +-
 meta-arm-bsp/conf/machine/sgi575.conf         |  2 +-
 ...oot-wrapper-aarch64-fvp-baser-aemv8r64.inc |  4 +-
 .../recipes-bsp/hafnium/hafnium-tc.inc        |  4 +-
 .../scp-firmware/scp-firmware-juno.inc        |  2 +-
 .../scp-firmware/scp-firmware-n1sdp.inc       |  2 +-
 .../trusted-firmware-a-corstone1000.inc       | 34 +++++------
 .../trusted-firmware-a-corstone500.inc        | 16 ++---
 .../trusted-firmware-a-fvp-arm32.inc          |  5 +-
 .../trusted-firmware-a-juno.inc               |  2 +-
 .../trusted-firmware-a-n1sdp.inc              | 18 +++---
 .../trusted-firmware-a-tc.inc                 |  4 +-
 .../recipes-bsp/uefi/edk2-firmware-n1sdp.inc  |  2 +-
 .../linux/linux-arm64-ack-clang.inc           |  2 +-
 .../recipes-kernel/linux/linux-yocto_5.19.bb  |  8 +--
 .../optee/optee-os-corstone1000-common.inc    |  6 +-
 .../recipes-security/optee/optee-os-n1sdp.inc |  4 +-
 meta-arm/conf/machine/generic-arm64.conf      |  2 +-
 .../trusted-firmware-a/trusted-firmware-a.inc |  8 +--
 .../recipes-kernel/linux/arm-ffa-5.15.inc     |  4 +-
 .../linux/arm-ffa-transport.inc               |  4 +-
 .../optee-ftpm/optee-os_%.bbappend            | 11 ++--
 .../recipes-security/optee/optee-os-3_19.inc  |  7 +--
 .../recipes-security/optee/optee-os-ts.inc    | 58 +++++++++----------
 meta-arm/recipes-security/optee/optee-os.inc  |  7 +--
 .../recipes-security/optee/optee-os_3.18.0.bb |  4 +-
 .../recipes-security/optee/optee-os_3.19.0.bb |  6 +-
 .../optee/optee-test_3.18.0.bb                |  4 +-
 .../trusted-services/trusted-services.inc     |  2 +-
 32 files changed, 118 insertions(+), 124 deletions(-)

Comments

Ross Burton Feb. 16, 2023, 11:15 a.m. UTC | #1
On 16 Feb 2023, at 10:56, Mikko Rapeli via lists.yoctoproject.org <mikko.rapeli=linaro.org@lists.yoctoproject.org> wrote:
> This same pattern is used with a lot of variables so try to find and fix
> all of them. Hopefully there are no regressions due to :append and +=
> being applied in different order to the result variable.

That’s a pretty huge “hopefully”.

Did you just blanket change every :append, and did you verify that the parsed datastore is unchanged?

Ross
Mikko Rapeli Feb. 16, 2023, 11:27 a.m. UTC | #2
Hi,

On Thu, Feb 16, 2023 at 11:15:42AM +0000, Ross Burton wrote:
> On 16 Feb 2023, at 10:56, Mikko Rapeli via lists.yoctoproject.org <mikko.rapeli=linaro.org@lists.yoctoproject.org> wrote:
> > This same pattern is used with a lot of variables so try to find and fix
> > all of them. Hopefully there are no regressions due to :append and +=
> > being applied in different order to the result variable.
> 
> That’s a pretty huge “hopefully”.

Yep :) It's a risk which I'm highlighting.

> Did you just blanket change every :append, and did you verify that the parsed datastore is unchanged?

I did not verify the data store. I'm in the process of changing our setup from
kirkstone to master for a number of boards and this became a blocking issue at recipe
parsing time.

In our setup we may not be using all these recipes and appends so I
would need help validating this. For optee-os recipes, the changes work
correctly and we can now update the recipe from our layer.

How should I validate this more? A world "bitbake -e" output before and
after? Which machines?

I did check the details several times and the changes make sense to me.
There may be some corner case which I did not spot, for example variable
being appended to and then bbclass inherited later which would break
with switch to +=.

Cheers,

-Mikko