From: Mingli Yu <[email protected]>

Fixes:
   ERROR: ExpansionError during parsing 
/build/layers/meta-dpdk/recipes-extended/dpdk/dpdk_23.11.bb
   Traceback (most recent call last):
     File "Var <EXTRA_OEMESON>", line 1, in <module>
     File "/build/layers/meta-dpdk/recipes-extended/dpdk/dpdk_23.11.bb", line 
12, in get_cpu_instruction_set(bb=<module 'bb' from 
'/build/layers/oe-core/bitbake/lib/bb/__init__.py'>, d=<bb.data_smart.DataSmart 
object at 0x7f63569bb070>):
         import re
     >    march = re.search(r'-march=([^\s]*)', d.getVar('CC')).group(1)
         return march
   bb.data_smart.ExpansionError: Failure expanding variable EXTRA_OEMESON, 
expression was  -Dexamples=all 
-Dcpu_instruction_set=${@get_cpu_instruction_set(bb, d)}   which triggered 
exception AttributeError: 'NoneType' object has no attribute 'group'
   The variable dependency chain for the failure is: EXTRA_OEMESON -> 
meson_do_configure

   ERROR: Parsing halted due to errors, see error messages above

Signed-off-by: Mingli Yu <[email protected]>
---
 recipes-extended/dpdk/dpdk_23.11.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/recipes-extended/dpdk/dpdk_23.11.bb 
b/recipes-extended/dpdk/dpdk_23.11.bb
index 5f0f9ec..fc2796a 100644
--- a/recipes-extended/dpdk/dpdk_23.11.bb
+++ b/recipes-extended/dpdk/dpdk_23.11.bb
@@ -9,8 +9,11 @@ S = "${WORKDIR}/git"
 
 def get_cpu_instruction_set(bb, d):
     import re
-    march = re.search(r'-march=([^\s]*)', d.getVar('CC')).group(1)
-    return march
+    march = re.search(r'-march=([^\s]*)', d.getVar('CC'))
+    if march:
+        return march.group(1)
+    else:
+        return "core2"
 
 EXTRA_OEMESON = " -Dexamples=all 
-Dcpu_instruction_set=${@get_cpu_instruction_set(bb, d)} "
 
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8195): 
https://lists.yoctoproject.org/g/meta-intel/message/8195
Mute This Topic: https://lists.yoctoproject.org/mt/103381450/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to