2424
2525SANITIZER_LOG_DIR=$ROOT /sanitizer_logs
2626
27+ function build_step() {
28+ echo " @@@BUILD_STEP " " $@ " " @@"
29+ }
30+
2731function include_config() {
2832 local P=.
2933 while true ; do
@@ -39,7 +43,7 @@ function include_config() {
3943
4044include_config
4145
42- echo @@@BUILD_STEP Info@@@
46+ build_step " Info"
4347(
4448 set +e
4549 date
@@ -66,7 +70,7 @@ echo @@@BUILD_STEP Info@@@
6670 hostname -f
6771)
6872
69- echo @@@BUILD_STEP Prepare@@@
73+ build_step " Prepare"
7074
7175export LIT_OPTS=" --time-tests"
7276# --timeout requires psutil missing on some bots.
@@ -89,7 +93,7 @@ function rm_dirs {
8993
9094function cleanup() {
9195 [[ -v BUILDBOT_BUILDERNAME ]] || return 0
92- echo @@@BUILD_STEP cleanup@@@
96+ build_step " cleanup"
9397 rm_dirs llvm_build2_* llvm_build_* libcxx_build_* libcxx_install_* compiler_rt_build* symbolizer_build* " $@ "
9498 if ccache -s > /dev/null ; then
9599 rm_dirs llvm_build64
@@ -101,7 +105,7 @@ function cleanup() {
101105
102106function clobber {
103107 if [[ " $BUILDBOT_CLOBBER " != " " ]]; then
104- echo @@@BUILD_STEP clobber@@@
108+ build_step " clobber"
105109 if [[ ! -v BUILDBOT_BUILDERNAME ]]; then
106110 echo " Clobbering is supported on buildbot only!"
107111 exit 1
@@ -119,7 +123,7 @@ BUILDBOT_MONO_REPO_PATH=${BUILDBOT_MONO_REPO_PATH:-}
119123
120124function buildbot_update {
121125 if [[ " ${BUILDBOT_BISECT_MODE:- } " == " 1" ]]; then
122- echo " @@@BUILD_STEP bisect status@@@ "
126+ build_step " bisect status"
123127 (
124128 cd llvm-project
125129 git bisect visualize --oneline
@@ -129,7 +133,7 @@ function buildbot_update {
129133 LLVM=$ROOT /llvm-project/llvm
130134 return 0
131135 fi
132- echo " @@@BUILD_STEP update $BUILDBOT_REVISION @@@ "
136+ build_step " update $BUILDBOT_REVISION "
133137 if [[ -d " $BUILDBOT_MONO_REPO_PATH " ]]; then
134138 LLVM=$BUILDBOT_MONO_REPO_PATH /llvm
135139 else
@@ -163,7 +167,7 @@ function buildbot_update {
163167
164168function print_sanitizer_logs() {
165169 if compgen -G " ${SANITIZER_LOG_DIR} " /* ; then
166- echo @@@BUILD_STEP sanitizer logs@@@
170+ build_step " sanitizer logs"
167171 head -n -1 " ${SANITIZER_LOG_DIR} " /*
168172 buildbot_build && rm -rf " ${SANITIZER_LOG_DIR} " /*
169173 build_warning
@@ -207,7 +211,7 @@ function build_stage1_clang_impl {
207211}
208212
209213function build_stage1_clang {
210- echo @@@BUILD_STEP stage1 build all@@@
214+ build_step " stage1 build all"
211215 common_stage1_variables
212216 build_stage1_clang_impl
213217}
@@ -218,7 +222,7 @@ function download_clang_from_chromium {
218222 curl -s https://raw.githubusercontent.com/chromium/chromium/main/tools/clang/scripts/update.py \
219223 | python3 - --output-dir=${STAGE1_DIR}
220224
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) "
222226}
223227
224228function build_clang_at_release_tag {
@@ -235,12 +239,12 @@ function build_clang_at_release_tag {
235239 if [ -r ${STAGE1_DIR} /host_clang_revision ] && \
236240 [ " $( cat ${STAGE1_DIR} /host_clang_revision) " == $host_clang_revision ]
237241 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} "
239243 else
240244 SKIP_OLD=0 BUILDBOT_MONO_REPO_PATH=" " BUILDBOT_REVISION=" ${host_clang_revision} " buildbot_update
241245
242246 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 "
244248 # PGO, can improve build time by 10%. However bots spend most of the time
245249 # running tests and compilation mostly incremental or CCCACH-ed.
246250 build_stage1_clang_impl && \
@@ -258,7 +262,7 @@ function common_stage2_variables {
258262
259263function build_stage2 {
260264 local sanitizer_name=$1
261- echo @@@BUILD_STEP stage2/$sanitizer_name build libcxx@@@
265+ build_step " stage2/$sanitizer_name build libcxx"
262266
263267 local libcxx_build_dir=libcxx_build_${sanitizer_name}
264268 local libcxx_install_dir=libcxx_install_${sanitizer_name}
@@ -348,7 +352,7 @@ function build_stage2 {
348352 local sanitizer_ldflags=" -Wl,--rpath=${libcxx_runtime_path} -L${libcxx_runtime_path} "
349353 local sanitizer_cflags=" -nostdinc++ -isystem ${ROOT} /${libcxx_install_dir} /include -isystem ${ROOT} /${libcxx_install_dir} /include/c++/v1 $fsanitize_flag "
350354
351- echo @@@BUILD_STEP stage2/$sanitizer_name build@@@
355+ build_step " stage2/$sanitizer_name build"
352356
353357 # See http://llvm.org/bugs/show_bug.cgi?id=19071, http://www.cmake.org/Bug/view.php?id=15264
354358 sanitizer_cflags+=" $sanitizer_ldflags -w"
@@ -434,7 +438,7 @@ function check_stage2 {
434438 if [[ " ${STAGE2_SKIP_TEST_CXX:- } " != " 1" ]] ; then
435439 (
436440 LIT_OPTS+=" --timeout=1500"
437- echo @@@BUILD_STEP stage2/$sanitizer_name check-cxx@@@
441+ build_step " stage2/$sanitizer_name check-cxx"
438442 # Very slow.
439443 export LIT_FILTER_OUT=" std/utilities/format/format.functions/format.locale.runtime_format.pass.cpp"
440444 LIT_FILTER_OUT+=" |std/utilities/format/format.functions/format.runtime_format.pass.cpp"
@@ -466,7 +470,7 @@ function check_stage2 {
466470 )
467471 fi
468472
469- echo @@@BUILD_STEP stage2/$sanitizer_name check@@@
473+ build_step " stage2/$sanitizer_name check"
470474 run_ninja -C ${STAGE2_DIR} check-all
471475}
472476
@@ -496,7 +500,7 @@ function check_stage2_asan_ubsan {
496500
497501function build_stage3 {
498502 local sanitizer_name=$1
499- echo @@@BUILD_STEP build stage3/$sanitizer_name build@@@
503+ build_step " build stage3/$sanitizer_name build"
500504
501505 local build_dir=llvm_build2_${sanitizer_name}
502506
@@ -547,7 +551,7 @@ function build_stage3_ubsan {
547551
548552function check_stage3 {
549553 local sanitizer_name=$1
550- echo @@@BUILD_STEP stage3/$sanitizer_name check@@@
554+ build_step " stage3/$sanitizer_name check"
551555
552556 local build_dir=llvm_build2_${sanitizer_name}
553557
0 commit comments