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

Tobias Hieta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 08:26:46 PDT 2022


thieta created this revision.
thieta added a reviewer: tstellar.
Herald added a project: All.
thieta requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122146

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


Index: llvm/utils/release/test-release.sh
===================================================================
--- llvm/utils/release/test-release.sh
+++ llvm/utils/release/test-release.sh
@@ -40,6 +40,7 @@
 do_polly="yes"
 do_mlir="yes"
 do_flang="yes"
+do_silent_log="no"
 BuildDir="`pwd`"
 ExtraConfigureFlags=""
 ExportBranch=""
@@ -75,6 +76,7 @@
     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 @@
         -no-flang )
             do_flang="no"
             ;;
+        -silent-log )
+            do_silent_log="yes"
+            ;;
         -help | --help | -h | --h | -\? )
             usage
             exit 0
@@ -421,16 +426,22 @@
       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
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122146.416961.patch
Type: text/x-patch
Size: 1671 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220321/5b83feb4/attachment.bin>


More information about the llvm-commits mailing list