Skip to content

Commit b533712

Browse files
[CI] Only run normal check targets if requested (#168412)
When building just the runtimes (eg a patch only touches compiler-rt), we do not actually run any normal check targets. This ends up causing an empty ninja invocation, which builds more targets than necessary. Gate the ninja build for normal check-* targets under an if statement to fix this.
1 parent 58cffea commit b533712

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.ci/monolithic-linux.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6464

6565
start-group "ninja"
6666

67-
# Targets are not escaped as they are passed as separate arguments.
68-
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
69-
cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
67+
if [[ "${targets}" != "" ]]; then
68+
# Targets are not escaped as they are passed as separate arguments.
69+
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
70+
cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
71+
fi
7072

7173
if [[ "${runtime_targets}" != "" ]]; then
7274
start-group "ninja Runtimes"

.ci/monolithic-windows.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
5151

5252
start-group "ninja"
5353

54-
# Targets are not escaped as they are passed as separate arguments.
55-
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
56-
cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
54+
if [[ "${targets}" != "" ]]; then
55+
# Targets are not escaped as they are passed as separate arguments.
56+
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
57+
cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
58+
fi
5759

5860
if [[ "${runtimes_targets}" != "" ]]; then
5961
start-group "ninja runtimes"

0 commit comments

Comments
 (0)