[yocto] oe-run-native uses host python3 instead of sysroot

Aaron Cohen aaron at assonance.org
Fri Aug 10 08:58:11 PDT 2018


Trying to run bmaptool on Centos 7, oe-run-native using the command
"oe-run-native bmap-tools-native bmaptool copy -h" gives the following
error:

--- a/scripts/oe-run-nativeTraceback (most recent call last):
  File
"/home/joel-cohen/code/yocto-2.5/xilinx-build/tmp/work/x86_64-linux/bmap-tools-native/3.4-r0/recipe-sysroot-native/usr/bin/bmaptool",
line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 3007, in
<module>
    working_set.require(__requires__)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 728, in
require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 626, in
resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: bmap-tools==3.4

which is caused because the python3 that it is using is my host's old
version (3.4.8) rather than from the recipe sysroot.

The following patch fixes it for me, but I wonder if there's a better
solution. I do think that finding the sysroot python3 is in general
preferable to using whatever happens to be on the host...

A side note: the bmaptool currently in oe throws a weird error when given
no arguments rather than a usage message. This has been fixed upstream.

--Aaron

+++ b/scripts/oe-run-native
@@ -55,7 +55,7 @@ fi
 OLD_PATH=$PATH

 # look for a tool only in native sysroot
-PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin
+PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin:$OECORE_NATIVE_SYSROOT/usr/bin/python3-native
 tool_find=`/usr/bin/which $tool 2>/dev/null`

 if [ -n "$tool_find" ] ; then
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20180810/027e8b9a/attachment-0001.html>


More information about the yocto mailing list