mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
Meta: Make BuildClang.sh produce less output when running in a TTY
Ninja disables its fancy output mode when it's not writing to a TTY. So don't pipe its output into something else, so that it writes to a TTY if the invoking terminal is a TTY.
This commit is contained in:
parent
eb7b8a7bbe
commit
17ab44e7d7
1 changed files with 16 additions and 5 deletions
|
@ -76,7 +76,18 @@ BINUTILS_BASE_URL="https://ftp.gnu.org/gnu/binutils"
|
||||||
buildstep() {
|
buildstep() {
|
||||||
NAME=$1
|
NAME=$1
|
||||||
shift
|
shift
|
||||||
"$@" 2>&1 | sed $'s|^|\x1b[34m['"${NAME}"$']\x1b[39m |'
|
"$@" 2>&1 | sed $'s|^|\e[34m['"${NAME}"$']\e[39m |'
|
||||||
|
}
|
||||||
|
|
||||||
|
buildstep_ninja() {
|
||||||
|
# When ninja writes to a pipe, it strips ANSI escape codes and prints one line per buildstep.
|
||||||
|
# Instead, use NINJA_STATUS so that we get colored output from LLVM's build and fewer lines of output when running in a tty.
|
||||||
|
# ANSI escape codes in NINJA_STATUS are slightly janky (ninja thinks that "\e[34m" needs 5 output characters instead of 5, so
|
||||||
|
# it's middle elision is slightly off; also it would happily elide the "\e39m" which messes up the output if the terminal is too
|
||||||
|
# narrow), but it's still working better than the alternative.
|
||||||
|
NAME=$1
|
||||||
|
shift
|
||||||
|
env NINJA_STATUS=$'\e[34m['"${NAME}"$']\e[39m [%f/%t] ' "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# === DEPENDENCIES ===
|
# === DEPENDENCIES ===
|
||||||
|
@ -263,7 +274,7 @@ pushd "$DIR/Build/clang/$ARCH"
|
||||||
-DLLVM_INSTALL_UTILS=OFF \
|
-DLLVM_INSTALL_UTILS=OFF \
|
||||||
${dev:+"-DLLVM_CCACHE_BUILD=ON"} || exit 1
|
${dev:+"-DLLVM_CCACHE_BUILD=ON"} || exit 1
|
||||||
|
|
||||||
buildstep "llvm+clang/build" ninja -j "$MAKEJOBS" || exit 1
|
buildstep_ninja "llvm+clang/build" ninja -j "$MAKEJOBS" || exit 1
|
||||||
buildstep "llvm+clang/install" ninja install || exit 1
|
buildstep "llvm+clang/install" ninja install || exit 1
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
@ -298,7 +309,7 @@ pushd "$DIR/Build/clang/$ARCH"
|
||||||
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \
|
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \
|
||||||
-DCOMPILER_RT_BUILD_XRAY=OFF || exit 1
|
-DCOMPILER_RT_BUILD_XRAY=OFF || exit 1
|
||||||
|
|
||||||
buildstep "compiler-rt/build" ninja -j "$MAKEJOBS" || exit 1
|
buildstep_ninja "compiler-rt/build" ninja -j "$MAKEJOBS" || exit 1
|
||||||
buildstep "compiler-rt/install" ninja install || exit 1
|
buildstep "compiler-rt/install" ninja install || exit 1
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
@ -319,7 +330,7 @@ pushd "$DIR/Build/clang/$ARCH"
|
||||||
-DLIBUNWIND_TARGET_TRIPLE="$LLVM_TARGET" \
|
-DLIBUNWIND_TARGET_TRIPLE="$LLVM_TARGET" \
|
||||||
-DLIBUNWIND_SYSROOT="$SYSROOT" || exit 1
|
-DLIBUNWIND_SYSROOT="$SYSROOT" || exit 1
|
||||||
|
|
||||||
buildstep "libunwind/build" ninja -j "$MAKEJOBS" || exit 1
|
buildstep_ninja "libunwind/build" ninja -j "$MAKEJOBS" || exit 1
|
||||||
buildstep "libunwind/install" ninja install || exit 1
|
buildstep "libunwind/install" ninja install || exit 1
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
@ -343,7 +354,7 @@ pushd "$DIR/Build/clang/$ARCH"
|
||||||
-DLIBCXXABI_ENABLE_ASSERTIONS=OFF \
|
-DLIBCXXABI_ENABLE_ASSERTIONS=OFF \
|
||||||
-DLIBCXXABI_BAREMETAL=ON || exit 1
|
-DLIBCXXABI_BAREMETAL=ON || exit 1
|
||||||
|
|
||||||
buildstep "libcxxabi/build" ninja -j "$MAKEJOBS" || exit 1
|
buildstep_ninja "libcxxabi/build" ninja -j "$MAKEJOBS" || exit 1
|
||||||
buildstep "libcxxabi/install" ninja install || exit 1
|
buildstep "libcxxabi/install" ninja install || exit 1
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue