diff mbox series

u-boot: Fix u-boot-tools-native build after DTC update

Message ID 20260429001811.2723886-1-festevam@gmail.com
State Under Review
Headers show
Series u-boot: Fix u-boot-tools-native build after DTC update | expand

Commit Message

Fabio Estevam April 29, 2026, 12:18 a.m. UTC
From: Marek Vasut <marek.vasut@mailbox.org>

Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
build will surely not find host /usr/include/yaml.h file and
will disable yamltree build. For details, see U-Boot commit
807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot").

Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 meta/recipes-bsp/u-boot/u-boot-tools.inc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Richard Purdie April 29, 2026, 8:03 a.m. UTC | #1
On Tue, 2026-04-28 at 21:18 -0300, Fabio Estevam via lists.openembedded.org wrote:
> From: Marek Vasut <marek.vasut@mailbox.org>
> 
> Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
> build will surely not find host /usr/include/yaml.h file and
> will disable yamltree build. For details, see U-Boot commit
> 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot").
> 
> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>  meta/recipes-bsp/u-boot/u-boot-tools.inc | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-bsp/u-boot/u-boot-tools.inc b/meta/recipes-bsp/u-boot/u-boot-tools.inc
> index a055409c2cb0..071746b64e24 100644
> --- a/meta/recipes-bsp/u-boot/u-boot-tools.inc
> +++ b/meta/recipes-bsp/u-boot/u-boot-tools.inc
> @@ -1,5 +1,5 @@
>  SUMMARY = "U-Boot bootloader tools"
> -DEPENDS += "gnutls openssl util-linux swig-native libyaml-native"
> +DEPENDS += "gnutls openssl util-linux swig-native"
>  
>  inherit python3native
>  export STAGING_INCDIR = "${STAGING_INCDIR_NATIVE}"
> @@ -88,3 +88,8 @@ RDEPENDS:${PN}:class-native = ""
>  
>  BBCLASSEXTEND = "native nativesdk"
>  
> +# Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
> +# build will surely not find host /usr/include/yaml.h file and
> +# will disable yamltree build. For details, see U-Boot commit
> +# 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot")
> +PKG_CONFIG_SYSROOT_DIR:prepend = "/invalid/"

This feels a bit like a hack. Is there not a config option we can pass
to u-boot to make this deterministic, i.e. always disable libyaml?

Cheers,

Richard
Marek Vasut April 29, 2026, 8:36 a.m. UTC | #2
On 4/29/26 10:03 AM, Richard Purdie wrote:
> On Tue, 2026-04-28 at 21:18 -0300, Fabio Estevam via lists.openembedded.org wrote:
>> From: Marek Vasut <marek.vasut@mailbox.org>
>>
>> Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>> build will surely not find host /usr/include/yaml.h file and
>> will disable yamltree build. For details, see U-Boot commit
>> 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot").
>>
>> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
>> Signed-off-by: Fabio Estevam <festevam@gmail.com>
>> ---
>>   meta/recipes-bsp/u-boot/u-boot-tools.inc | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-bsp/u-boot/u-boot-tools.inc b/meta/recipes-bsp/u-boot/u-boot-tools.inc
>> index a055409c2cb0..071746b64e24 100644
>> --- a/meta/recipes-bsp/u-boot/u-boot-tools.inc
>> +++ b/meta/recipes-bsp/u-boot/u-boot-tools.inc
>> @@ -1,5 +1,5 @@
>>   SUMMARY = "U-Boot bootloader tools"
>> -DEPENDS += "gnutls openssl util-linux swig-native libyaml-native"
>> +DEPENDS += "gnutls openssl util-linux swig-native"
>>   
>>   inherit python3native
>>   export STAGING_INCDIR = "${STAGING_INCDIR_NATIVE}"
>> @@ -88,3 +88,8 @@ RDEPENDS:${PN}:class-native = ""
>>   
>>   BBCLASSEXTEND = "native nativesdk"
>>   
>> +# Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>> +# build will surely not find host /usr/include/yaml.h file and
>> +# will disable yamltree build. For details, see U-Boot commit
>> +# 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot")
>> +PKG_CONFIG_SYSROOT_DIR:prepend = "/invalid/"
> 
> This feels a bit like a hack. Is there not a config option we can pass
> to u-boot to make this deterministic, i.e. always disable libyaml?
Currently there is not, but Linux did drop the whole yamltree part in 
ef8795f3f1ce ("dt-bindings: kbuild: Use DTB files for validation") and 
U-Boot should do the same. This path change is the minimum invasive 
change to achieve disabled yamltree with current U-Boot, until this is 
fixed upstream the same way Linux fixed it.
Joao Marcos Costa April 29, 2026, 8:43 a.m. UTC | #3
Hello,

