Fix detect_clang_version version extraction

The previous implementation was depending on a fix number of version number segments. Apple has introduced one more tag for the latest CLT version 13.4, which broke the check, leading to a false warning. With this rewritten regex we have a more robust version detection.
This commit is contained in:
Imre Horvath 2022-05-27 11:18:11 +02:00 committed by GitHub
parent 22d0fb8b71
commit 60f33370b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -383,7 +383,7 @@ module OS
sig { returns(T.nilable(String)) }
def detect_clang_version
version_output = Utils.popen_read("#{PKG_PATH}/usr/bin/clang", "--version")
version_output[/clang-(\d+\.\d+\.\d+(\.\d+)?)/, 1]
version_output[/clang-(\d+(\.\d+)+)/, 1]
end
sig { returns(T.nilable(String)) }