From: Quanyang Wang <[email protected]>

If enabling multilib feature for MACHINE "zcu102-zynqmp", there will be an error
when building device-tree package:

ERROR: device-tree-xilinx+gitAUTOINC+73e546e312-r0 do_create_yaml: Error 
executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:do_create_yaml(d)
     0003:
File: 'sources/core/../meta-xilinx-tools/classes/xsctyaml.bbclass', lineno: 79, 
function: do_create_yaml
     0075:
     0076:python do_create_yaml() {
     0077:    import sys, os
     0078:    
os.sys.path.append(os.path.join(d.getVar('RECIPE_SYSROOT_NATIVE'),d.getVar('PYTHON_SITEPACKAGES_DIR')[1::]))
 *** 0079:    import yaml
     0080:    yaml_dict = {}
     0081:
     0082:    appconfig = (d.getVar("YAML_APP_CONFIG", True) or "").split()
     0083:    if appconfig:
Exception: ModuleNotFoundError: No module named 'yaml'

This is because that the variable "PYTHON_SITEPACKAGES_DIR" will be a wrong path
in multilib.

In oe-core/meta/classes/python3-dir.bbclass, the assignment of this variable is:
PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages".
The libdir will be "/usr/lib64" when enbling multilib. But 
python3-pyyaml-native is
always installed to 
${RECIPE_SYSROOT_NATIVE}/usr/lib/${PYTHON_DIR}/site-packages.
So python3 can't find the python-yaml module.

Introduce PYTHON_NATIVE_SITEPACKAGES_DIR to point to ${libdir_native} (/usr/lib)
to fix this multilib issue.

Signed-off-by: Quanyang Wang <[email protected]>
---
 classes/xsctyaml.bbclass | 2 +-
 conf/layer.conf          | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/classes/xsctyaml.bbclass b/classes/xsctyaml.bbclass
index 41b5ede..db31053 100644
--- a/classes/xsctyaml.bbclass
+++ b/classes/xsctyaml.bbclass
@@ -86,7 +86,7 @@ def patch_yaml(config, configflags, type, type_dict, d):
 
 python do_create_yaml() {
     import sys, os
-    
os.sys.path.append(os.path.join(d.getVar('RECIPE_SYSROOT_NATIVE'),d.getVar('PYTHON_SITEPACKAGES_DIR')[1::]))
+    
os.sys.path.append(os.path.join(d.getVar('RECIPE_SYSROOT_NATIVE'),d.getVar('PYTHON_NATIVE_SITEPACKAGES_DIR')[1::]))
     import yaml
     yaml_dict = {}
 
diff --git a/conf/layer.conf b/conf/layer.conf
index f0189cd..3fdee6b 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -22,3 +22,5 @@ HOSTTOOLS += "ps"
 INHERIT += "xsct-tc"
 
 LAYERSERIES_COMPAT_xilinx-tools = "dunfell gatesgarth"
+
+PYTHON_NATIVE_SITEPACKAGES_DIR = "${libdir_native}/${PYTHON_DIR}/site-packages"
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#4716): 
https://lists.yoctoproject.org/g/meta-xilinx/message/4716
Mute This Topic: https://lists.yoctoproject.org/mt/75396302/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-xilinx/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to