summaryrefslogtreecommitdiffstats
path: root/llvm/utils/release
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2019-02-11 10:30:22 +0000
committerDiana Picus <diana.picus@linaro.org>2019-02-11 10:30:22 +0000
commit2d29cc311be98ad9600a67a868464462f59b917c (patch)
treeb88f573efe071df36f5060144c595ce1110e0767 /llvm/utils/release
parent0e04ebdcda44ef90e25abd0a2e65cc755ae8bc37 (diff)
downloadbcm5719-llvm-2d29cc311be98ad9600a67a868464462f59b917c.tar.gz
bcm5719-llvm-2d29cc311be98ad9600a67a868464462f59b917c.zip
test-release.sh: Add option to use ninja
Allow the use of ninja instead of make. This is useful on some platforms where we'd like to be able to limit the number of link jobs without slowing down the other steps of the release. This patch adds a -use-ninja command line option, which sets the generator to Ninja both for LLVM and the test-suite. It also deals with some differences between make and ninja: * DESTDIR handling - ninja doesn't like this to be listed after the target, but both make and ninja can handle it before the command * Verbose mode - ninja uses -v, make uses VERBOSE=1 * Keep going mode - make has a -k mode, which builds as much as possible even when failures are encountered; for ninja we need to set a hard limit (we use 100 since most people won't look at 100 failures anyway) I haven't tested with gmake. llvm-svn: 353685
Diffstat (limited to 'llvm/utils/release')
-rwxr-xr-xllvm/utils/release/test-release.sh38
1 files changed, 29 insertions, 9 deletions
diff --git a/llvm/utils/release/test-release.sh b/llvm/utils/release/test-release.sh
index 7457f60c9a9..558e01d2eab 100755
--- a/llvm/utils/release/test-release.sh
+++ b/llvm/utils/release/test-release.sh
@@ -17,6 +17,7 @@ if [ "$System" = "FreeBSD" ]; then
else
MAKE=make
fi
+generator="Unix Makefiles"
# Base SVN URL for the sources.
Base_url="http://llvm.org/svn/llvm-project"
@@ -57,6 +58,7 @@ function usage() {
echo " -test-asserts Test with asserts on. [default: no]"
echo " -no-compare-files Don't test that phase 2 and 3 files are identical."
echo " -use-gzip Use gzip instead of xz."
+ echo " -use-ninja Use ninja instead of make/gmake."
echo " -configure-flags FLAGS Extra flags to pass to the configure step."
echo " -svn-path DIR Use the specified DIR instead of a release."
echo " For example -svn-path trunk or -svn-path branches/release_37"
@@ -111,6 +113,10 @@ while [ $# -gt 0 ]; do
NumJobs="$1"
fi
;;
+ -use-ninja )
+ MAKE=ninja
+ generator=Ninja
+ ;;
-build-dir | --build-dir | -builddir | --builddir )
shift
BuildDir="$1"
@@ -277,6 +283,8 @@ if [ "$System" != "Darwin" ]; then
check_program_exists 'objdump'
fi
+check_program_exists ${MAKE}
+
# Make sure that the URLs are valid.
function check_valid_urls() {
for proj in $projects ; do
@@ -365,12 +373,12 @@ function configure_llvmCore() {
echo "# Configuring llvm $Release-$RC $Flavor"
echo "#" env CC="$c_compiler" CXX="$cxx_compiler" \
- cmake -G "Unix Makefiles" \
+ cmake -G "$generator" \
-DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
$ExtraConfigureFlags $BuildDir/llvm.src \
2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
env CC="$c_compiler" CXX="$cxx_compiler" \
- cmake -G "Unix Makefiles" \
+ cmake -G "$generator" \
-DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
$ExtraConfigureFlags $BuildDir/llvm.src \
2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
@@ -384,16 +392,20 @@ function build_llvmCore() {
ObjDir="$3"
DestDir="$4"
+ Verbose="VERBOSE=1"
+ if [ ${MAKE} = 'ninja' ]; then
+ Verbose="-v"
+ fi
+
cd $ObjDir
echo "# Compiling llvm $Release-$RC $Flavor"
- echo "# ${MAKE} -j $NumJobs VERBOSE=1"
- ${MAKE} -j $NumJobs VERBOSE=1 \
+ echo "# ${MAKE} -j $NumJobs $Verbose"
+ ${MAKE} -j $NumJobs $Verbose \
2>&1 | tee $LogDir/llvm.make-Phase$Phase-$Flavor.log
echo "# Installing llvm $Release-$RC $Flavor"
echo "# ${MAKE} install"
- ${MAKE} install \
- DESTDIR="${DestDir}" \
+ DESTDIR="${DestDir}" ${MAKE} install \
2>&1 | tee $LogDir/llvm.install-Phase$Phase-$Flavor.log
cd $BuildDir
}
@@ -403,8 +415,15 @@ function test_llvmCore() {
Flavor="$2"
ObjDir="$3"
+ KeepGoing="-k"
+ if [ ${MAKE} = 'ninja' ]; then
+ # Ninja doesn't have a documented "keep-going-forever" mode, we need to
+ # set a limit on how many jobs can fail before we give up.
+ KeepGoing="-k 100"
+ fi
+
cd $ObjDir
- if ! ( ${MAKE} -j $NumJobs -k check-all \
+ if ! ( ${MAKE} -j $NumJobs $KeepGoing check-all \
2>&1 | tee $LogDir/llvm.check-Phase$Phase-$Flavor.log ) ; then
deferred_error $Phase $Flavor "check-all failed"
fi
@@ -412,8 +431,9 @@ function test_llvmCore() {
if [ $do_test_suite = 'yes' ]; then
cd $TestSuiteBuildDir
env CC="$c_compiler" CXX="$cxx_compiler" \
- cmake $TestSuiteSrcDir -DTEST_SUITE_LIT=$Lit
- if ! ( ${MAKE} -j $NumJobs -k check \
+ cmake $TestSuiteSrcDir -G "$generator" -DTEST_SUITE_LIT=$Lit
+
+ if ! ( ${MAKE} -j $NumJobs $KeepGoing check \
2>&1 | tee $LogDir/llvm.check-Phase$Phase-$Flavor.log ) ; then
deferred_error $Phase $Flavor "test suite failed"
fi
OpenPOWER on IntegriCloud