On 4/29/26 10:03, Richard Purdie via lists.openembedded.org wrote:
> On Tue, 2026-04-28 at 21:18 -0300, Fabio Estevam via lists.openembedded.org wrote:
>> From: Marek Vasut <marek.vasut@mailbox.org>
>>
>> Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>> build will surely not find host /usr/include/yaml.h file and
>> will disable yamltree build. For details, see U-Boot commit
>> 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot").
>>
>> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
>> Signed-off-by: Fabio Estevam <festevam@gmail.com>
(...)
>>   
>> +# Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>> +# build will surely not find host /usr/include/yaml.h file and
>> +# will disable yamltree build. For details, see U-Boot commit
>> +# 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot")
>> +PKG_CONFIG_SYSROOT_DIR:prepend = "/invalid/"
> 
> This feels a bit like a hack. Is there not a config option we can pass
> to u-boot to make this deterministic, i.e. always disable libyaml?
> 
> Cheers,
> 
> Richard

Maybe setting/appending "-DNO_YAML" at HOST_EXTRACFLAGS (e.g., through 
EXTRA_OEMAKE or BUILD_CFLAGS)?

In the end, that's a direct consequence of having an invalid 
PKG_CONFIG_SYSROOT_DIR:
https://github.com/u-boot/u-boot/blob/master/scripts/dtc/Makefile#L21

It is still kind of a hack, though, but I hope it helps!
Richard Purdie April 29, 2026, 8:56 a.m. UTC | #4
On Wed, 2026-04-29 at 10:36 +0200, Marek Vasut wrote:
> On 4/29/26 10:03 AM, Richard Purdie wrote:
> > On Tue, 2026-04-28 at 21:18 -0300, Fabio Estevam via lists.openembedded.org wrote:
> > > From: Marek Vasut <marek.vasut@mailbox.org>
> > > 
> > > Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
> > > build will surely not find host /usr/include/yaml.h file and
> > > will disable yamltree build. For details, see U-Boot commit
> > > 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot").
> > > 
> > > Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
> > > Signed-off-by: Fabio Estevam <festevam@gmail.com>
> > > ---
> > >   meta/recipes-bsp/u-boot/u-boot-tools.inc | 7 ++++++-
> > >   1 file changed, 6 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/meta/recipes-bsp/u-boot/u-boot-tools.inc b/meta/recipes-bsp/u-boot/u-boot-tools.inc
> > > index a055409c2cb0..071746b64e24 100644
> > > --- a/meta/recipes-bsp/u-boot/u-boot-tools.inc
> > > +++ b/meta/recipes-bsp/u-boot/u-boot-tools.inc
> > > @@ -1,5 +1,5 @@
> > >   SUMMARY = "U-Boot bootloader tools"
> > > -DEPENDS += "gnutls openssl util-linux swig-native libyaml-native"
> > > +DEPENDS += "gnutls openssl util-linux swig-native"
> > >   
> > >   inherit python3native
> > >   export STAGING_INCDIR = "${STAGING_INCDIR_NATIVE}"
> > > @@ -88,3 +88,8 @@ RDEPENDS:${PN}:class-native = ""
> > >   
> > >   BBCLASSEXTEND = "native nativesdk"
> > >   
> > > +# Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
> > > +# build will surely not find host /usr/include/yaml.h file and
> > > +# will disable yamltree build. For details, see U-Boot commit
> > > +# 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot")
> > > +PKG_CONFIG_SYSROOT_DIR:prepend = "/invalid/"
> > 
> > This feels a bit like a hack. Is there not a config option we can pass
> > to u-boot to make this deterministic, i.e. always disable libyaml?
> Currently there is not, but Linux did drop the whole yamltree part in
> ef8795f3f1ce ("dt-bindings: kbuild: Use DTB files for validation") and 
> U-Boot should do the same. This path change is the minimum invasive 
> change to achieve disabled yamltree with current U-Boot, until this is 
> fixed upstream the same way Linux fixed it.

