Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Joshua Watt <jpewhacker@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: stefan.agner@toradex.com, jslater@windriver.com
Subject: [PATCH] waf.bbclass: cd to ${S} before checking version
Date: Wed, 31 Jan 2018 11:02:30 -0600	[thread overview]
Message-ID: <20180131170230.7183-1-JPEWhacker@gmail.com> (raw)

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>
---
 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



             reply	other threads:[~2018-01-31 17:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 17:02 Joshua Watt [this message]
2018-01-31 17:18 ` [PATCH] waf.bbclass: cd to ${S} before checking version Burton, Ross
2018-01-31 19:49 ` [PATCH v2] " Joshua Watt
2018-02-11  8:35   ` Robert Yang
2018-02-11 18:31     ` Joshua Watt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180131170230.7183-1-JPEWhacker@gmail.com \
    --to=jpewhacker@gmail.com \
    --cc=jslater@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=stefan.agner@toradex.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox