From 60f33370b37fe39165b95fb142322360bb8111c3 Mon Sep 17 00:00:00 2001 From: Imre Horvath Date: Fri, 27 May 2022 11:18:11 +0200 Subject: [PATCH] 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. --- Library/Homebrew/os/mac/xcode.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 2662c0a498..b5978a1071 100755 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -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)) }