]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa: Set LD_LIBRARY_PATH when executing native commands
authorJoshua Watt <jpewhacker@gmail.com>
Tue, 27 Aug 2019 19:33:47 +0000 (14:33 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Aug 2019 12:37:43 +0000 (13:37 +0100)
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>
meta/lib/oeqa/utils/commands.py

index 03658928e13e84e3ef2924db9f731435dea974c9..dc1e286dacf51c8987dfec99afc7977f3b55037d 100644 (file)
@@ -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)