Bug 12889

Summary: oe-run-native should automatically pick up bindir/*-native/ directories
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: Scripts and ToolsAssignee: Jagadeesh Krishnanjanappa <jkrishnanjanappa>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: akuster, jkrishnanjanappa, ross.burton
Version: 2.6   
Target Milestone: 2.6 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2018-08-14 12:18:56 UTC
If oe-run-native is used to run something that depends on python3-native then the host python3 is still used as the binary is usr/bin/python3-native/python3, which isn't in $PATH.

oe-run-native should search usr/bin for directories called *-native and add those to PATH.
Comment 1 Jagadeesh Krishnanjanappa 2018-08-16 11:06:30 UTC
One of the ways to solve it is via find,

diff --git a/scripts/oe-run-native b/scripts/oe-run-native
index bbdd1d8c1a..1a04613d1d 100755
--- a/scripts/oe-run-native
+++ 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:$(find $OECORE_NATIVE_SYSROOT/usr/bin/ -maxdepth 1 -type d -printf ":%p")
 tool_find=`/usr/bin/which $tool 2>/dev/null`
 
 if [ -n "$tool_find" ] ; then
--

Regards,
Jagadeesh
Comment 2 Armin Kuster 2018-08-16 14:45:41 UTC
Jagadeesh,

Can you work in this?
Comment 3 Jagadeesh Krishnanjanappa 2018-08-16 17:47:36 UTC
(In reply to comment #2)
> Jagadeesh,
> 
> Can you work in this?

Sure, I have submitted a patch to solve the issue at http://lists.openembedded.org/pipermail/openembedded-core/2018-August/154241.html

Regards,
Jagadeesh
Comment 4 Jagadeesh Krishnanjanappa 2018-08-23 10:12:53 UTC
Should be resolved with 

http://cgit.openembedded.org/openembedded-core/commit/?id=a3e9b2224b31cfd836519d0b609f8064adb67cca

Regards,
Jagadeesh