Skip to content

Commit 4366faa

Browse files
committed
WIP
1 parent 1eadc6d commit 4366faa

File tree

4 files changed

+58
-8
lines changed

4 files changed

+58
-8
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ if [[ "${linux_projects}" != "" ]]; then
272272
artifact_paths:
273273
- 'artifacts/**/*'
274274
- '*_result.json'
275-
- 'build/test-results.xml'
275+
- 'build/test-results.*.xml'
276276
agents: ${LINUX_AGENTS}
277277
retry:
278278
automatic:
@@ -295,7 +295,7 @@ if [[ "${windows_projects}" != "" ]]; then
295295
artifact_paths:
296296
- 'artifacts/**/*'
297297
- '*_result.json'
298-
- 'build/test-results.xml'
298+
- 'build/test-results.*.xml'
299299
agents: ${WINDOWS_AGENTS}
300300
retry:
301301
automatic:

.ci/lit-wrapper.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /usr/bin/env/python3
2+
3+
import sys
4+
import os
5+
import subprocess
6+
import tempfile
7+
8+
result_path = None
9+
for idx, option in enumerate(sys.argv):
10+
if option == "--xunit-xml-output":
11+
result_path = sys.argv[idx + 1]
12+
break
13+
14+
dirname, _ = os.path.split(os.path.abspath(__file__))
15+
res = subprocess.run(
16+
[sys.executable, os.path.join(dirname, "llvm-lit-actual.py"), *sys.argv[1:]],
17+
check=False,
18+
)
19+
20+
if result_path is not None:
21+
with open(result_path, "rb") as results_file:
22+
filename, ext = os.path.splitext(os.path.basename(result_path))
23+
fd, _ = tempfile.mkstemp(
24+
suffix=ext, prefix=f"{filename}.", dir=os.path.dirname(result_path)
25+
)
26+
with os.fdopen(fd, "wb") as out:
27+
out.write(results_file.read())
28+
29+
sys.exit(res.returncode)

.ci/monolithic-linux.sh

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fi
3030

3131
function at-exit {
3232
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":linux: Linux x64 Test Results" \
33-
"linux-x64-test-results" "${BUILD_DIR}"/test-results*.xml
33+
"linux-x64-test-results" "${BUILD_DIR}"/test-results.*.xml
3434

3535
mkdir -p artifacts
3636
ccache --print-stats > artifacts/ccache_stats.txt
@@ -39,6 +39,7 @@ trap at-exit EXIT
3939

4040
projects="${1}"
4141
targets="${2}"
42+
llvm_lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --timeout=1200 --time-tests"
4243

4344
echo "--- cmake"
4445
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
@@ -51,13 +52,17 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
5152
-D LLVM_ENABLE_ASSERTIONS=ON \
5253
-D LLVM_BUILD_EXAMPLES=ON \
5354
-D COMPILER_RT_BUILD_LIBFUZZER=OFF \
54-
-D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --timeout=1200 --time-tests" \
55+
-D LLVM_LIT_ARGS="$llvm_lit_args" \
5556
-D LLVM_ENABLE_LLD=ON \
5657
-D CMAKE_CXX_FLAGS=-gmlt \
5758
-D LLVM_CCACHE_BUILD=ON \
5859
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
5960
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
6061

62+
# Configure installs llvm-lit into bin. Replace this with the wrapper script.
63+
mv "${BUILD_DIR}"/bin/llvm-lit "${BUILD_DIR}"/bin/llvm-lit-actual
64+
cp "${MONOREPO_ROOT}"/.ci/lit-wrapper.py "${BUILD_DIR}"/bin/llvm-lit
65+
6166
echo "--- ninja"
6267
# Targets are not escaped as they are passed as separate arguments.
6368
ninja -C "${BUILD_DIR}" -k 0 ${targets}
@@ -91,7 +96,11 @@ if [[ "${runtimes}" != "" ]]; then
9196
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
9297
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
9398
-D LIBCXX_TEST_PARAMS="std=c++03" \
94-
-D LIBCXXABI_TEST_PARAMS="std=c++03"
99+
-D LIBCXXABI_TEST_PARAMS="std=c++03" \
100+
-D LLVM_LIT_ARGS="$llvm_lit_args"
101+
102+
mv "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit "${BUILD_DIR}"/bin/llvm-lit-actual
103+
cp "${MONOREPO_ROOT}"/.ci/lit-wrapper.py "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit
95104

96105
echo "--- ninja runtimes C++03"
97106

@@ -108,7 +117,11 @@ if [[ "${runtimes}" != "" ]]; then
108117
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
109118
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
110119
-D LIBCXX_TEST_PARAMS="std=c++26" \
111-
-D LIBCXXABI_TEST_PARAMS="std=c++26"
120+
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
121+
-D LLVM_LIT_ARGS="$llvm_lit_args"
122+
123+
mv "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit "${BUILD_DIR}"/bin/llvm-lit-actual.py
124+
cp "${MONOREPO_ROOT}"/.ci/lit-wrapper.py "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit
112125

113126
echo "--- ninja runtimes C++26"
114127

@@ -125,7 +138,11 @@ if [[ "${runtimes}" != "" ]]; then
125138
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
126139
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
127140
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
128-
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang"
141+
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
142+
-D LLVM_LIT_ARGS="$llvm_lit_args"
143+
144+
mv "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit "${BUILD_DIR}"/bin/llvm-lit-actual.py
145+
cp "${MONOREPO_ROOT}"/.ci/lit-wrapper.py "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit
129146

130147
echo "--- ninja runtimes clang modules"
131148

.ci/monolithic-windows.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fi
2929
sccache --zero-stats
3030
function at-exit {
3131
python "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":windows: Windows x64 Test Results" \
32-
"windows-x64-test-results" "${BUILD_DIR}"/test-results*.xml
32+
"windows-x64-test-results" "${BUILD_DIR}"/test-results.*.xml
3333

3434
mkdir -p artifacts
3535
sccache --show-stats >> artifacts/sccache_stats.txt
@@ -68,6 +68,10 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6868
-D LLVM_PARALLEL_COMPILE_JOBS=16 \
6969
-D LLVM_PARALLEL_LINK_JOBS=4
7070

71+
# Configure installs llvm-lit into bin. Replace this with the wrapper script.
72+
mv "${BUILD_DIR}"/bin/llvm-lit.py "${BUILD_DIR}"/bin/llvm-lit-actual.py
73+
cp "${MONOREPO_ROOT}"/.ci/lit-wrapper.py "${BUILD_DIR}"/bin/llvm-lit.py
74+
7175
echo "--- ninja"
7276
# Targets are not escaped as they are passed as separate arguments.
7377
ninja -C "${BUILD_DIR}" -k 0 ${targets}

0 commit comments

Comments
 (0)