Skip to contentSkip to conversation

debug_build: defer inherit bblcass debug_build when DEBUG_BUILD is true

PATCH New Hongxu Jia 2 participants 3 messages Sep 22, 2025 – Sep 29, 2025 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Hongxu Jia

author
#1 lore raw

PATCH v2 9/9 debug_build: defer inherit bblcass debug_build when DEBUG_BUILD is true

While setting DEBUG_BUILD = "1" in local.conf, the debug build is enabled globally. For the recipe (such as qemu) which doesn't work without optimization, we have to set DEBUG_BUILD = "0" in the recipe. In this situation, conf/distro/include/debug_build.inc is included, although set DEBUG_BUILD = "0" in qemu recipe, the debug build is still enabled for qemu and break qemu build.

This commit defer inherit bblcass debug_build when DEBUG_BUILD is true, then include_all so that debug_build.inc is only included if DEBUG_BUILD is actually set for a given recip

---
 meta/classes-global/base.bbclass        | 3 +++
 meta/classes-recipe/debug_build.bbclass | 8 ++++++++
 meta/conf/bitbake.conf                  | 2 --
 3 files changed, 11 insertions(+), 2 deletions(-)
 create mode 100644 meta/classes-recipe/debug_build.bbclass
meta/classes-global/base.bbclass +3 -0
index 6de17d1bb5..0f4398e26f 100644
@@ -35,6 +35,9 @@ TOOLCHAIN_NATIVE ??= "${PREFERRED_TOOLCHAIN_NATIVE}"
 inherit_defer toolchain/${TOOLCHAIN_NATIVE}-native
 inherit_defer toolchain/${TOOLCHAIN}
 
+DEBUG_BUILD ??= "0"
+inherit_defer ${@oe.utils.vartrue('DEBUG_BUILD', 'debug_build', '', d)}
+
 def lsb_distro_identifier(d):
     adjust = d.getVar('LSB_DISTRO_ADJUST')
     adjust_func = None
meta/classes-recipe/debug_build.bbclass new file +8 -0
new file mode 100644
index 0000000000..a917e9cbc9
@@ -0,0 +1,8 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+# Allow other layers to add their own debug build configurations
+include_all conf/distro/include/debug_build.inc
meta/conf/bitbake.conf +0 -2
index f9818d2a06..93fd57548d 100644
@@ -830,8 +830,6 @@ include conf/licenses.conf
 require conf/sanity.conf
 include conf/bblock.conf
 
-# Allow other layers to add their own debug build configurations
-include_all ${@oe.utils.vartrue('DEBUG_BUILD', 'conf/distro/include/debug_build.inc', '', d)}
 
 ##################################################################
 # Weak variables (usually to retain backwards compatibility)
Signature · 1 line
2.34.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#3 lore raw

Hi Mathieu,

Ping, or should I resend the whole series?

//Hongxu

Quoted 70 lines · hongxu via lists.openembedded.org

While setting DEBUG_BUILD = "1" in local.conf, the debug build is enabled globally. For the recipe (such as qemu) which doesn't work without optimization, we have to set DEBUG_BUILD = "0" in the recipe. In this situation, conf/distro/include/debug_build.inc is included, although set DEBUG_BUILD = "0" in qemu recipe, the debug build is still enabled for qemu and break qemu build.

This commit defer inherit bblcass debug_build when DEBUG_BUILD is true, then include_all so that debug_build.inc is only included if DEBUG_BUILD is actually set for a given recip

---
  meta/classes-global/base.bbclass        | 3 +++
  meta/classes-recipe/debug_build.bbclass | 8 ++++++++
  meta/conf/bitbake.conf                  | 2 --
  3 files changed, 11 insertions(+), 2 deletions(-)

create mode 100644 meta/classes-recipe/debug_build.bbclass

meta/classes-global/base.bbclass +3 -0
index 6de17d1bb5..0f4398e26f 100644
@@ -35,6 +35,9 @@ TOOLCHAIN_NATIVE ??= "${PREFERRED_TOOLCHAIN_NATIVE}"
  inherit_defer toolchain/${TOOLCHAIN_NATIVE}-native
  inherit_defer toolchain/${TOOLCHAIN}
 
+DEBUG_BUILD ??= "0"
+inherit_defer ${@oe.utils.vartrue('DEBUG_BUILD', 'debug_build', '', d)}
+
  def lsb_distro_identifier(d):
      adjust = d.getVar('LSB_DISTRO_ADJUST')
      adjust_func = None
meta/classes-recipe/debug_build.bbclass new file +8 -0
new file mode 100644
index 0000000000..a917e9cbc9
@@ -0,0 +1,8 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+# Allow other layers to add their own debug build configurations
+include_all conf/distro/include/debug_build.inc
meta/conf/bitbake.conf +0 -3
index f9818d2a06..93fd57548d 100644
@@ -830,8 +830,6 @@ include conf/licenses.conf
  require conf/sanity.conf
  include conf/bblock.conf
 
-# Allow other layers to add their own debug build configurations
-include_all ${@oe.utils.vartrue('DEBUG_BUILD', 'conf/distro/include/debug_build.inc', '', d)}
 
  ##################################################################
  # Weak variables (usually to retain backwards compatibility)
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#223806): https://lists.openembedded.org/g/openembedded-core/message/223806
Mute This Topic: https://lists.openembedded.org/mt/115371609/3617049
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
Quoted 6 lines · hongxu via lists.openembedded.org

Hi Mathieu,

Ping, or should I resend the whole series?

//Hongxu

Hi Hongxu,

The other part of the series was discussed in the Thursday patch review meeting. As far as I remember, it was rejected because it complicates a bit the whole thing while it should be simplifying. I was not directly involved in the discussion, so I might miss a few points here. You should have got some feedback about it, but it looks like it was lost somehow.

You might want to resend the whole series to trigger discussion.

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com