Lets just explicitly patch the code out then or something, I'm not sure
we need to be minimally invasive here.

I really don't like hacks which people may copy/propagate and which can
have interesting unintended side effects.

Cheers,

Richard
Quentin Schulz April 29, 2026, 9:01 a.m. UTC | #5
Hi,

On 4/29/26 10:43 AM, Joao Marcos Costa via lists.openembedded.org wrote:
> Hello,
> 
> On 4/29/26 10:03, Richard Purdie via lists.openembedded.org wrote:
>> On Tue, 2026-04-28 at 21:18 -0300, Fabio Estevam via 
>> lists.openembedded.org wrote:
>>> From: Marek Vasut <marek.vasut@mailbox.org>
>>>
>>> Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>>> build will surely not find host /usr/include/yaml.h file and
>>> will disable yamltree build. For details, see U-Boot commit
>>> 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot").
>>>
>>> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
>>> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> (...)
>>> +# Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>>> +# build will surely not find host /usr/include/yaml.h file and
>>> +# will disable yamltree build. For details, see U-Boot commit
>>> +# 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot")
>>> +PKG_CONFIG_SYSROOT_DIR:prepend = "/invalid/"
>>
>> This feels a bit like a hack. Is there not a config option we can pass
>> to u-boot to make this deterministic, i.e. always disable libyaml?
>>
>> Cheers,
>>
>> Richard
> 
> Maybe setting/appending "-DNO_YAML" at HOST_EXTRACFLAGS (e.g., through 
> EXTRA_OEMAKE or BUILD_CFLAGS)?
> 
> In the end, that's a direct consequence of having an invalid 
> PKG_CONFIG_SYSROOT_DIR:
> https://eur02.safelinks.protection.outlook.com/? 
> url=https%3A%2F%2Fgithub.com%2Fu-boot%2Fu- 
> boot%2Fblob%2Fmaster%2Fscripts%2Fdtc%2FMakefile%23L21&data=05%7C02%7Cquentin.schulz%40cherry.de%7C73feb8ea44e0468f38ea08dea5cb6a9f%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C639130490251925693%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=%2BbKkw2HVgw52EWv%2FxeSlWRZ%2Ba3%2F3ireKwMxCLBvIwyg%3D&reserved=0
> 
> It is still kind of a hack, though, but I hope it helps!
> 

dtc-objs will still contain yamltree and thus attempt to build it.

Fabio, you are not explaining why you don't want to add the libyaml 
dependency, Khem attempted to add it in 
https://lore.kernel.org/openembedded-core/20260412035757.134385-1-khem.raj@oss.qualcomm.com/ 
but I don't see any follow-up or statement it should be dropped.

I'm very much against setting a variable in the recipe that applies to 
all version of the recipes and will not be looked at again. Instead, add 
a patch for U-Boot that removes this (but again, why?) logic so that 
next time we do an upgrade there are more chances of someone looking at 
patches and trying to figure out if they are still needed.

In any case, we absolutely need a justification otherwise I'm afraid 
we'll never be able to do a cleanup because we don't know why it was 
needed in the first place. This is something that has happened already 
enough time for me in OE-Core/YP that it really is a PITA for upgrades 
and cleanups.

