From: Lars Poeschel <[email protected]>

The functions for checking the C compiler version call the compiler with
the --version argument and capture stdout and stderr to extract the
version information from that. This does not work if something goes
wrong for the compiler and it then prints some warning to stderr. The
following regex will certainly fail in that case.
It is better to just concentrate on stdout where the real version is
printed to and ignore stderr. So we have a chance to get a version info
even if a waring or error happened.

Signed-off-by: Lars Poeschel <[email protected]>
---
 meta/lib/oe/utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 9a2187e36f..4c7f54c777 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -391,7 +391,7 @@ def get_host_compiler_version(d, taskcontextonly=False):
         # this breaks the install-buildtools use-case
         # env["PATH"] = d.getVar("PATH")
         output = subprocess.check_output("%s --version" % compiler, \
-                    shell=True, env=env, 
stderr=subprocess.STDOUT).decode("utf-8")
+                    shell=True, env=env).decode("utf-8")
     except subprocess.CalledProcessError as e:
         bb.fatal("Error running %s --version: %s" % (compiler, 
e.output.decode("utf-8")))
 
@@ -417,7 +417,7 @@ def host_gcc_version(d, taskcontextonly=False):
         env = os.environ.copy()
         env["PATH"] = d.getVar("PATH")
         output = subprocess.check_output("%s --version" % compiler, \
-                    shell=True, env=env, 
stderr=subprocess.STDOUT).decode("utf-8")
+                    shell=True, env=env).decode("utf-8")
     except subprocess.CalledProcessError as e:
         bb.fatal("Error running %s --version: %s" % (compiler, 
e.output.decode("utf-8")))
 
-- 
2.30.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#150003): 
https://lists.openembedded.org/g/openembedded-core/message/150003
Mute This Topic: https://lists.openembedded.org/mt/81644274/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to