]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/utils: Set stderr for host_gcc_version()
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 13 Dec 2018 03:19:28 +0000 (11:19 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Dec 2018 17:09:12 +0000 (17:09 +0000)
Fixed:
$ ln -s /usr/bin/ccache /folk/lyang1/bin/gcc
$ rm -fr tmp/hosttools/ && bitbake -p
[snip]
ERROR: Error running gcc  --version:

It didn't print the error message, now it is:
ERROR: Error running gcc  --version: ccache: error: Could not find compiler "gcc" in PATH

For the error itself, it is because ccache is not in my HOSTTOOLS, so this is
an expected error.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/utils.py

index 8a584d6ddd5ecf4a032abb552de8f18062bee40f..29b41151d41f0a0168e9072dc196b460dee053db 100644 (file)
@@ -366,7 +366,8 @@ def host_gcc_version(d, taskcontextonly=False):
     try:
         env = os.environ.copy()
         env["PATH"] = d.getVar("PATH")
-        output = subprocess.check_output("%s --version" % compiler, shell=True, env=env).decode("utf-8")
+        output = subprocess.check_output("%s --version" % compiler, \
+                    shell=True, env=env, stderr=subprocess.STDOUT).decode("utf-8")
     except subprocess.CalledProcessError as e:
         bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8")))