Skip to content

Commit 899efa6

Browse files
committed
[libcxx] [ci] Test mingw environments with msvcrt.dll, too
On Windows, there are many alternative C runtimes that a process can use; the modern default choice is UCRT, which is what we use and test so far. MinGW toolchains can also use msvcrt.dll, which traditionally was the default within MinGW environments, while UCRT is the new default. msvcrt.dll is a much less featureful C runtime than UCRT; a number of things don't work quite as they should (in particular, locales are essentially entirely broken within msvcrt.dll). Each release of llvm-mingw is built targeting both UCRT and msvcrt.dll; therefore, it is valuable to test libcxx upstream with this configuration as well. In most cases, both C runtime choices use the exact same codepaths, but we have one ifdef regarding this, see the current handling of strftime_l in src/support/win32/locale_win32.cpp. This adds build test coverage of this piece of code. As a number of tests fail in this configuration, only test building libcxx in this configuration for now. After adding suitable XFAILs, we can enable running the tests as well.
1 parent b91b623 commit 899efa6

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,11 @@ jobs:
250250
- { config: clang-cl-no-vcruntime, mingw: false }
251251
- { config: clang-cl-debug, mingw: false }
252252
- { config: clang-cl-static-crt, mingw: false }
253-
- { config: mingw-dll, mingw: true }
254-
- { config: mingw-static, mingw: true }
255-
- { config: mingw-dll-i686, mingw: true }
256-
- { config: mingw-incomplete-sysroot, mingw: true }
253+
- { config: mingw-dll, mingw: true, crt: ucrt }
254+
- { config: mingw-static, mingw: true, crt: ucrt }
255+
- { config: mingw-dll-i686, mingw: true, crt: ucrt }
256+
- { config: mingw-incomplete-sysroot, mingw: true, crt: ucrt }
257+
- { config: mingw-msvcrt, mingw: true, crt: msvcrt }
257258
steps:
258259
- uses: actions/checkout@v4
259260
- name: Install dependencies
@@ -267,7 +268,7 @@ jobs:
267268
- name: Install llvm-mingw
268269
if: ${{ matrix.mingw == true }}
269270
run: |
270-
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20240606/llvm-mingw-20240606-ucrt-x86_64.zip
271+
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20240606/llvm-mingw-20240606-${{matrix.crt}}-x86_64.zip
271272
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
272273
del llvm-mingw*.zip
273274
mv llvm-mingw* c:\llvm-mingw

libcxx/utils/ci/run-buildbot

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,15 @@ mingw-incomplete-sysroot)
772772
step "Building the runtimes"
773773
${NINJA} -vC "${BUILD_DIR}"
774774
;;
775+
mingw-msvcrt)
776+
# All tests don't pass in msvcrt based configurations (and we don't have
777+
# the right XFAIL markings for it yet), thus initially only test building.
778+
clean
779+
generate-cmake \
780+
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
781+
step "Building the runtimes"
782+
${NINJA} -vC "${BUILD_DIR}"
783+
;;
775784
aix)
776785
clean
777786
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AIX.cmake" \

0 commit comments

Comments
 (0)