[llvm] 3cce68c - [gn] Unbreak sync_source_lists_from_cmake on mac after Xcode update
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Tue May 2 17:19:59 PDT 2023
Author: Nico Weber
Date: 2023-05-02T20:05:38-04:00
New Revision: 3cce68c2b3485859f719c586e0638205573bd76d
URL: https://github.com/llvm/llvm-project/commit/3cce68c2b3485859f719c586e0638205573bd76d
DIFF: https://github.com/llvm/llvm-project/commit/3cce68c2b3485859f719c586e0638205573bd76d.diff
LOG: [gn] Unbreak sync_source_lists_from_cmake on mac after Xcode update
Apparently `\b` stopped working with --pickaxe-regex for some reason.
Added:
Modified:
llvm/utils/gn/build/sync_source_lists_from_cmake.py
Removed:
################################################################################
diff --git a/llvm/utils/gn/build/sync_source_lists_from_cmake.py b/llvm/utils/gn/build/sync_source_lists_from_cmake.py
index 7ecff9ddd1398..fe7e8ed10bcf5 100755
--- a/llvm/utils/gn/build/sync_source_lists_from_cmake.py
+++ b/llvm/utils/gn/build/sync_source_lists_from_cmake.py
@@ -73,7 +73,13 @@ def find_gitrev(touched_line, in_file):
# undefined behavior according to the POSIX extended regex spec.
posix_re_escape = lambda s: re.sub(r'([.[{()\\*+?|^$])', r'\\\1', s)
cmd = ['log', '--format=%h', '-1', '--pickaxe-regex',
- r'-S\b%s\b' % posix_re_escape(touched_line), in_file]
+ # `\<` / `\>` cause issues on Windows (and is a GNU extension).
+ # `\b` is a GNU extension and stopped working in Apple Git-143
+ # (Xcode 13.3).
+ # `[:space:]` is over 10x faster than `^[:alnum:]` and hopefully
+ # good enough.
+ r'-S[[:space:]]%s[[:space:]]' % posix_re_escape(touched_line),
+ in_file]
return git_out(cmd).rstrip()
# Collect changes to gn files, grouped by revision.
More information about the llvm-commits
mailing list