[libcxx-commits] [PATCH] D139545: [libc++][CI] Improves clang-(tidy|query) selection.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 28 08:27:19 PST 2022


Mordante updated this revision to Diff 485510.
Mordante added a comment.

Retrigger CI.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139545/new/

https://reviews.llvm.org/D139545

Files:
  libcxx/test/libcxx/clang_query.sh.cpp
  libcxx/test/libcxx/clang_tidy.sh.cpp
  libcxx/utils/ci/run-buildbot
  libcxx/utils/libcxx/test/features.py


Index: libcxx/utils/libcxx/test/features.py
===================================================================
--- libcxx/utils/libcxx/test/features.py
+++ libcxx/utils/libcxx/test/features.py
@@ -18,19 +18,6 @@
 _isMSVC       = lambda cfg: '_MSC_VER' in compilerMacros(cfg)
 _msvcVersion  = lambda cfg: (int(compilerMacros(cfg)['_MSC_VER']) // 100, int(compilerMacros(cfg)['_MSC_VER']) % 100)
 
-def _hasSuitableClangTidy(cfg):
-  try:
-    return int(re.search('[0-9]+', commandOutput(cfg, ['clang-tidy --version'])).group()) >= 13 and runScriptExitCode(
-      cfg, ['stat %{test-tools}/clang_tidy_checks/libcxx-tidy.plugin']) == 0
-  except ConfigurationRuntimeError:
-    return False
-
-def _hasSuitableClangQuery(cfg):
-  try:
-    return int(re.search('[0-9]+', commandOutput(cfg, ['clang-query --version'])).group()) >= 13
-  except ConfigurationRuntimeError:
-    return False
-
 DEFAULT_FEATURES = [
   Feature(name='fcoroutines-ts',
           when=lambda cfg: hasCompileFlag(cfg, '-fcoroutines-ts') and
@@ -154,9 +141,13 @@
   Feature(name='executor-has-no-bash',
           when=lambda cfg: runScriptExitCode(cfg, ['%{exec} bash -c \'bash --version\'']) != 0),
   Feature(name='has-clang-tidy',
-          when=_hasSuitableClangTidy),
+          # TODO This should be the last stable release.
+          when=lambda cfg: runScriptExitCode(cfg, ['clang-tidy-16 --version']) == 0 and
+                           runScriptExitCode(cfg, ['stat %{test-tools}/clang_tidy_checks/libcxx-tidy.plugin']) == 0,
+          actions=[AddSubstitution('%{clang-tidy}', 'clang-tidy-16')]),
   Feature(name='has-clang-query',
-          when=_hasSuitableClangQuery),
+          when=lambda cfg: runScriptExitCode(cfg, ['clang-query-15 --version']) == 0,
+          actions=[AddSubstitution('%{clang-query}', 'clang-query-15')]),
 
   Feature(name='apple-clang',                                                                                                      when=_isAppleClang),
   Feature(name=lambda cfg: 'apple-clang-{__clang_major__}'.format(**compilerMacros(cfg)),                                          when=_isAppleClang),
Index: libcxx/utils/ci/run-buildbot
===================================================================
--- libcxx/utils/ci/run-buildbot
+++ libcxx/utils/ci/run-buildbot
@@ -226,8 +226,9 @@
 #
 generic-cxx03)
     clean
-    generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \
-                   -DLIBCXX_ENABLE_CLANG_TIDY=ON
+    generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake"
+    #generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \
+    #               -DLIBCXX_ENABLE_CLANG_TIDY=ON
     check-runtimes
     check-abi-list
 ;;
Index: libcxx/test/libcxx/clang_tidy.sh.cpp
===================================================================
--- libcxx/test/libcxx/clang_tidy.sh.cpp
+++ libcxx/test/libcxx/clang_tidy.sh.cpp
@@ -12,8 +12,8 @@
 // UNSUPPORTED: gcc
 
 // TODO: run clang-tidy with modules enabled once they are supported
-// RUN: clang-tidy %s --warnings-as-errors=* -header-filter=.* --checks='-*,libcpp-*' --load=%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin -- %{compile_flags} -fno-modules
-// RUN: clang-tidy %s --warnings-as-errors=* -header-filter=.* --config-file=%S/../../.clang-tidy -- -Wweak-vtables %{compile_flags} -fno-modules
+// RUN: %{clang-tidy} %s --warnings-as-errors=* -header-filter=.* --checks='-*,libcpp-*' --load=%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin -- %{compile_flags} -fno-modules
+// RUN: %{clang-tidy} %s --warnings-as-errors=* -header-filter=.* --config-file=%S/../../.clang-tidy -- -Wweak-vtables %{compile_flags} -fno-modules
 
 // Prevent <ext/hash_map> from generating deprecated warnings for this test.
 #if defined(__DEPRECATED)
Index: libcxx/test/libcxx/clang_query.sh.cpp
===================================================================
--- libcxx/test/libcxx/clang_query.sh.cpp
+++ libcxx/test/libcxx/clang_query.sh.cpp
@@ -13,7 +13,7 @@
 // The attributes hide_from_abi_of_visible.query relies on aren't applied on windows.
 // XFAIL: windows
 
-// RUN: clang-query -f %S/clang_query/hide_from_abi_or_visible.query %s --use-color -- -Wno-unknown-warning-option %{compile_flags} -fno-modules > %t.output
+// RUN: %{clang-query} -f %S/clang_query/hide_from_abi_or_visible.query %s --use-color -- -Wno-unknown-warning-option %{compile_flags} -fno-modules > %t.output
 // RUN: cat %t.output
 // RUN: cat %t.output | wc -l | grep -Fxq 1
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139545.485510.patch
Type: text/x-patch
Size: 4530 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221228/da3ec28a/attachment-0001.bin>


More information about the libcxx-commits mailing list