Skip to content

Commit 41af70c

Browse files
committed
WIP check then move strategy
1 parent 9332be3 commit 41af70c

File tree

2 files changed

+66
-36
lines changed

2 files changed

+66
-36
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 25 additions & 25 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:
@@ -289,27 +289,27 @@ if [[ "${linux_projects}" != "" ]]; then
289289
EOF
290290
fi
291291

292-
if [[ "${windows_projects}" != "" ]]; then
293-
cat <<EOF
294-
- label: ':windows: Windows x64'
295-
artifact_paths:
296-
- 'artifacts/**/*'
297-
- '*_result.json'
298-
- 'build/test-results.xml'
299-
agents: ${WINDOWS_AGENTS}
300-
retry:
301-
automatic:
302-
- exit_status: -1 # Agent was lost
303-
limit: 2
304-
- exit_status: 255 # Forced agent shutdown
305-
limit: 2
306-
timeout_in_minutes: 150
307-
env:
308-
CC: 'cl'
309-
CXX: 'cl'
310-
LD: 'link'
311-
commands:
312-
- 'C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64'
313-
- 'bash .ci/monolithic-windows.sh "$(echo ${windows_projects} | tr ' ' ';')" "$(echo ${windows_check_targets})"'
314-
EOF
315-
fi
292+
# if [[ "${windows_projects}" != "" ]]; then
293+
# cat <<EOF
294+
# - label: ':windows: Windows x64'
295+
# artifact_paths:
296+
# - 'artifacts/**/*'
297+
# - '*_result.json'
298+
# - 'build/test-results.xml'
299+
# agents: ${WINDOWS_AGENTS}
300+
# retry:
301+
# automatic:
302+
# - exit_status: -1 # Agent was lost
303+
# limit: 2
304+
# - exit_status: 255 # Forced agent shutdown
305+
# limit: 2
306+
# timeout_in_minutes: 150
307+
# env:
308+
# CC: 'cl'
309+
# CXX: 'cl'
310+
# LD: 'link'
311+
# commands:
312+
# - 'C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64'
313+
# - 'bash .ci/monolithic-windows.sh "$(echo ${windows_projects} | tr ' ' ';')" "$(echo ${windows_check_targets})"'
314+
# EOF
315+
# fi

.ci/monolithic-linux.sh

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,41 @@ 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
3737
}
3838
trap at-exit EXIT
3939

40+
# TODO: separate file for import into Windows script?
41+
function ninja-targets {
42+
# $1 is the ninja arguments to use
43+
# $2 is is an optional postfix to add to the target name when renaming result files.
44+
# $3 is the list of targets
45+
set +e
46+
err_code=0
47+
for target in $3; do
48+
ninja $1 ${target}
49+
new_err_code=$?
50+
if [[ $new_err_code -ne 0 ]]; then
51+
err_code=${new_err_code}
52+
fi
53+
mv "${BUILD_DIR}/test-results.xml" "${BUILD_DIR}/${target}${2}-test-results.xml"
54+
done
55+
56+
if [[ $err_code -ne 0 ]]; then
57+
exit $err_code
58+
fi
59+
60+
set -e
61+
}
62+
4063
projects="${1}"
4164
targets="${2}"
4265

66+
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --timeout=1200 --time-tests"
67+
4368
echo "--- cmake"
4469
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
4570
pip install -q -r "${MONOREPO_ROOT}"/lldb/test/requirements.txt
@@ -51,16 +76,16 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
5176
-D LLVM_ENABLE_ASSERTIONS=ON \
5277
-D LLVM_BUILD_EXAMPLES=ON \
5378
-D COMPILER_RT_BUILD_LIBFUZZER=OFF \
54-
-D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --timeout=1200 --time-tests" \
79+
-D LLVM_LIT_ARGS="${lit_args}" \
5580
-D LLVM_ENABLE_LLD=ON \
5681
-D CMAKE_CXX_FLAGS=-gmlt \
5782
-D LLVM_CCACHE_BUILD=ON \
5883
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
5984
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
6085

6186
echo "--- ninja"
62-
# Targets are not escaped as they are passed as separate arguments.
63-
ninja -C "${BUILD_DIR}" -k 0 ${targets}
87+
88+
ninja-targets "-C "${BUILD_DIR}" -k 0" "" "$targets"
6489

6590
runtimes="${3}"
6691
runtime_targets="${4}"
@@ -91,11 +116,14 @@ if [[ "${runtimes}" != "" ]]; then
91116
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
92117
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
93118
-D LIBCXX_TEST_PARAMS="std=c++03" \
94-
-D LIBCXXABI_TEST_PARAMS="std=c++03"
119+
-D LIBCXXABI_TEST_PARAMS="std=c++03" \
120+
-D LLVM_LIT_ARGS="${lit_args}"
95121

96122
echo "--- ninja runtimes C++03"
97123

98-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
124+
# TODO: there's no way to tell a failure here apart from a failure of the same
125+
# test in the other build mode.
126+
ninja-targets "-vC "${RUNTIMES_BUILD_DIR}"" "-cxx03" "${runtime_targets}"
99127

100128
echo "--- cmake runtimes C++26"
101129

@@ -108,11 +136,12 @@ if [[ "${runtimes}" != "" ]]; then
108136
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
109137
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
110138
-D LIBCXX_TEST_PARAMS="std=c++26" \
111-
-D LIBCXXABI_TEST_PARAMS="std=c++26"
139+
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
140+
-D LLVM_LIT_ARGS="${lit_args}"
112141

113142
echo "--- ninja runtimes C++26"
114143

115-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
144+
ninja-targets "-vC "${RUNTIMES_BUILD_DIR}"" "-cxx26" "${runtime_targets}"
116145

117146
echo "--- cmake runtimes clang modules"
118147

@@ -125,9 +154,10 @@ if [[ "${runtimes}" != "" ]]; then
125154
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
126155
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
127156
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
128-
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang"
157+
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
158+
-D LLVM_LIT_ARGS="${lit_args}"
129159

130160
echo "--- ninja runtimes clang modules"
131-
132-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
161+
162+
ninja-targets "-vC "${RUNTIMES_BUILD_DIR}"" "-modules" "${runtime_targets}"
133163
fi

0 commit comments

Comments
 (0)