diff mbox series

[v2,5/8] debug_build.inc: allow other layers to add their own debug build configurations

Message ID 20250915061743.313230-5-hongxu.jia@windriver.com
State New
Headers show
Series [1/8] yocto-space-optimize.inc: move space optimize from recipe webkitgtk | expand

Commit Message

Hongxu Jia Sept. 15, 2025, 6:17 a.m. UTC
When DEBUG_BUILD is enabled, allow other layers to add their own
debug build configurations

Suggested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/conf/distro/include/debug_build.inc | 3 +++
 1 file changed, 3 insertions(+)

Comments

Peter Kjellerstedt Sept. 16, 2025, 12:25 a.m. UTC | #1
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of hongxu via lists.openembedded.org
> Sent: den 15 september 2025 08:17
> To: openembedded-core@lists.openembedded.org
> Cc: randy.macleod@windriver.com; Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> Subject: [OE-core] [PATCH v2 5/8] debug_build.inc: allow other layers to add their own debug build configurations
> 
> When DEBUG_BUILD is enabled, allow other layers to add their own
> debug build configurations
> 
> Suggested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  meta/conf/distro/include/debug_build.inc | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/meta/conf/distro/include/debug_build.inc b/meta/conf/distro/include/debug_build.inc
> index 43d5ae59d53..f594df4b107 100644
> --- a/meta/conf/distro/include/debug_build.inc
> +++ b/meta/conf/distro/include/debug_build.inc
> @@ -43,3 +43,6 @@ EXTRA_OECONF:append:pn-nativesdk-debugedit = " --disable-inlined-xxhash"
>  lcl_maybe_fortify:pn-vim = ""
> 
>  CXXFLAGS:append:pn-vulkan-validation-layers = " -DXXH_NO_INLINE_HINTS=1"
> +
> +# Allow other layers to add their own debug build configurations
> +include_all conf/include/debug_build.inc

I think it is a bad idea to have this file in conf/distro/include/debug_build.inc
and then expect other layers to have it in conf/include/debug_build.inc. That is 
bound to result in confusing mistakes. However, since you said that you could not 
use the include_all in bitbake.conf as you got an error due to the conditional 
include, I took a look at it. From what I can tell, the fact that you get an 
error is due to a bug in include_all, where it does not behave like include and 
require do when it comes to empty variable expansions. 

I have sent a stack of changes to the bitbake list that corrects the behavior for 
include_all so it works like include and require do. With that applied, you should 
be able to use the include_all directly in bitbake.conf instead.

> --
> 2.34.1

//Peter
hongxu Sept. 16, 2025, 3:59 a.m. UTC | #2
On Mon, Sep 15, 2025 at 05:25 PM, Peter Kjellerstedt wrote:

> 
> 
>> diff --git a/meta/conf/distro/include/debug_build.inc
>> b/meta/conf/distro/include/debug_build.inc
>> index 43d5ae59d53..f594df4b107 100644
>> --- a/meta/conf/distro/include/debug_build.inc
>> +++ b/meta/conf/distro/include/debug_build.inc
>> @@ -43,3 +43,6 @@ EXTRA_OECONF:append:pn-nativesdk-debugedit = "
>> --disable-inlined-xxhash"
>> lcl_maybe_fortify:pn-vim = ""
>> 
>> CXXFLAGS:append:pn-vulkan-validation-layers = " -DXXH_NO_INLINE_HINTS=1"
>> +
>> +# Allow other layers to add their own debug build configurations
>> +include_all conf/include/debug_build.inc
> 
> I think it is a bad idea to have this file in
> conf/distro/include/debug_build.inc
> and then expect other layers to have it in conf/include/debug_build.inc.
> That is
> bound to result in confusing mistakes. However, since you said that you
> could not
> use the include_all in bitbake.conf as you got an error due to the
> conditional
> include, I took a look at it. From what I can tell, the fact that you get
> an
> error is due to a bug in include_all, where it does not behave like
> include and
> require do when it comes to empty variable expansions.
> 
> I have sent a stack of changes to the bitbake list that corrects the
> behavior for
> include_all so it works like include and require do. With that applied,
> you should
> be able to use the include_all directly in bitbake.conf instead.

I will move it to original meta/conf/bitbake.conf,
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -830,7 +830,9 @@ include conf/licenses.conf
require conf/sanity.conf
include conf/bblock.conf

-require ${@oe.utils.vartrue('DEBUG_BUILD', 'conf/distro/include/debug_build.inc', '', d)}
+# Allow other layers to add their own debug build configurations
+include_all ${@oe.utils.vartrue('DEBUG_BUILD', 'conf/distro/include/debug_build.inc', '', d)}

But as you said, it depends on bitbake commit [1] merged, so I still keep it as a standalone patch

[1] https://lists.openembedded.org/g/bitbake-devel/message/18037?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3ACreated%2C%2C%2C20%2C2%2C0%2C115265193%2Cd%253D3&d=3

//Hongxu

> 
> 
>> --
>> 2.34.1
> 
>
diff mbox series

Patch

diff --git a/meta/conf/distro/include/debug_build.inc b/meta/conf/distro/include/debug_build.inc
index 43d5ae59d53..f594df4b107 100644
--- a/meta/conf/distro/include/debug_build.inc
+++ b/meta/conf/distro/include/debug_build.inc
@@ -43,3 +43,6 @@  EXTRA_OECONF:append:pn-nativesdk-debugedit = " --disable-inlined-xxhash"
 lcl_maybe_fortify:pn-vim = ""
 
 CXXFLAGS:append:pn-vulkan-validation-layers = " -DXXH_NO_INLINE_HINTS=1"
+
+# Allow other layers to add their own debug build configurations
+include_all conf/include/debug_build.inc