diff options
author | Joshua Watt <jpewhacker@gmail.com> | 2018-01-31 13:49:56 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-02-06 11:06:27 +0000 |
commit | bb40162b2b8625eac9cb95f4c0c8716d830af2e4 (patch) | |
tree | 09ce34a71382bd45b007373ee0358532ccfeffcd /meta | |
parent | 8a8c31db1a98806c331d790187ea3bf30608df29 (diff) | |
download | poky-bb40162b2b8625eac9cb95f4c0c8716d830af2e4.tar.gz |
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>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/waf.bbclass | 19 |
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): | |||
26 | return "" | 26 | return "" |
27 | 27 | ||
28 | python waf_preconfigure() { | 28 | python waf_preconfigure() { |
29 | import subprocess | ||
29 | from distutils.version import StrictVersion | 30 | from distutils.version import StrictVersion |
30 | srcsubdir = d.getVar('S') | 31 | subsrcdir = d.getVar('S') |
31 | wafbin = os.path.join(srcsubdir, 'waf') | 32 | wafbin = os.path.join(subsrcdir, 'waf') |
32 | status, result = oe.utils.getstatusoutput(wafbin + " --version") | 33 | try: |
33 | if status != 0: | 34 | result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT) |
34 | bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % status) | 35 | version = result.decode('utf-8').split()[1] |
35 | return | 36 | if StrictVersion(version) >= StrictVersion("1.8.7"): |
36 | version = result.split()[1] | 37 | d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}") |
37 | if StrictVersion(version) >= StrictVersion("1.8.7"): | 38 | except subprocess.CalledProcessError as e: |
38 | d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}") | 39 | bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % e.returncode) |
39 | } | 40 | } |
40 | 41 | ||
41 | do_configure[prefuncs] += "waf_preconfigure" | 42 | do_configure[prefuncs] += "waf_preconfigure" |