[scripts] Get clang version from soong/scripts/get_clang_version.py

... instead of manually parsing soong/cc/config/global.go

Also hard-code clang_base in gdbclient.py to 'prebuilts/clang/host' as
it's unlikely to change in global.go.

Test: acov-llvm.py flush
Test: verify gdbclient.read_toolchain_config() in the interpreter
Change-Id: I28ed4416749edcd5d623598eb65eeb7891b657ae
This commit is contained in:
Pirama Arumuga Nainar
2021-06-30 13:31:41 -07:00
parent a26dc346dd
commit f7f9544e36
2 changed files with 11 additions and 26 deletions

View File

@@ -60,14 +60,10 @@ def android_build_top():
def _get_clang_revision():
regex = r'ClangDefaultVersion\s+= "(?P<rev>clang-r\d+[a-z]?)"'
global_go = android_build_top() / 'build/soong/cc/config/global.go'
with open(global_go) as infile:
match = re.search(regex, infile.read())
if match is None:
raise RuntimeError(f'Parsing clang info from {global_go} failed')
return match.group('rev')
version_output = subprocess.check_output(
android_build_top() / 'build/soong/scripts/get_clang_version.py',
text=True)
return version_output.strip()
CLANG_TOP = android_build_top() / 'prebuilts/clang/host/linux-x86/' \