mirror of
https://git.yoctoproject.org/poky
synced 2026-05-02 18:32:15 +02:00
utils: Always use datastore's PATH for host_gcc_version
BUILD_CC may reference something like ccache and expect this to come from ccache-native, we at least have some selftests which assume this. Modify the code to use PATH when runnig BUILD_CC to ensure the tests continue to work as expected. (From OE-Core rev: f3e753372baac43d0921186340cf260df056de20) (From OE-Core rev: e7ec3228d9a2f40165b60f273205c17438b2c9bb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Hand applied and used d.getVar(True) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
51e2f226bd
commit
6c5a52ca8f
@@ -231,12 +231,17 @@ def format_pkg_list(pkg_dict, ret_format=None):
|
||||
return '\n'.join(output)
|
||||
|
||||
def host_gcc_version(d):
|
||||
compiler = d.getVar("BUILD_CC", True)
|
||||
retval, output = getstatusoutput("%s --version" % compiler)
|
||||
if retval:
|
||||
bb.fatal("Error running %s --version: %s" % (compiler, output))
|
||||
import re, subprocess
|
||||
|
||||
compiler = d.getVar("BUILD_CC", True)
|
||||
|
||||
try:
|
||||
env = os.environ.copy()
|
||||
env["PATH"] = d.getVar("PATH", True)
|
||||
output = subprocess.check_output("%s --version" % compiler, 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")))
|
||||
|
||||
import re
|
||||
match = re.match(".* (\d\.\d)\.\d.*", output.split('\n')[0])
|
||||
if not match:
|
||||
bb.fatal("Can't get compiler version from %s --version output" % compiler)
|
||||
|
||||
Reference in New Issue
Block a user