All of lore.kernel.org
 help / color / mirror / Atom feed
* oe-run-native uses host python3 instead of sysroot
@ 2018-08-10 15:58 Aaron Cohen
  2018-08-14 12:19 ` Burton, Ross
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Cohen @ 2018-08-10 15:58 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1848 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2281 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: oe-run-native uses host python3 instead of sysroot
  2018-08-10 15:58 oe-run-native uses host python3 instead of sysroot Aaron Cohen
@ 2018-08-14 12:19 ` Burton, Ross
  0 siblings, 0 replies; 2+ messages in thread
From: Burton, Ross @ 2018-08-14 12:19 UTC (permalink / raw)
  To: Aaron Cohen; +Cc: Yocto-mailing-list

That sounds like a bug but your fix isn't complete (doesn't handle
perl-native, for example), so the script should find the *-native
directories itself.  I've filed
https://bugzilla.yoctoproject.org/show_bug.cgi?id=12889 so this
doesn't get lost.

Ross

On 10 August 2018 at 16:58, Aaron Cohen <aaron@assonance.org> wrote:
> 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
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-14 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-10 15:58 oe-run-native uses host python3 instead of sysroot Aaron Cohen
2018-08-14 12:19 ` Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.