[OE-core] [PATCH] waf.bbclass: cd to ${S} before checking version

Joshua Watt jpewhacker at gmail.com
Wed Jan 31 17:02:30 UTC 2018


waf requires that the current working directory be the project root (in
this case ${S} when it is invoked. The check to get the waf version was
being executed as a prefunc for do_configure, which meant it was
executed before the current working directory was switched to ${S}, and
thus would fail with some recipes. Fix this by changing to ${S} before
executing "waf --version"

Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
---
 meta/classes/waf.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
index c3e744e5de..f72ddb7814 100644
--- a/meta/classes/waf.bbclass
+++ b/meta/classes/waf.bbclass
@@ -29,7 +29,8 @@ python waf_preconfigure() {
     from distutils.version import StrictVersion
     srcsubdir = d.getVar('S')
     wafbin = os.path.join(srcsubdir, 'waf')
-    status, result = oe.utils.getstatusoutput(wafbin + " --version")
+    cmd = "cd '%s'; %s --version" % (srcsubdir, wafbin)
+    status, result = oe.utils.getstatusoutput(cmd)
     if status != 0:
         bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % status)
         return
-- 
2.14.3




More information about the Openembedded-core mailing list