Skip to content

Commit 55aff5e

Browse files
committed
Attempt to add output groups to github actions for libc++
This should make log output easier to find.
1 parent c8655fc commit 55aff5e

File tree

1 file changed

+48
-14
lines changed

1 file changed

+48
-14
lines changed

libcxx/utils/ci/run-buildbot

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,27 @@ if [ -z "${CMAKE}" ]; then
112112
fi
113113
fi
114114

115+
function start_output_group() {
116+
end_output_group
117+
set +x
118+
if [[ -v GITHUB_ACTIONS ]]; then
119+
echo "::group::$1"
120+
export IN_GROUP=1
121+
else
122+
echo "--- $1"
123+
fi
124+
set -x
125+
}
126+
127+
function end_output_group() {
128+
set +x
129+
if [[ -v GITHUB_ACTIONS ]] && [[ -v IN_GROUP ]]; then
130+
echo "::endgroup::"
131+
unset IN_GROUP
132+
fi
133+
set -x
134+
}
135+
115136
function clean() {
116137
rm -rf "${BUILD_DIR}"
117138
}
@@ -125,7 +146,7 @@ if [ -n "${ENABLE_STD_MODULES}" ]; then
125146
fi
126147

127148
function generate-cmake-base() {
128-
echo "--- Generating CMake"
149+
start_output_group "Generating CMake"
129150
${CMAKE} \
130151
-S "${MONOREPO_ROOT}/runtimes" \
131152
-B "${BUILD_DIR}" \
@@ -139,6 +160,7 @@ function generate-cmake-base() {
139160
${ENABLE_STD_MODULES} \
140161
-DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \
141162
"${@}"
163+
end_output_group
142164
}
143165

144166
function generate-cmake() {
@@ -164,13 +186,19 @@ function generate-cmake-android() {
164186
}
165187

166188
function check-runtimes() {
167-
echo "+++ Running the libc++ tests"
189+
start_output_group "Building libc++ & libc++abi"
190+
${NINJA} -vC "${BUILD_DIR}" cxx cxxabi
191+
192+
start_output_group "Building libc++ test deps"
193+
${NINJA} -vC "${BUILD_DIR}" cxx-test-depends
194+
195+
start_output_group "Running the libc++ tests"
168196
${NINJA} -vC "${BUILD_DIR}" check-cxx
169197

170-
echo "+++ Running the libc++abi tests"
198+
start_output_group "Running the libc++abi tests"
171199
${NINJA} -vC "${BUILD_DIR}" check-cxxabi
172200

173-
echo "+++ Running the libunwind tests"
201+
start_output_group "Running the libunwind tests"
174202
${NINJA} -vC "${BUILD_DIR}" check-unwind
175203

176204
# TODO: On macOS 13.5, the linker seems to have an issue where it will pick up
@@ -183,23 +211,25 @@ function check-runtimes() {
183211
# It should be possible to move this installation step back to the top once
184212
# that issue has been resolved, but in the meantime it doesn't really hurt to
185213
# have it here.
186-
echo "--- Installing libc++, libc++abi and libunwind to a fake location"
214+
start_output_group "Installing libc++, libc++abi and libunwind to a fake location"
187215
${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi install-unwind
216+
217+
end_output_group
188218
}
189219

190220
# TODO: The goal is to test this against all configurations. We should also move
191221
# this to the Lit test suite instead of being a separate CMake target.
192222
function check-abi-list() {
193-
echo "+++ Running the libc++ ABI list test"
223+
start_output_group "Running the libc++ ABI list test"
194224
${NINJA} -vC "${BUILD_DIR}" check-cxx-abilist || (
195-
echo "+++ Generating the libc++ ABI list after failed check"
225+
echo "::error::Generating the libc++ ABI list after failed check"
196226
${NINJA} -vC "${BUILD_DIR}" generate-cxx-abilist
197227
false
198228
)
199229
}
200230

201231
function check-cxx-benchmarks() {
202-
echo "--- Running the benchmarks"
232+
start_output_group "Running the benchmarks"
203233
${NINJA} -vC "${BUILD_DIR}" check-cxx-benchmarks
204234
}
205235

@@ -341,7 +371,7 @@ generic-ubsan)
341371
bootstrapping-build)
342372
clean
343373

344-
echo "--- Generating CMake"
374+
start_output_group "Generating CMake"
345375
${CMAKE} \
346376
-S "${MONOREPO_ROOT}/llvm" \
347377
-B "${BUILD_DIR}" \
@@ -357,13 +387,15 @@ bootstrapping-build)
357387
-DLLVM_ENABLE_ASSERTIONS=ON \
358388
-DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests"
359389

360-
echo "+++ Running the libc++ and libc++abi tests"
390+
start_output_group "Running the libc++ and libc++abi tests"
361391
${NINJA} -vC "${BUILD_DIR}" check-runtimes
362392

363-
echo "--- Installing libc++ and libc++abi to a fake location"
393+
start_output_group "Installing libc++ and libc++abi to a fake location"
364394
${NINJA} -vC "${BUILD_DIR}" install-runtimes
365395

366396
ccache -s
397+
398+
end_output_group
367399
;;
368400
generic-static)
369401
clean
@@ -500,11 +532,12 @@ apple-system-backdeployment-hardened-*)
500532
clean
501533

502534
if [[ "${OSX_ROOTS}" == "" ]]; then
503-
echo "--- Downloading previous macOS dylibs"
535+
start_output_group "Downloading previous macOS dylibs"
504536
PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
505537
OSX_ROOTS="${BUILD_DIR}/macos-roots"
506538
mkdir -p "${OSX_ROOTS}"
507539
curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}"
540+
end_output_group
508541
fi
509542

510543
DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-hardened-}"
@@ -538,11 +571,12 @@ apple-system-backdeployment-*)
538571
clean
539572

540573
if [[ "${OSX_ROOTS}" == "" ]]; then
541-
echo "--- Downloading previous macOS dylibs"
574+
start_output_group "Downloading previous macOS dylibs"
542575
PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
543576
OSX_ROOTS="${BUILD_DIR}/macos-roots"
544577
mkdir -p "${OSX_ROOTS}"
545578
curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}"
579+
end_output_group
546580
fi
547581

548582
DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-}"
@@ -621,7 +655,7 @@ armv7m-picolibc)
621655
--install-dir "${INSTALL_DIR}" \
622656
--target armv7m-none-eabi
623657

624-
echo "--- Generating CMake"
658+
start_output_group "Generating CMake"
625659
flags="--sysroot=${INSTALL_DIR}"
626660
${CMAKE} \
627661
-S "${MONOREPO_ROOT}/compiler-rt" \

0 commit comments

Comments
 (0)