Xilinx / meta-xilinx-tools

Yocto Project layer enables AMD Xilinx tools related metadata for MicroBlaze, Zynq, ZynqMP and Versal devices.
MIT License
53 stars 51 forks source link

xsctyaml points to incorrect libdir #25

Closed tomice closed 4 years ago

tomice commented 4 years ago

Issue When building with yocto (zeus) and adding the meta-xilinx, as well as the meta-xilinx-tools, layers to the project, xsctyaml.bbclass will fail with the following error during do_create_yaml when target does not match native:

DEBUG: Executing python function do_create_yaml
ERROR: 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: '/home/tom.ice/xilinx/yocto/meta-xilinx-tools/classes/xsctyaml.bbclass', lineno: 87, function: do_create_yaml
     0083:
     0084:python do_create_yaml() {
     0085:    import sys, os
     0086:    os.sys.path.append(os.path.join(d.getVar('RECIPE_SYSROOT_NATIVE'),d.getVar('PYTHON_SITEPACKAGES_DIR')[1::]))
 *** 0087:    import yaml
     0088:    yaml_dict = {}
     0089:
     0090:    appconfig = (d.getVar("YAML_APP_CONFIG") or "").split()
     0091:    if appconfig:
Exception: ModuleNotFoundError: No module named 'yaml'

DEBUG: Python function do_create_yaml finished

I believe this is because the project is not inherting from native.bbclass, so native and target lib paths end up being effectively pointed to the same area. Path it is looking for in os.sys.path fsbl/2020.1+gitAUTOINC+6cbb920f4d-r0/recipe-sysroot-native/usr/lib64/python3.7/site-packages Correct path it should be set to: fsbl/2020.1+gitAUTOINC+6cbb920f4d-r0/recipe-sysroot-native/usr/lib/python3.7/site-packages

Both fsbl and device-tree will experience this since they both use xsctyaml.bbclass.

Fix Defining PYTHON_SITEPACKAGES_DIR to point to libdir_native instead of libdir in the xsctyaml.bbclass file should fix this issue.