diff options
author | Ross Burton <ross.burton@intel.com> | 2016-12-15 19:09:16 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-11 17:21:46 +0000 |
commit | 6c5a52ca8f47388a841eab5e3a7703b38bff3ba7 (patch) | |
tree | 235d9315c7cbe1f4d2fd669d32277037b62c0af5 /meta/lib | |
parent | 51e2f226bd215b421d208df254ef4184b9d38380 (diff) | |
download | poky-6c5a52ca8f47388a841eab5e3a7703b38bff3ba7.tar.gz |
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>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/utils.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 2b095f1f0a..36cf74f296 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py | |||
@@ -231,12 +231,17 @@ def format_pkg_list(pkg_dict, ret_format=None): | |||
231 | return '\n'.join(output) | 231 | return '\n'.join(output) |
232 | 232 | ||
233 | def host_gcc_version(d): | 233 | def host_gcc_version(d): |
234 | import re, subprocess | ||
235 | |||
234 | compiler = d.getVar("BUILD_CC", True) | 236 | compiler = d.getVar("BUILD_CC", True) |
235 | retval, output = getstatusoutput("%s --version" % compiler) | ||
236 | if retval: | ||
237 | bb.fatal("Error running %s --version: %s" % (compiler, output)) | ||
238 | 237 | ||
239 | import re | 238 | try: |
239 | env = os.environ.copy() | ||
240 | env["PATH"] = d.getVar("PATH", True) | ||
241 | output = subprocess.check_output("%s --version" % compiler, shell=True, env=env).decode("utf-8") | ||
242 | except subprocess.CalledProcessError as e: | ||
243 | bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8"))) | ||
244 | |||
240 | match = re.match(".* (\d\.\d)\.\d.*", output.split('\n')[0]) | 245 | match = re.match(".* (\d\.\d)\.\d.*", output.split('\n')[0]) |
241 | if not match: | 246 | if not match: |
242 | bb.fatal("Can't get compiler version from %s --version output" % compiler) | 247 | bb.fatal("Can't get compiler version from %s --version output" % compiler) |