Skip to content

Commit 11cd830

Browse files
committed
Strip URL from verbose Clang version
1 parent 05a9779 commit 11cd830

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎Tools/build/generate_getbuildinfo.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
# Get PY_VERSION from Include/patchlevel.h
1818
PY_VERSION_REGEX = re.compile(r'^#define PY_VERSION +"(.*)"$', re.MULTILINE)
1919

20+
# Parse verbose Clang version (truncated here with '...'):
21+
# 'Clang 24.0.0git (https:/github.com/llvm/llvm-project a06...8bf)'
22+
# 'Android (13691557, +pgo, ...) clang version 18.0.4 (https://android.googlesource.com/toolchain/llvm-project d80...262)'
23+
CLANG_VERBOSE_VERSION = re.compile(r'(Clang .*|clang version .*) \(https:/.*\)')
24+
2025

2126
def exit_error(msg):
2227
print(msg)
@@ -169,6 +174,11 @@ def main():
169174
if not compiler:
170175
compiler = get_compiler()
171176

177+
# Make verbose Clang version shorter: strip the prefix and URL
178+
match = CLANG_VERBOSE_VERSION.search(compiler)
179+
if match:
180+
compiler = match.group(1)
181+
172182
build_info, git_id = get_build_info(git_tag, git_branch, git_version)
173183

174184
# Get PY_VERSION macro from Include/patchlevel.h

0 commit comments

Comments
 (0)