aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2018-01-31 13:49:56 -0600
committerArmin Kuster <akuster808@gmail.com>2018-03-01 20:55:08 -0800
commit571fc4f7325c1d9872a75297ad157b322aee50fe (patch)
treeb1c638955a7ee1270a200fab543ab38f121541cd
parentc3b4fbb4a2c527cc0b74b86b61b96a7b2d489846 (diff)
downloadopenembedded-core-contrib-stable/rocke-next.tar.gz
waf.bbclass: cd to ${S} before checking versionstable/rocko-nextstable/rocke-next
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@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> (cherry picked from commit aa168ee7f785ff007ca645db57698883922b5eb3) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta/classes/waf.bbclass19
1 files changed, 10 insertions, 9 deletions
diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
index c3e744e5de..bdbdc56767 100644
--- a/meta/classes/waf.bbclass
+++ b/meta/classes/waf.bbclass
@@ -26,16 +26,17 @@ def get_waf_parallel_make(d):
return ""
python waf_preconfigure() {
+ import subprocess
from distutils.version import StrictVersion
- srcsubdir = d.getVar('S')
- wafbin = os.path.join(srcsubdir, 'waf')
- status, result = oe.utils.getstatusoutput(wafbin + " --version")
- if status != 0:
- bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % status)
- return
- version = result.split()[1]
- if StrictVersion(version) >= StrictVersion("1.8.7"):
- d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}")
+ subsrcdir = d.getVar('S')
+ wafbin = os.path.join(subsrcdir, 'waf')
+ try:
+ result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
+ version = result.decode('utf-8').split()[1]
+ if StrictVersion(version) >= StrictVersion("1.8.7"):
+ d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}")
+ except subprocess.CalledProcessError as e:
+ bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % e.returncode)
}
do_configure[prefuncs] += "waf_preconfigure"