Skip to content

Commit e300dfe

Browse files
committed
[libc++] Fix local runs of the bootstrapping-build job
The bootstrapping-build job defined in run-buildbot required the CC and CXX environment variables to be defined even though run-buildbot documents these environment variables as being optional. It also required ccache, which may not be available for local builds. This patch tweaks the script slightly to better deal with the absence of these environment variables/tools.
1 parent 2fd3bf3 commit e300dfe

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

libcxx/utils/ci/run-buildbot

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ if [ -z "${CMAKE}" ]; then
9696
fi
9797
fi
9898

99+
if [ -z "${CC}" ]; then
100+
CC=cc
101+
fi
102+
103+
if [ -z "${CXX}" ]; then
104+
CXX=c++
105+
fi
106+
99107
function step() {
100108
endstep
101109
set +x
@@ -121,6 +129,13 @@ function error() {
121129
echo "::error::$1"
122130
}
123131

132+
# Print the version of a few tools to aid diagnostics in some cases
133+
step "Diagnose tools in use"
134+
${CMAKE} --version
135+
${NINJA} --version
136+
${CC} --version
137+
${CXX} --version
138+
124139
function clean() {
125140
rm -rf "${BUILD_DIR}"
126141
}
@@ -240,12 +255,6 @@ function test-armv7m-picolibc() {
240255
check-runtimes
241256
}
242257

243-
# Print the version of a few tools to aid diagnostics in some cases
244-
step "Diagnose tools in use"
245-
${CMAKE} --version
246-
${NINJA} --version
247-
if [ ! -z "${CXX}" ]; then ${CXX} --version; fi
248-
249258
case "${BUILDER}" in
250259
check-generated-output)
251260
# `! foo` doesn't work properly with `set -e`, use `! foo || false` instead.
@@ -382,12 +391,16 @@ generic-ubsan)
382391
bootstrapping-build)
383392
clean
384393

394+
if which ccache; then
395+
CCACHE="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
396+
fi
397+
385398
step "Generating CMake"
386399
${CMAKE} \
387400
-S "${MONOREPO_ROOT}/llvm" \
388401
-B "${BUILD_DIR}" \
389402
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
390-
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
403+
${CCACHE} \
391404
-DCMAKE_BUILD_TYPE=Release \
392405
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
393406
-DLLVM_ENABLE_PROJECTS="clang;lldb" \

0 commit comments

Comments
 (0)