Cheers,
Quentin
Marek Vasut April 29, 2026, 9:47 a.m. UTC | #6
On 4/29/26 10:56 AM, Richard Purdie wrote:
> On Wed, 2026-04-29 at 10:36 +0200, Marek Vasut wrote:
>> On 4/29/26 10:03 AM, Richard Purdie wrote:
>>> On Tue, 2026-04-28 at 21:18 -0300, Fabio Estevam via lists.openembedded.org wrote:
>>>> From: Marek Vasut <marek.vasut@mailbox.org>
>>>>
>>>> Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>>>> build will surely not find host /usr/include/yaml.h file and
>>>> will disable yamltree build. For details, see U-Boot commit
>>>> 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot").
>>>>
>>>> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
>>>> Signed-off-by: Fabio Estevam <festevam@gmail.com>
>>>> ---
>>>>    meta/recipes-bsp/u-boot/u-boot-tools.inc | 7 ++++++-
>>>>    1 file changed, 6 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/meta/recipes-bsp/u-boot/u-boot-tools.inc b/meta/recipes-bsp/u-boot/u-boot-tools.inc
>>>> index a055409c2cb0..071746b64e24 100644
>>>> --- a/meta/recipes-bsp/u-boot/u-boot-tools.inc
>>>> +++ b/meta/recipes-bsp/u-boot/u-boot-tools.inc
>>>> @@ -1,5 +1,5 @@
>>>>    SUMMARY = "U-Boot bootloader tools"
>>>> -DEPENDS += "gnutls openssl util-linux swig-native libyaml-native"
>>>> +DEPENDS += "gnutls openssl util-linux swig-native"
>>>>    
>>>>    inherit python3native
>>>>    export STAGING_INCDIR = "${STAGING_INCDIR_NATIVE}"
>>>> @@ -88,3 +88,8 @@ RDEPENDS:${PN}:class-native = ""
>>>>    
>>>>    BBCLASSEXTEND = "native nativesdk"
>>>>    
>>>> +# Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>>>> +# build will surely not find host /usr/include/yaml.h file and
>>>> +# will disable yamltree build. For details, see U-Boot commit
>>>> +# 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot")
>>>> +PKG_CONFIG_SYSROOT_DIR:prepend = "/invalid/"
>>>
>>> This feels a bit like a hack. Is there not a config option we can pass
>>> to u-boot to make this deterministic, i.e. always disable libyaml?
>> Currently there is not, but Linux did drop the whole yamltree part in
>> ef8795f3f1ce ("dt-bindings: kbuild: Use DTB files for validation") and
>> U-Boot should do the same. This path change is the minimum invasive
>> change to achieve disabled yamltree with current U-Boot, until this is
>> fixed upstream the same way Linux fixed it.
> 
> Lets just explicitly patch the code out then or something, I'm not sure
> we need to be minimally invasive here.
> 
> I really don't like hacks which people may copy/propagate and which can
> have interesting unintended side effects.
This is fine by me. Let me comment on the email from Quentin real quick 
with a bit more elaborate patch plan.
Marek Vasut April 29, 2026, 9:51 a.m. UTC | #7
On 4/29/26 11:01 AM, Quentin Schulz wrote:
> Hi,
> 
> On 4/29/26 10:43 AM, Joao Marcos Costa via lists.openembedded.org wrote:
>> Hello,
>>
>> On 4/29/26 10:03, Richard Purdie via lists.openembedded.org wrote:
>>> On Tue, 2026-04-28 at 21:18 -0300, Fabio Estevam via 
>>> lists.openembedded.org wrote:
>>>> From: Marek Vasut <marek.vasut@mailbox.org>
>>>>
>>>> Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>>>> build will surely not find host /usr/include/yaml.h file and
>>>> will disable yamltree build. For details, see U-Boot commit
>>>> 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot").
>>>>
>>>> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
>>>> Signed-off-by: Fabio Estevam <festevam@gmail.com>
>> (...)
>>>> +# Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>>>> +# build will surely not find host /usr/include/yaml.h file and
>>>> +# will disable yamltree build. For details, see U-Boot commit
>>>> +# 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot")
>>>> +PKG_CONFIG_SYSROOT_DIR:prepend = "/invalid/"
>>>
>>> This feels a bit like a hack. Is there not a config option we can pass
>>> to u-boot to make this deterministic, i.e. always disable libyaml?
>>>
>>> Cheers,
>>>
>>> Richard
>>
>> Maybe setting/appending "-DNO_YAML" at HOST_EXTRACFLAGS (e.g., through 
>> EXTRA_OEMAKE or BUILD_CFLAGS)?
>>
>> In the end, that's a direct consequence of having an invalid 
>> PKG_CONFIG_SYSROOT_DIR:
>> https://eur02.safelinks.protection.outlook.com/? 
>> url=https%3A%2F%2Fgithub.com%2Fu-boot%2Fu- 
>> boot%2Fblob%2Fmaster%2Fscripts%2Fdtc%2FMakefile%23L21&data=05%7C02%7Cquentin.schulz%40cherry.de%7C73feb8ea44e0468f38ea08dea5cb6a9f%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C639130490251925693%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=%2BbKkw2HVgw52EWv%2FxeSlWRZ%2Ba3%2F3ireKwMxCLBvIwyg%3D&reserved=0
>>
>> It is still kind of a hack, though, but I hope it helps!
>>
> 
> dtc-objs will still contain yamltree and thus attempt to build it.
> 
> Fabio, you are not explaining why you don't want to add the libyaml 
> dependency, Khem attempted to add it in https://lore.kernel.org/ 
> openembedded-core/20260412035757.134385-1-khem.raj@oss.qualcomm.com/ but 
> I don't see any follow-up or statement it should be dropped.
> 
> I'm very much against setting a variable in the recipe that applies to 
> all version of the recipes and will not be looked at again. Instead, add 
> a patch for U-Boot that removes this (but again, why?) logic so that 
> next time we do an upgrade there are more chances of someone looking at 
> patches and trying to figure out if they are still needed.
> 
> In any case, we absolutely need a justification otherwise I'm afraid 
> we'll never be able to do a cleanup because we don't know why it was 
> needed in the first place. This is something that has happened already 
> enough time for me in OE-Core/YP that it really is a PITA for upgrades 
> and cleanups.
In short, see the U-Boot commit 807bcd844afe ("scripts/dtc: Fix 
pkg-config behavior under sysroot") referenced in the commit message of 
this patch, and the matching Linux kernel commit ef8795f3f1ce 
("dt-bindings: kbuild: Use DTB files for validation") .

I think we need to port that kernel commit to U-Boot, upstream that 
kernel commit (should be easy) and then add it here into OE too. Then it 
will be really a problem solved all over the place and case closed.
Quentin Schulz April 29, 2026, 9:54 a.m. UTC | #8
Hi Marek,

On 4/29/26 11:51 AM, Marek Vasut wrote:
> On 4/29/26 11:01 AM, Quentin Schulz wrote:
>> Hi,
>>
>> On 4/29/26 10:43 AM, Joao Marcos Costa via lists.openembedded.org wrote:
>>> Hello,
>>>
>>> On 4/29/26 10:03, Richard Purdie via lists.openembedded.org wrote:
>>>> On Tue, 2026-04-28 at 21:18 -0300, Fabio Estevam via 
>>>> lists.openembedded.org wrote:
>>>>> From: Marek Vasut <marek.vasut@mailbox.org>
>>>>>
>>>>> Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>>>>> build will surely not find host /usr/include/yaml.h file and
>>>>> will disable yamltree build. For details, see U-Boot commit
>>>>> 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot").
>>>>>
>>>>> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
>>>>> Signed-off-by: Fabio Estevam <festevam@gmail.com>
>>> (...)
>>>>> +# Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
>>>>> +# build will surely not find host /usr/include/yaml.h file and
>>>>> +# will disable yamltree build. For details, see U-Boot commit
>>>>> +# 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot")
>>>>> +PKG_CONFIG_SYSROOT_DIR:prepend = "/invalid/"
>>>>
>>>> This feels a bit like a hack. Is there not a config option we can pass
>>>> to u-boot to make this deterministic, i.e. always disable libyaml?
>>>>
>>>> Cheers,
>>>>
>>>> Richard
>>>
>>> Maybe setting/appending "-DNO_YAML" at HOST_EXTRACFLAGS (e.g., 
>>> through EXTRA_OEMAKE or BUILD_CFLAGS)?
>>>
>>> In the end, that's a direct consequence of having an invalid 
>>> PKG_CONFIG_SYSROOT_DIR:
>>> https://eur02.safelinks.protection.outlook.com/? 
>>> url=https%3A%2F%2Fgithub.com%2Fu-boot%2Fu- 
>>> boot%2Fblob%2Fmaster%2Fscripts%2Fdtc%2FMakefile%23L21&data=05%7C02%7Cquentin.schulz%40cherry.de%7C73feb8ea44e0468f38ea08dea5cb6a9f%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C639130490251925693%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=%2BbKkw2HVgw52EWv%2FxeSlWRZ%2Ba3%2F3ireKwMxCLBvIwyg%3D&reserved=0
>>>
>>> It is still kind of a hack, though, but I hope it helps!
>>>
>>
>> dtc-objs will still contain yamltree and thus attempt to build it.
>>
>> Fabio, you are not explaining why you don't want to add the libyaml 
>> dependency, Khem attempted to add it in https:// 
>> eur02.safelinks.protection.outlook.com/? 
>> url=https%3A%2F%2Flore.kernel.org%2F&data=05%7C02%7Cquentin.schulz%40cherry.de%7C51022e2ce9de4d74fada08dea5d4e18f%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C639130530938248835%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=fXgk4FZc6wnMD37AUWBnyJQBwmuAnjURis5JlZnT9iM%3D&reserved=0 openembedded-core/20260412035757.134385-1-khem.raj@oss.qualcomm.com/ but I don't see any follow-up or statement it should be dropped.
>>
>> I'm very much against setting a variable in the recipe that applies to 
>> all version of the recipes and will not be looked at again. Instead, 
>> add a patch for U-Boot that removes this (but again, why?) logic so 
>> that next time we do an upgrade there are more chances of someone 
>> looking at patches and trying to figure out if they are still needed.
>>
>> In any case, we absolutely need a justification otherwise I'm afraid 
>> we'll never be able to do a cleanup because we don't know why it was 
>> needed in the first place. This is something that has happened already 
>> enough time for me in OE-Core/YP that it really is a PITA for upgrades 
>> and cleanups.
> In short, see the U-Boot commit 807bcd844afe ("scripts/dtc: Fix pkg- 
> config behavior under sysroot") referenced in the commit message of this 
> patch, and the matching Linux kernel commit ef8795f3f1ce ("dt-bindings: 
> kbuild: Use DTB files for validation") .
> 

I know, I brought this up here: 
https://lore.kernel.org/openembedded-core/52fa5836-b061-4896-be48-673fca5ba3d4@cherry.de/

> I think we need to port that kernel commit to U-Boot, upstream that 
> kernel commit (should be easy) and then add it here into OE too. Then it 
> will be really a problem solved all over the place and case closed.

Yes, someone needs to do the work.

Cheers,
Quentin
Joao Marcos Costa April 29, 2026, 1:55 p.m. UTC | #9
Hello,

(...)

>> In short, see the U-Boot commit 807bcd844afe ("scripts/dtc: Fix pkg- 
>> config behavior under sysroot") referenced in the commit message of 
>> this patch, and the matching Linux kernel commit ef8795f3f1ce 
>> ("dt-bindings: kbuild: Use DTB files for validation") .
>>
> 
> I know, I brought this up here: 
> https://lore.kernel.org/openembedded-core/52fa5836-b061-4896-be48-673fca5ba3d4@cherry.de/
> 
>> I think we need to port that kernel commit to U-Boot, upstream that 
>> kernel commit (should be easy) and then add it here into OE too. Then 
>> it will be really a problem solved all over the place and case closed.
> 
> Yes, someone needs to do the work.
> 
> Cheers,
> Quentin

Just in case, I wrote the patch for that, and started the build to test 
it. Once I'm done testing, I will send it here and to U-Boot's mailing 
list as well.
diff mbox series

Patch

diff --git a/meta/recipes-bsp/u-boot/u-boot-tools.inc b/meta/recipes-bsp/u-boot/u-boot-tools.inc
index a055409c2cb0..071746b64e24 100644
--- a/meta/recipes-bsp/u-boot/u-boot-tools.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-tools.inc
@@ -1,5 +1,5 @@ 
 SUMMARY = "U-Boot bootloader tools"
-DEPENDS += "gnutls openssl util-linux swig-native libyaml-native"
+DEPENDS += "gnutls openssl util-linux swig-native"
 
 inherit python3native
 export STAGING_INCDIR = "${STAGING_INCDIR_NATIVE}"
@@ -88,3 +88,8 @@  RDEPENDS:${PN}:class-native = ""
 
 BBCLASSEXTEND = "native nativesdk"
 
+# Set PKG_CONFIG_SYSROOT_DIR as invalid path, so the host tools
+# build will surely not find host /usr/include/yaml.h file and
+# will disable yamltree build. For details, see U-Boot commit
+# 807bcd844afe ("scripts/dtc: Fix pkg-config behavior under sysroot")
+PKG_CONFIG_SYSROOT_DIR:prepend = "/invalid/"