summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2019-08-27 14:33:47 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-30 13:37:43 +0100
commit3a7305bdfded3c8988484c3f430110cc121123b5 (patch)
treef765fbc2689eb0c0e87ceb54a67c18f64142df7f
parentf0095e6c1b915e1e6ded111f4bf77fff0362e29a (diff)
downloadopenembedded-core-contrib-3a7305bdfded3c8988484c3f430110cc121123b5.tar.gz
oeqa: Set LD_LIBRARY_PATH when executing native commands
Some commands like to look for libraries at runtime manually (e.g. Python's ctype.utils.find_library() function). For this to work properly, the libraries in the native sysroot must be findable. To accomplish this, set LD_LIBRARY_PATH to search library paths in the native sysroot. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/utils/commands.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 03658928e1..dc1e286dac 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -172,8 +172,11 @@ def runCmd(command, ignore_status=False, timeout=None, assert_error=True,
if native_sysroot:
extra_paths = "%s/sbin:%s/usr/sbin:%s/usr/bin" % \
(native_sysroot, native_sysroot, native_sysroot)
+ extra_libpaths = "%s/lib:%s/usr/lib" % \
+ (native_sysroot, native_sysroot)
nenv = dict(options.get('env', os.environ))
nenv['PATH'] = extra_paths + ':' + nenv.get('PATH', '')
+ nenv['LD_LIBRARY_PATH'] = extra_libpaths + ':' + nenv.get('LD_LIBRARY_PATH', '')
options['env'] = nenv
cmd = Command(command, timeout=timeout, output_log=output_log, **options)