linux-custom: Fix multiple provider warning when compat mode is active

Message ID fbc783b6-a271-4bde-824a-f2c1bf38b19c@siemens.com
State Accepted, archived
Headers show
Series linux-custom: Fix multiple provider warning when compat mode is active | expand

Commit Message

Jan Kiszka Aug. 12, 2024, 7:50 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

As the comment explains: When ISAR_ENABLE_COMPAT_ARCH is enabled, we
get the -compat variant of the recipe, but that will also provide
${BPN}-pseudo-native because of it pre-existing ending. This leads to

NOTE: Multiple providers are available for linux-mainline-pseudo-native (linux-mainline, linux-mainline-compat)
Consider defining a PREFERRED_PROVIDER entry to match linux-mainline-pseudo-native

Resolve that by only providing this pseudo target via the base recipe.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

And I thought we already covered all possible corner cases...

 meta/recipes-kernel/linux/linux-custom.inc | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Uladzimir Bely Aug. 15, 2024, 4:40 a.m. UTC | #1
On Mon, 2024-08-12 at 21:50 +0200, 'Jan Kiszka' via isar-users wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> As the comment explains: When ISAR_ENABLE_COMPAT_ARCH is enabled, we
> get the -compat variant of the recipe, but that will also provide
> ${BPN}-pseudo-native because of it pre-existing ending. This leads to
> 
> NOTE: Multiple providers are available for linux-mainline-pseudo-
> native (linux-mainline, linux-mainline-compat)
> Consider defining a PREFERRED_PROVIDER entry to match linux-mainline-
> pseudo-native
> 
> Resolve that by only providing this pseudo target via the base
> recipe.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> And I thought we already covered all possible corner cases...
> 
>  meta/recipes-kernel/linux/linux-custom.inc | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> b/meta/recipes-kernel/linux/linux-custom.inc
> index 6aa70fd3..f8f66cb3 100644
> --- a/meta/recipes-kernel/linux/linux-custom.inc
> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> @@ -156,6 +156,10 @@ RECIPE_PROVIDES:remove:cross-profile = " \
>      linux-headers-${KERNEL_NAME_PROVIDED} \
>      linux-kbuild-${KERNEL_NAME_PROVIDED}"
>  
> +# As the multiarch class will not append -compat to -pseudo-native,
> we end up
> +# with two providers of it. Remove the wrong one.
> +RECIPE_PROVIDES:remove:class-compat = "${BPN}-pseudo-native"
> +
>  # Append headers depends
>  HEADERS_DEPENDS = ", linux-kbuild-${KERNEL_NAME_PROVIDED} | linux-
> kbuild-${KERNEL_NAME_PROVIDED}-${DISTRO_ARCH}-cross"
>  KERNEL_HEADERS_DEBIAN_DEPENDS:append = "${HEADERS_DEPENDS}"
> -- 
> 2.43.0
> 

Applied to next, thanks.

Patch

diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 6aa70fd3..f8f66cb3 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -156,6 +156,10 @@  RECIPE_PROVIDES:remove:cross-profile = " \
     linux-headers-${KERNEL_NAME_PROVIDED} \
     linux-kbuild-${KERNEL_NAME_PROVIDED}"
 
+# As the multiarch class will not append -compat to -pseudo-native, we end up
+# with two providers of it. Remove the wrong one.
+RECIPE_PROVIDES:remove:class-compat = "${BPN}-pseudo-native"
+
 # Append headers depends
 HEADERS_DEPENDS = ", linux-kbuild-${KERNEL_NAME_PROVIDED} | linux-kbuild-${KERNEL_NAME_PROVIDED}-${DISTRO_ARCH}-cross"
 KERNEL_HEADERS_DEBIAN_DEPENDS:append = "${HEADERS_DEPENDS}"