[llvm] a30972f - [test-release] Added -silent-log flag to test-release.sh

Tobias Hieta via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 23:34:59 PDT 2022


Author: Tobias Hieta
Date: 2022-03-31T08:34:53+02:00
New Revision: a30972fbd7a511f4a96d732fe390e046a29f139d

URL: https://github.com/llvm/llvm-project/commit/a30972fbd7a511f4a96d732fe390e046a29f139d
DIFF: https://github.com/llvm/llvm-project/commit/a30972fbd7a511f4a96d732fe390e046a29f139d.diff

LOG: [test-release] Added -silent-log flag to test-release.sh

This flag silents the build output of test-release.sh so that
it can be used in CI systems a bit better. It will still log
the build output to the log files but not echo it to stdout.

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D122146

Added: 
    

Modified: 
    llvm/utils/release/test-release.sh

Removed: 
    


################################################################################
diff  --git a/llvm/utils/release/test-release.sh b/llvm/utils/release/test-release.sh
index 009f9358145f3..ef36c7846bed1 100755
--- a/llvm/utils/release/test-release.sh
+++ b/llvm/utils/release/test-release.sh
@@ -40,6 +40,7 @@ do_lldb="yes"
 do_polly="yes"
 do_mlir="yes"
 do_flang="yes"
+do_silent_log="no"
 BuildDir="`pwd`"
 ExtraConfigureFlags=""
 ExportBranch=""
@@ -75,6 +76,7 @@ function usage() {
     echo " -no-polly            Disable check-out & build Polly"
     echo " -no-mlir             Disable check-out & build MLIR"
     echo " -no-flang            Disable check-out & build Flang"
+    echo " -silent-log          Don't output build logs to stdout"
 }
 
 while [ $# -gt 0 ]; do
@@ -179,6 +181,9 @@ while [ $# -gt 0 ]; do
         -no-flang )
             do_flang="no"
             ;;
+        -silent-log )
+            do_silent_log="yes"
+            ;;
         -help | --help | -h | --h | -\? )
             usage
             exit 0
@@ -421,16 +426,22 @@ function build_llvmCore() {
       Verbose="-v"
     fi
 
+    redir="/dev/stdout"
+    if [ $do_silent_log == "yes" ]; then
+      echo "# Silencing build logs because of -silent-log flag..."
+      redir="/dev/null"
+    fi
+
     cd $ObjDir
     echo "# Compiling llvm $Release-$RC $Flavor"
     echo "# ${MAKE} -j $NumJobs $Verbose"
     ${MAKE} -j $NumJobs $Verbose \
-        2>&1 | tee $LogDir/llvm.make-Phase$Phase-$Flavor.log
+        2>&1 | tee $LogDir/llvm.make-Phase$Phase-$Flavor.log > $redir
 
     echo "# Installing llvm $Release-$RC $Flavor"
     echo "# ${MAKE} install"
     DESTDIR="${DestDir}" ${MAKE} install \
-        2>&1 | tee $LogDir/llvm.install-Phase$Phase-$Flavor.log
+        2>&1 | tee $LogDir/llvm.install-Phase$Phase-$Flavor.log > $redir
     cd $BuildDir
 }
 


        


More information about the llvm-commits mailing list