Skip to content

Commit c49460a

Browse files
committed
github: Add setup for running libcxx's tests on the built toolchain
Keep this disabled by default (since it takes a fair amount of time and has good test coverage upstream), but including it in disabled form so that it's easy to enable temporarily for testing occasionally. Libcxx does test the mingw configuration in their own CI (with an older pinned release of the compiler), so this is mostly redundant, and primarily relevant for testing that the very latest compiler (and python setup) works for the tests.
1 parent dfd4c31 commit c49460a

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/build.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,72 @@ jobs:
268268
./run-tests.sh /llvm-mingw
269269
./run-lldb-tests.sh /llvm-mingw
270270
271+
# Run libcxx's tests with the cross-built i686/x86_64 toolchains from above.
272+
# (This builds its own copy of libcxx, but it should be pretty much
273+
# identical to the one shipped - and tests that the toolchain works
274+
# for running the libcxx tests.)
275+
# This also forces testing the bundled python executables.
276+
test-libcxx:
277+
# This test is kinda slow, and kinda redundant (libcxx does contain
278+
# llvm-mingw configurations in its own CI, so the only difference with
279+
# testing here is different runners with different OS setups, and
280+
# testing with the latest compiler instead of an older release).
281+
# Therefore, keep the test disabled by default; it's easy to enable
282+
# temporarily on a branch for testing.
283+
if: false
284+
needs: [linux-cross]
285+
runs-on: windows-latest
286+
strategy:
287+
fail-fast: false
288+
matrix:
289+
arch:
290+
- x86_64
291+
- i686
292+
steps:
293+
- uses: actions/download-artifact@v3
294+
with:
295+
name: windows-${{matrix.arch}}-toolchain
296+
- name: Unpack toolchain
297+
run: |
298+
Expand-Archive llvm-mingw-*.zip -DestinationPath .
299+
del llvm-mingw-*.zip
300+
mv llvm-mingw-* c:\llvm-mingw
301+
echo "c:\llvm-mingw\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
302+
echo "c:\llvm-mingw\python\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
303+
echo "PYTHON_EXE=c:/llvm-mingw/python/bin/python3.exe" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
304+
- name: Fetch version
305+
if: github.event_name == 'schedule'
306+
run: |
307+
cat c:\llvm-mingw\versions | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
308+
- uses: actions/checkout@v3
309+
- name: Checkout llvm-project
310+
run: |
311+
bash -c "CHECKOUT_ONLY=1 ./build-llvm.sh"
312+
- name: Build and test libcxx
313+
run: |
314+
cd llvm-project
315+
mkdir build
316+
cd build
317+
cmake ../runtimes `
318+
-G Ninja `
319+
-DCMAKE_BUILD_TYPE=Release `
320+
-DPython3_EXECUTABLE="$Env:PYTHON_EXE" `
321+
-DLIBCXX_ENABLE_WERROR=YES `
322+
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" `
323+
-DLIBCXX_CXX_ABI=libcxxabi `
324+
-DCMAKE_C_COMPILER=clang `
325+
-DCMAKE_CXX_COMPILER=clang++ `
326+
-DLIBCXX_TARGET_INFO="libcxx.test.target_info.MingwLocalTI" `
327+
-DLIBCXXABI_ENABLE_SHARED=NO `
328+
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES `
329+
-DLIBCXX_USE_COMPILER_RT=YES `
330+
-DLIBCXXABI_USE_COMPILER_RT=YES `
331+
-DLIBUNWIND_USE_COMPILER_RT=YES `
332+
-DLIBCXXABI_USE_LLVM_UNWINDER=YES `
333+
-DLIBCXX_EXTRA_SITE_DEFINES="__USE_MINGW_ANSI_STDIO=1;TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT"
334+
ninja
335+
ninja check-cxx
336+
271337
# Run the OpenMP tests with the cross-built i686/x86_64 toolchains from above.
272338
# This also forces testing the bundled python executables.
273339
test-openmp:

0 commit comments

Comments
 (0)