llvm.org GIT mirror llvm / 2ff2d32
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353685 91177308-0d34-0410-b5e6-96231b3b80d8 Diana Picus 1 year, 8 months ago
1 changed file(s) with 29 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
1616 else
1717 MAKE=make
1818 fi
19 generator="Unix Makefiles"
1920
2021 # Base SVN URL for the sources.
2122 Base_url="http://llvm.org/svn/llvm-project"
5657 echo " -test-asserts Test with asserts on. [default: no]"
5758 echo " -no-compare-files Don't test that phase 2 and 3 files are identical."
5859 echo " -use-gzip Use gzip instead of xz."
60 echo " -use-ninja Use ninja instead of make/gmake."
5961 echo " -configure-flags FLAGS Extra flags to pass to the configure step."
6062 echo " -svn-path DIR Use the specified DIR instead of a release."
6163 echo " For example -svn-path trunk or -svn-path branches/release_37"
110112 NumJobs="$1"
111113 fi
112114 ;;
115 -use-ninja )
116 MAKE=ninja
117 generator=Ninja
118 ;;
113119 -build-dir | --build-dir | -builddir | --builddir )
114120 shift
115121 BuildDir="$1"
275281 check_program_exists 'file'
276282 check_program_exists 'objdump'
277283 fi
284
285 check_program_exists ${MAKE}
278286
279287 # Make sure that the URLs are valid.
280288 function check_valid_urls() {
364372 echo "# Configuring llvm $Release-$RC $Flavor"
365373
366374 echo "#" env CC="$c_compiler" CXX="$cxx_compiler" \
367 cmake -G "Unix Makefiles" \
375 cmake -G "$generator" \
368376 -DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
369377 $ExtraConfigureFlags $BuildDir/llvm.src \
370378 2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
371379 env CC="$c_compiler" CXX="$cxx_compiler" \
372 cmake -G "Unix Makefiles" \
380 cmake -G "$generator" \
373381 -DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
374382 $ExtraConfigureFlags $BuildDir/llvm.src \
375383 2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
383391 ObjDir="$3"
384392 DestDir="$4"
385393
394 Verbose="VERBOSE=1"
395 if [ ${MAKE} = 'ninja' ]; then
396 Verbose="-v"
397 fi
398
386399 cd $ObjDir
387400 echo "# Compiling llvm $Release-$RC $Flavor"
388 echo "# ${MAKE} -j $NumJobs VERBOSE=1"
389 ${MAKE} -j $NumJobs VERBOSE=1 \
401 echo "# ${MAKE} -j $NumJobs $Verbose"
402 ${MAKE} -j $NumJobs $Verbose \
390403 2>&1 | tee $LogDir/llvm.make-Phase$Phase-$Flavor.log
391404
392405 echo "# Installing llvm $Release-$RC $Flavor"
393406 echo "# ${MAKE} install"
394 ${MAKE} install \
395 DESTDIR="${DestDir}" \
407 DESTDIR="${DestDir}" ${MAKE} install \
396408 2>&1 | tee $LogDir/llvm.install-Phase$Phase-$Flavor.log
397409 cd $BuildDir
398410 }
402414 Flavor="$2"
403415 ObjDir="$3"
404416
417 KeepGoing="-k"
418 if [ ${MAKE} = 'ninja' ]; then
419 # Ninja doesn't have a documented "keep-going-forever" mode, we need to
420 # set a limit on how many jobs can fail before we give up.
421 KeepGoing="-k 100"
422 fi
423
405424 cd $ObjDir
406 if ! ( ${MAKE} -j $NumJobs -k check-all \
425 if ! ( ${MAKE} -j $NumJobs $KeepGoing check-all \
407426 2>&1 | tee $LogDir/llvm.check-Phase$Phase-$Flavor.log ) ; then
408427 deferred_error $Phase $Flavor "check-all failed"
409428 fi
411430 if [ $do_test_suite = 'yes' ]; then
412431 cd $TestSuiteBuildDir
413432 env CC="$c_compiler" CXX="$cxx_compiler" \
414 cmake $TestSuiteSrcDir -DTEST_SUITE_LIT=$Lit
415 if ! ( ${MAKE} -j $NumJobs -k check \
433 cmake $TestSuiteSrcDir -G "$generator" -DTEST_SUITE_LIT=$Lit
434
435 if ! ( ${MAKE} -j $NumJobs $KeepGoing check \
416436 2>&1 | tee $LogDir/llvm.check-Phase$Phase-$Flavor.log ) ; then
417437 deferred_error $Phase $Flavor "test suite failed"
418438 fi