24
24
25
25
SANITIZER_LOG_DIR=$ROOT /sanitizer_logs
26
26
27
+ function build_step() {
28
+ echo " @@@BUILD_STEP " " $@ " " @@"
29
+ }
30
+
27
31
function include_config() {
28
32
local P=.
29
33
while true ; do
@@ -39,7 +43,7 @@ function include_config() {
39
43
40
44
include_config
41
45
42
- echo @@@BUILD_STEP Info@@@
46
+ build_step " Info"
43
47
(
44
48
set +e
45
49
date
@@ -66,7 +70,7 @@ echo @@@BUILD_STEP Info@@@
66
70
hostname -f
67
71
)
68
72
69
- echo @@@BUILD_STEP Prepare@@@
73
+ build_step " Prepare"
70
74
71
75
export LIT_OPTS=" --time-tests"
72
76
# --timeout requires psutil missing on some bots.
@@ -89,7 +93,7 @@ function rm_dirs {
89
93
90
94
function cleanup() {
91
95
[[ -v BUILDBOT_BUILDERNAME ]] || return 0
92
- echo @@@BUILD_STEP cleanup@@@
96
+ build_step " cleanup"
93
97
rm_dirs llvm_build2_* llvm_build_* libcxx_build_* libcxx_install_* compiler_rt_build* symbolizer_build* " $@ "
94
98
if ccache -s > /dev/null ; then
95
99
rm_dirs llvm_build64
@@ -101,7 +105,7 @@ function cleanup() {
101
105
102
106
function clobber {
103
107
if [[ " $BUILDBOT_CLOBBER " != " " ]]; then
104
- echo @@@BUILD_STEP clobber@@@
108
+ build_step " clobber"
105
109
if [[ ! -v BUILDBOT_BUILDERNAME ]]; then
106
110
echo " Clobbering is supported on buildbot only!"
107
111
exit 1
@@ -119,7 +123,7 @@ BUILDBOT_MONO_REPO_PATH=${BUILDBOT_MONO_REPO_PATH:-}
119
123
120
124
function buildbot_update {
121
125
if [[ " ${BUILDBOT_BISECT_MODE:- } " == " 1" ]]; then
122
- echo " @@@BUILD_STEP bisect status@@@ "
126
+ build_step " bisect status"
123
127
(
124
128
cd llvm-project
125
129
git bisect visualize --oneline
@@ -129,7 +133,7 @@ function buildbot_update {
129
133
LLVM=$ROOT /llvm-project/llvm
130
134
return 0
131
135
fi
132
- echo " @@@BUILD_STEP update $BUILDBOT_REVISION @@@ "
136
+ build_step " update $BUILDBOT_REVISION "
133
137
if [[ -d " $BUILDBOT_MONO_REPO_PATH " ]]; then
134
138
LLVM=$BUILDBOT_MONO_REPO_PATH /llvm
135
139
else
@@ -163,7 +167,7 @@ function buildbot_update {
163
167
164
168
function print_sanitizer_logs() {
165
169
if compgen -G " ${SANITIZER_LOG_DIR} " /* ; then
166
- echo @@@BUILD_STEP sanitizer logs@@@
170
+ build_step " sanitizer logs"
167
171
head -n -1 " ${SANITIZER_LOG_DIR} " /*
168
172
buildbot_build && rm -rf " ${SANITIZER_LOG_DIR} " /*
169
173
build_warning
@@ -207,7 +211,7 @@ function build_stage1_clang_impl {
207
211
}
208
212
209
213
function build_stage1_clang {
210
- echo @@@BUILD_STEP stage1 build all@@@
214
+ build_step " stage1 build all"
211
215
common_stage1_variables
212
216
build_stage1_clang_impl
213
217
}
@@ -218,7 +222,7 @@ function download_clang_from_chromium {
218
222
curl -s https://raw.githubusercontent.com/chromium/chromium/main/tools/clang/scripts/update.py \
219
223
| python3 - --output-dir=${STAGE1_DIR}
220
224
221
- echo @@@BUILD_STEP using pre-built stage1 clang at $( cat ${STAGE1_DIR} /cr_build_revision) @@@
225
+ build_step " using pre-built stage1 clang at $( cat ${STAGE1_DIR} /cr_build_revision) "
222
226
}
223
227
224
228
function build_clang_at_release_tag {
@@ -235,12 +239,12 @@ function build_clang_at_release_tag {
235
239
if [ -r ${STAGE1_DIR} /host_clang_revision ] && \
236
240
[ " $( cat ${STAGE1_DIR} /host_clang_revision) " == $host_clang_revision ]
237
241
then
238
- echo " @@@BUILD_STEP using pre-built stage1 clang at r${host_clang_revision} @@@ "
242
+ build_step " using pre-built stage1 clang at r${host_clang_revision} "
239
243
else
240
244
SKIP_OLD=0 BUILDBOT_MONO_REPO_PATH=" " BUILDBOT_REVISION=" ${host_clang_revision} " buildbot_update
241
245
242
246
rm -rf ${STAGE1_DIR}
243
- echo @@@BUILD_STEP build stage1 clang at $host_clang_revision @@@
247
+ build_step " build stage1 clang at $host_clang_revision "
244
248
# PGO, can improve build time by 10%. However bots spend most of the time
245
249
# running tests and compilation mostly incremental or CCCACH-ed.
246
250
build_stage1_clang_impl && \
@@ -258,7 +262,7 @@ function common_stage2_variables {
258
262
259
263
function build_stage2 {
260
264
local sanitizer_name=$1
261
- echo @@@BUILD_STEP stage2/$sanitizer_name build libcxx@@@
265
+ build_step " stage2/$sanitizer_name build libcxx"
262
266
263
267
local libcxx_build_dir=libcxx_build_${sanitizer_name}
264
268
local libcxx_install_dir=libcxx_install_${sanitizer_name}
@@ -348,7 +352,7 @@ function build_stage2 {
348
352
local sanitizer_ldflags=" -Wl,--rpath=${libcxx_runtime_path} -L${libcxx_runtime_path} "
349
353
local sanitizer_cflags=" -nostdinc++ -isystem ${ROOT} /${libcxx_install_dir} /include -isystem ${ROOT} /${libcxx_install_dir} /include/c++/v1 $fsanitize_flag "
350
354
351
- echo @@@BUILD_STEP stage2/$sanitizer_name build@@@
355
+ build_step " stage2/$sanitizer_name build"
352
356
353
357
# See http://llvm.org/bugs/show_bug.cgi?id=19071, http://www.cmake.org/Bug/view.php?id=15264
354
358
sanitizer_cflags+=" $sanitizer_ldflags -w"
@@ -434,7 +438,7 @@ function check_stage2 {
434
438
if [[ " ${STAGE2_SKIP_TEST_CXX:- } " != " 1" ]] ; then
435
439
(
436
440
LIT_OPTS+=" --timeout=1500"
437
- echo @@@BUILD_STEP stage2/$sanitizer_name check-cxx@@@
441
+ build_step " stage2/$sanitizer_name check-cxx"
438
442
# Very slow.
439
443
export LIT_FILTER_OUT=" std/utilities/format/format.functions/format.locale.runtime_format.pass.cpp"
440
444
LIT_FILTER_OUT+=" |std/utilities/format/format.functions/format.runtime_format.pass.cpp"
@@ -466,7 +470,7 @@ function check_stage2 {
466
470
)
467
471
fi
468
472
469
- echo @@@BUILD_STEP stage2/$sanitizer_name check@@@
473
+ build_step " stage2/$sanitizer_name check"
470
474
run_ninja -C ${STAGE2_DIR} check-all
471
475
}
472
476
@@ -496,7 +500,7 @@ function check_stage2_asan_ubsan {
496
500
497
501
function build_stage3 {
498
502
local sanitizer_name=$1
499
- echo @@@BUILD_STEP build stage3/$sanitizer_name build@@@
503
+ build_step " build stage3/$sanitizer_name build"
500
504
501
505
local build_dir=llvm_build2_${sanitizer_name}
502
506
@@ -547,7 +551,7 @@ function build_stage3_ubsan {
547
551
548
552
function check_stage3 {
549
553
local sanitizer_name=$1
550
- echo @@@BUILD_STEP stage3/$sanitizer_name check@@@
554
+ build_step " stage3/$sanitizer_name check"
551
555
552
556
local build_dir=llvm_build2_${sanitizer_name}
553
557
0 commit comments