1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

waf.bbclass: cd to ${S} before checking version

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"

(From OE-Core rev: aa168ee7f785ff007ca645db57698883922b5eb3)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Watt
2018-01-31 13:49:56 -06:00
committed by Richard Purdie
parent 8a8c31db1a
commit bb40162b2b
+10 -9
View File
@@ -26,16 +26,17 @@ def get_waf_parallel_make(d):
return "" return ""
python waf_preconfigure() { python waf_preconfigure() {
import subprocess
from distutils.version import StrictVersion from distutils.version import StrictVersion
srcsubdir = d.getVar('S') subsrcdir = d.getVar('S')
wafbin = os.path.join(srcsubdir, 'waf') wafbin = os.path.join(subsrcdir, 'waf')
status, result = oe.utils.getstatusoutput(wafbin + " --version") try:
if status != 0: result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % status) version = result.decode('utf-8').split()[1]
return if StrictVersion(version) >= StrictVersion("1.8.7"):
version = result.split()[1] d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}")
if StrictVersion(version) >= StrictVersion("1.8.7"): except subprocess.CalledProcessError as e:
d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}") bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % e.returncode)
} }
do_configure[prefuncs] += "waf_preconfigure" do_configure[prefuncs] += "waf_preconfigure"