Skip to content

Commit 87f300f

Browse files
committed
[libc++][CI] Reenables clang-tidy.
This is currently a test patch; locally clang-tidy seems to be used in the Docker image.
1 parent 754072e commit 87f300f

File tree

4 files changed

+8
-158
lines changed

4 files changed

+8
-158
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 0 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,10 @@ jobs:
5555
fail-fast: false
5656
matrix:
5757
config: [
58-
'generic-cxx03',
5958
'generic-cxx26',
60-
'generic-modules'
6159
]
6260
cc: [ 'clang-19' ]
6361
cxx: [ 'clang++-19' ]
64-
include:
65-
- config: 'generic-gcc'
66-
cc: 'gcc-13'
67-
cxx: 'g++-13'
6862
steps:
6963
- uses: actions/checkout@v4
7064
- name: ${{ matrix.config }}.${{ matrix.cxx }}
@@ -82,153 +76,3 @@ jobs:
8276
**/CMakeError.log
8377
**/CMakeOutput.log
8478
**/crash_diagnostics/*
85-
stage2:
86-
if: github.repository_owner == 'llvm'
87-
runs-on: libcxx-runners-8-set
88-
needs: [ stage1 ]
89-
continue-on-error: false
90-
strategy:
91-
fail-fast: false
92-
matrix:
93-
config: [
94-
'generic-cxx11',
95-
'generic-cxx14',
96-
'generic-cxx17',
97-
'generic-cxx20',
98-
'generic-cxx23'
99-
]
100-
cc: [ 'clang-19' ]
101-
cxx: [ 'clang++-19' ]
102-
include:
103-
- config: 'generic-gcc-cxx11'
104-
cc: 'gcc-13'
105-
cxx: 'g++-13'
106-
- config: 'generic-cxx23'
107-
cc: 'clang-17'
108-
cxx: 'clang++-17'
109-
- config: 'generic-cxx26'
110-
cc: 'clang-18'
111-
cxx: 'clang++-18'
112-
steps:
113-
- uses: actions/checkout@v4
114-
- name: ${{ matrix.config }}
115-
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
116-
env:
117-
CC: ${{ matrix.cc }}
118-
CXX: ${{ matrix.cxx }}
119-
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
120-
if: always() # Upload artifacts even if the build or test suite fails
121-
with:
122-
name: ${{ matrix.config }}-${{ matrix.cxx }}-results
123-
path: |
124-
**/test-results.xml
125-
**/*.abilist
126-
**/CMakeError.log
127-
**/CMakeOutput.log
128-
**/crash_diagnostics/*
129-
stage3:
130-
if: github.repository_owner == 'llvm'
131-
needs: [ stage1, stage2 ]
132-
continue-on-error: false
133-
strategy:
134-
fail-fast: false
135-
max-parallel: 8
136-
matrix:
137-
config: [
138-
'generic-abi-unstable',
139-
'generic-hardening-mode-debug',
140-
'generic-hardening-mode-extensive',
141-
'generic-hardening-mode-fast',
142-
'generic-hardening-mode-fast-with-abi-breaks',
143-
'generic-merged',
144-
'generic-modules-lsv',
145-
'generic-no-exceptions',
146-
'generic-no-experimental',
147-
'generic-no-filesystem',
148-
'generic-no-localization',
149-
'generic-no-random_device',
150-
'generic-no-threads',
151-
'generic-no-tzdb',
152-
'generic-no-unicode',
153-
'generic-no-wide-characters',
154-
'generic-no-rtti',
155-
'generic-optimized-speed',
156-
'generic-static',
157-
# TODO Find a better place for the benchmark and bootstrapping builds to live. They're either very expensive
158-
# or don't provide much value since the benchmark run results are too noise on the bots.
159-
'benchmarks',
160-
'bootstrapping-build'
161-
]
162-
machine: [ 'libcxx-runners-8-set' ]
163-
include:
164-
- config: 'generic-cxx26'
165-
machine: libcxx-runners-8-set
166-
- config: 'generic-asan'
167-
machine: libcxx-runners-8-set
168-
- config: 'generic-tsan'
169-
machine: libcxx-runners-8-set
170-
- config: 'generic-ubsan'
171-
machine: libcxx-runners-8-set
172-
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
173-
- config: 'generic-msan'
174-
machine: libcxx-runners-8-set
175-
runs-on: ${{ matrix.machine }}
176-
steps:
177-
- uses: actions/checkout@v4
178-
- name: ${{ matrix.config }}
179-
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
180-
env:
181-
CC: clang-19
182-
CXX: clang++-19
183-
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
184-
if: always()
185-
with:
186-
name: ${{ matrix.config }}-results
187-
path: |
188-
**/test-results.xml
189-
**/*.abilist
190-
**/CMakeError.log
191-
**/CMakeOutput.log
192-
**/crash_diagnostics/*
193-
windows:
194-
runs-on: windows-2022
195-
needs: [ stage1 ]
196-
strategy:
197-
fail-fast: false
198-
matrix:
199-
include:
200-
- { config: clang-cl-dll, mingw: false }
201-
- { config: clang-cl-static, mingw: false }
202-
- { config: clang-cl-no-vcruntime, mingw: false }
203-
- { config: clang-cl-debug, mingw: false }
204-
- { config: clang-cl-static-crt, mingw: false }
205-
- { config: mingw-dll, mingw: true }
206-
- { config: mingw-static, mingw: true }
207-
- { config: mingw-dll-i686, mingw: true }
208-
steps:
209-
- uses: actions/checkout@v4
210-
- name: Install dependencies
211-
run: |
212-
choco install -y ninja wget
213-
pip install psutil
214-
- name: Install a current LLVM
215-
if: ${{ matrix.mingw != true }}
216-
run: |
217-
choco install -y llvm --version=17.0.6
218-
- name: Install llvm-mingw
219-
if: ${{ matrix.mingw == true }}
220-
run: |
221-
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-ucrt-x86_64.zip
222-
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
223-
del llvm-mingw*.zip
224-
mv llvm-mingw* c:\llvm-mingw
225-
echo "c:\llvm-mingw\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
226-
- name: Add Git Bash to the path
227-
run: |
228-
echo "c:\Program Files\Git\usr\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
229-
- name: Set up the MSVC dev environment
230-
if: ${{ matrix.mingw != true }}
231-
uses: ilammy/msvc-dev-cmd@v1
232-
- name: Build and test
233-
run: |
234-
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}

libcxx/test/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
include(HandleLitArguments)
22
add_subdirectory(tools)
3+
if(TARGET cxx-tidy)
4+
list(APPEND LIBCXX_TEST_DEPS cxx-tidy)
5+
endif()
36

47
# By default, libcxx and libcxxabi share a library directory.
58
if (NOT LIBCXX_CXX_ABI_LIBRARY_PATH)
@@ -73,6 +76,7 @@ if (LIBCXX_INCLUDE_TESTS)
7376
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
7477
MAIN_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py")
7578

79+
MESSAGE("XXX ${LIBCXX_TEST_DEPS}")
7680
add_custom_target(cxx-test-depends
7781
DEPENDS cxx ${LIBCXX_TEST_DEPS}
7882
COMMENT "Builds dependencies required to run the test suite.")

libcxx/test/tools/clang_tidy_checks/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,3 @@ set_target_properties(cxx-tidy PROPERTIES
8888

8989
set_target_properties(cxx-tidy PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
9090
set(CMAKE_SHARED_MODULE_SUFFIX_CXX .plugin) # Use a portable suffix to simplify how we can find it from Lit
91-
92-
list(APPEND LIBCXX_TEST_DEPS cxx-tidy)

libcxx/utils/libcxx/test/params.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ def getSuitableClangTidy(cfg):
126126
)
127127
!= 0
128128
):
129+
print("CLANG-TIDY: no plugin")
129130
return None
130131

131132
version = "{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}".format(
@@ -135,8 +136,11 @@ def getSuitableClangTidy(cfg):
135136
cfg, version, "clang-tidy-{__clang_major__}".format(**compilerMacros(cfg))
136137
)
137138

139+
print(f"CLANG-TIDY: version={version} exe={exe}")
140+
138141
if not exe:
139142
exe = testClangTidy(cfg, version, "clang-tidy")
143+
print(f"CLANG-TIDY: new exe={exe}")
140144

141145
return exe
142146

0 commit comments

Comments
 (0)