Skip to content

Commit e497123

Browse files
committed
WIP
1 parent 1eadc6d commit e497123

File tree

4 files changed

+59
-8
lines changed

4 files changed

+59
-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: 23 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,18 @@ 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+
# TODO: make a function for this
64+
mv "${BUILD_DIR}"/bin/llvm-lit "${BUILD_DIR}"/bin/llvm-lit-actual.py
65+
cp "${MONOREPO_ROOT}"/.ci/lit-wrapper.py "${BUILD_DIR}"/bin/llvm-lit
66+
6167
echo "--- ninja"
6268
# Targets are not escaped as they are passed as separate arguments.
6369
ninja -C "${BUILD_DIR}" -k 0 ${targets}
@@ -91,7 +97,11 @@ if [[ "${runtimes}" != "" ]]; then
9197
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
9298
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
9399
-D LIBCXX_TEST_PARAMS="std=c++03" \
94-
-D LIBCXXABI_TEST_PARAMS="std=c++03"
100+
-D LIBCXXABI_TEST_PARAMS="std=c++03" \
101+
-D LLVM_LIT_ARGS="$llvm_lit_args"
102+
103+
mv "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit-actual.py
104+
cp "${MONOREPO_ROOT}"/.ci/lit-wrapper.py "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit
95105

96106
echo "--- ninja runtimes C++03"
97107

@@ -108,7 +118,11 @@ if [[ "${runtimes}" != "" ]]; then
108118
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
109119
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
110120
-D LIBCXX_TEST_PARAMS="std=c++26" \
111-
-D LIBCXXABI_TEST_PARAMS="std=c++26"
121+
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
122+
-D LLVM_LIT_ARGS="$llvm_lit_args"
123+
124+
mv "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit-actual.py
125+
cp "${MONOREPO_ROOT}"/.ci/lit-wrapper.py "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit
112126

113127
echo "--- ninja runtimes C++26"
114128

@@ -125,7 +139,11 @@ if [[ "${runtimes}" != "" ]]; then
125139
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
126140
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
127141
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
128-
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang"
142+
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
143+
-D LLVM_LIT_ARGS="$llvm_lit_args"
144+
145+
mv "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit-actual.py
146+
cp "${MONOREPO_ROOT}"/.ci/lit-wrapper.py "${RUNTIMES_BUILD_DIR}"/bin/llvm-lit
129147

130148
echo "--- ninja runtimes clang modules"
131149

.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)