Skip to content

Commit 740e349

Browse files
committed
[libcxx] [ci] Add a Windows CI buildkite configuration
Differential Revision: https://reviews.llvm.org/D99093
1 parent e2a0f51 commit 740e349

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

libcxx/utils/ci/buildkite-pipeline.yml

+13
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,19 @@ steps:
299299
- exit_status: -1 # Agent was lost
300300
limit: 2
301301

302+
- label: "Windows"
303+
# TODO: The CI runner doesn't have bash in the path currently. Once it
304+
# has that, remove the absolute path and just call 'bash' here.
305+
command: "\"\\Program Files\\Git\\usr\\bin\\bash\" libcxx/utils/ci/run-buildbot generic-win"
306+
artifact_paths:
307+
- "**/test-results.xml"
308+
agents:
309+
queue: "windows"
310+
retry:
311+
automatic:
312+
- exit_status: -1 # Agent was lost
313+
limit: 2
314+
302315
# All jobs defined before this `wait` will run whenever a CI job is started.
303316
# Jobs defined after the `wait` will run only if all the jobs above succeeded.
304317
# We use this to reduce the load on testers that have more constrained resources

libcxx/utils/ci/run-buildbot

+43
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,49 @@ armv7-noexceptions)
455455
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake"
456456
check-cxx-cxxabi
457457
;;
458+
generic-win)
459+
clean
460+
# TODO: The CI runner doesn't have bash in the path currently, and it's
461+
# needed for running tests. Once it's available out of the box, remove this.
462+
export PATH="$PATH:/c/Program Files/Git/usr/bin"
463+
464+
# TODO: Clang-cl in MSVC configurations don't have access to compiler_rt
465+
# builtins helpers for int128 division. See
466+
# https://reviews.llvm.org/D91139#2429595 for a comment about longterm
467+
# intent for handling the issue. In the meantime, define
468+
# -D_LIBCPP_HAS_NO_INT128 (both when building the library itself and
469+
# when building tests) to allow enabling filesystem for running tests,
470+
# even if it uses a non-permanent ABI.
471+
472+
# TODO: The CI runner currently uses Clang 11, which doesn't implicitly
473+
# link in oldnames.lib (which is needed for some tests) when compiling
474+
# with the plain "clang" driver, as the tests do (as opposed to using
475+
# the "clang-cl" driver for compiling). When the CI runner runs
476+
# Clang 12, the "-loldnames" option can be dropped.
477+
478+
# TODO: Currently, building with the experimental library breaks running
479+
# tests (the test linking look for the c++experimental library with the
480+
# wrong name, and the statically linked c++experimental can't be linked
481+
# correctly when libc++ visibility attributes indicate dllimport linkage
482+
# anyway), thus just disable the experimental library. Remove this
483+
# setting when cmake and the test driver does the right thing automatically.
484+
485+
echo "--- Generating CMake"
486+
cmake -S "${MONOREPO_ROOT}/libcxx" \
487+
-B "${BUILD_DIR}" \
488+
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
489+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
490+
-DCMAKE_C_COMPILER=clang-cl \
491+
-DCMAKE_CXX_COMPILER=clang-cl \
492+
-DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml" \
493+
-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO \
494+
-DLIBCXX_ENABLE_FILESYSTEM=YES \
495+
-DCMAKE_CXX_FLAGS="-D_LIBCPP_HAS_NO_INT128" \
496+
-DLIBCXX_TEST_COMPILER_FLAGS="-D_LIBCPP_HAS_NO_INT128" \
497+
-DLIBCXX_TEST_LINKER_FLAGS="-loldnames"
498+
echo "+++ Running the libc++ tests"
499+
${NINJA} -vC "${BUILD_DIR}" check-cxx
500+
;;
458501
*)
459502
echo "${BUILDER} is not a known configuration"
460503
exit 1

0 commit comments

Comments
 (0)