Skip to contentSkip to conversation

mesa.inc: allow the user to choose the build type

PATCH In review Trevor Woerner 3 participants 4 messages Dec 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mesa.inc: allow the user to choose the build type

Upstream mesa can either be built as a debug release (the default) or a production release. This patch allows the user to choose which one they want by setting MESA_BUILD_TYPE to either 'production' or 'debug' as they see fit. Under OpenEmbedded a production build will be performed by default.

---
 meta/recipes-graphics/mesa/mesa.inc | 13 +++++++++++++
 1 file changed, 13 insertions(+)
meta/recipes-graphics/mesa/mesa.inc +13 -0
index 5838207e6b..9ad9f2e370 100644
@@ -46,6 +46,19 @@ export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
 
 MESA_LLVM_RELEASE ?= "${LLVMVERSION}"
 
+# set the MESA_BUILD_TYPE to either 'release' (default) or 'debug'
+# by default the upstream mesa sources build a debug release
+# here we assume the user will want a release build by default
+MESA_BUILD_TYPE ?= "release"
+def check_buildtype(d):
+    _buildtype = d.getVar('MESA_BUILD_TYPE')
+    if _buildtype not in ['release', 'debug']:
+        bb.fatal("unknown build type (%s), please set MESA_BUILD_TYPE to either 'release' or 'debug'" % _buildtype)
+    if _buildtype == 'debug':
+        return 'debugoptimized'
+    return 'plain'
+MESON_BUILDTYPE = "${@check_buildtype(d)}"
+
 EXTRA_OEMESON = " \
     -Dshared-glapi=true \
     -Dgallium-opencl=disabled \
Signature · 1 line
2.23.0.37.g745f681289
#1 lore raw
Quoted 23 lines · Trevor Woerner

Upstream mesa can either be built as a debug release (the default) or a production release. This patch allows the user to choose which one they want by setting MESA_BUILD_TYPE to either 'production' or 'debug' as they see fit. Under OpenEmbedded a production build will be performed by default.

---
 meta/recipes-graphics/mesa/mesa.inc | 13 +++++++++++++
 1 file changed, 13 insertions(+)
meta/recipes-graphics/mesa/mesa.inc +3 -0
index 5838207e6b..9ad9f2e370 100644
@@ -46,6 +46,19 @@ export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
 
 MESA_LLVM_RELEASE ?= "${LLVMVERSION}"
 
+# set the MESA_BUILD_TYPE to either 'release' (default) or 'debug'
+# by default the upstream mesa sources build a debug release
+# here we assume the user will want a release build by default

meta/recipes-graphics/mesa/mesa.inc export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" · line 61

Quoted 10 lines
meta/recipes-graphics/mesa/mesa.inc +10 -0
+MESA_BUILD_TYPE ?= "release"
+def check_buildtype(d):
+    _buildtype = d.getVar('MESA_BUILD_TYPE')
+    if _buildtype not in ['release', 'debug']:
+        bb.fatal("unknown build type (%s), please set MESA_BUILD_TYPE to either 'release' or 'debug'" % _buildtype)
+    if _buildtype == 'debug':
+        return 'debugoptimized'
+    return 'plain'
+MESON_BUILDTYPE = "${@check_buildtype(d)}"
+

Should this also be controlled with DEBUG_BUILD knob

Quoted 11 lines
meta/recipes-graphics/mesa/mesa.inc +0 -1
 EXTRA_OEMESON = " \
     -Dshared-glapi=true \
     -Dgallium-opencl=disabled \
--

2.23.0.37.g745f681289

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
Quoted 21 lines · Khem Raj
Quoted 20 lines · Trevor Woerner

Upstream mesa can either be built as a debug release (the default) or a production release. This patch allows the user to choose which one they want by setting MESA_BUILD_TYPE to either 'production' or 'debug' as they see fit. Under OpenEmbedded a production build will be performed by default.

---
  meta/recipes-graphics/mesa/mesa.inc | 13 +++++++++++++
  1 file changed, 13 insertions(+)
meta/recipes-graphics/mesa/mesa.inc +0 -0
index 5838207e6b..9ad9f2e370 100644
@@ -46,6 +46,19 @@ export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
 
  MESA_LLVM_RELEASE ?= "${LLVMVERSION}"
 
Quoted 15 lines

meta/recipes-graphics/mesa/mesa.inc export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" · line 61

Quoted 13 lines
meta/recipes-graphics/mesa/mesa.inc +13 -0
+# set the MESA_BUILD_TYPE to either 'release' (default) or 'debug'
+# by default the upstream mesa sources build a debug release
+# here we assume the user will want a release build by default
+MESA_BUILD_TYPE ?= "release"
+def check_buildtype(d):
+    _buildtype = d.getVar('MESA_BUILD_TYPE')
+    if _buildtype not in ['release', 'debug']:
+        bb.fatal("unknown build type (%s), please set MESA_BUILD_TYPE to either 'release' or 'debug'" % _buildtype)
+    if _buildtype == 'debug':
+        return 'debugoptimized'
+    return 'plain'
+MESON_BUILDTYPE = "${@check_buildtype(d)}"
+

Should this also be controlled with DEBUG_BUILD knob

Not convinced. From what Trevor said on IRC, a Mesa debug build is more than just symbols but full on debug output.

Ross

#3 lore raw
Quoted 39 lines · Ross Burton
Quoted 21 lines · Khem Raj
Quoted 20 lines · Trevor Woerner

Upstream mesa can either be built as a debug release (the default) or a production release. This patch allows the user to choose which one they want by setting MESA_BUILD_TYPE to either 'production' or 'debug' as they see fit. Under OpenEmbedded a production build will be performed by default.

---
  meta/recipes-graphics/mesa/mesa.inc | 13 +++++++++++++
  1 file changed, 13 insertions(+)
meta/recipes-graphics/mesa/mesa.inc +0 -0
index 5838207e6b..9ad9f2e370 100644
@@ -46,6 +46,19 @@ export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
 
  MESA_LLVM_RELEASE ?= "${LLVMVERSION}"
 
Quoted 15 lines

meta/recipes-graphics/mesa/mesa.inc export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" · line 61

Quoted 13 lines
meta/recipes-graphics/mesa/mesa.inc +13 -0
+# set the MESA_BUILD_TYPE to either 'release' (default) or 'debug'
+# by default the upstream mesa sources build a debug release
+# here we assume the user will want a release build by default
+MESA_BUILD_TYPE ?= "release"
+def check_buildtype(d):
+    _buildtype = d.getVar('MESA_BUILD_TYPE')
+    if _buildtype not in ['release', 'debug']:
+        bb.fatal("unknown build type (%s), please set MESA_BUILD_TYPE to either 'release' or 'debug'" % _buildtype)
+    if _buildtype == 'debug':
+        return 'debugoptimized'
+    return 'plain'
+MESON_BUILDTYPE = "${@check_buildtype(d)}"
+

Should this also be controlled with DEBUG_BUILD knob

Quoted 2 lines

Not convinced. From what Trevor said on IRC, a Mesa debug build is more than just symbols but full on debug output.

I understand that.
DEBUG_BUILD and DEBUG_OPTIMIZATION are two different things I am not saying tie it to DEBUG_OPTIMIZATION

Quoted 7 lines

Ross
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core