llvm.org GIT mirror llvm / fb17afb
Fix several issues with the test-release.sh script * Use the default install prefix (/usr/local) and use DESTDIR instead to set a temporary install location for tarballing. This is the correct way to package binary releases (otherwise the temporary install path ends up in files in the binary release). * Remove ``-disable-clang`` option. It did not work correctly (tarballing assumed phase 3 was run) and when doing a release we should always be doing a three-phased build and test. Note: Technically we should only be using DESTDIR for the third phase and use --prefix for the first and second phase because we run the built clang from phase 1 and 2 (and in general an application's behaviour may depend on the install prefix). However in the case of clang it seems to not care what the install prefix was so to simplify the script we use DESTDIR for all three stages. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242187 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Liew 4 years ago
1 changed file(s) with 63 addition(s) and 68 deletion(s). Raw diff Collapse all Expand all
2828 Triple=""
2929 use_gzip="no"
3030 do_checkout="yes"
31 do_clang="yes"
3231 do_64bit="yes"
3332 do_debug="no"
3433 do_asserts="no"
4746 echo " -build-dir DIR Directory to perform testing in. [default: pwd]"
4847 echo " -no-checkout Don't checkout the sources from SVN."
4948 echo " -no-64bit Don't test the 64-bit version. [default: yes]"
50 echo " -disable-clang Do not test clang. [default: enable]"
5149 echo " -test-debug Test the debug build. [default: no]"
5250 echo " -test-asserts Test with asserts on. [default: no]"
5351 echo " -no-compare-files Don't test that phase 2 and 3 files are identical."
9492 ;;
9593 -no-64bit | --no-64bit )
9694 do_64bit="no"
97 ;;
98 -disable-clang | --disable-clang )
99 do_clang="no"
10095 ;;
10196 -test-debug | --test-debug )
10297 do_debug="yes"
257252 ;;
258253 esac
259254
255 if [ -z "$InstallDir" ]; then
256 echo "Using default install prefix"
257 PrefixArg=""
258 else
259 PrefixArg="--prefix=$InstallDir"
260 fi
261
260262 echo "# Using C compiler: $c_compiler"
261263 echo "# Using C++ compiler: $cxx_compiler"
262264
264266
265267 cd $ObjDir
266268 echo "# Configuring llvm $Release-$RC $Flavor"
267 echo "# $BuildDir/llvm.src/configure --prefix=$InstallDir \
269 echo "# $BuildDir/llvm.src/configure $PrefixArg \
268270 --enable-optimized=$Optimized \
269271 --enable-assertions=$Assertions \
270272 --disable-timestamps \
271273 $build_triple_option"
272274 env CC="$c_compiler" CXX="$cxx_compiler" \
273 $BuildDir/llvm.src/configure --prefix=$InstallDir \
275 $BuildDir/llvm.src/configure $PrefixArg \
274276 --enable-optimized=$Optimized \
275277 --enable-assertions=$Assertions \
276278 --disable-timestamps \
283285 Phase="$1"
284286 Flavor="$2"
285287 ObjDir="$3"
288 DestDir="$4"
286289 ExtraOpts=""
287290
288291 if [ "$Flavor" = "Release-64" ]; then
298301 echo "# Installing llvm $Release-$RC $Flavor"
299302 echo "# ${MAKE} install"
300303 ${MAKE} install \
304 DESTDIR="${DestDir}" \
301305 2>&1 | tee $LogDir/llvm.install-Phase$Phase-$Flavor.log
302306 cd $BuildDir
303307 }
384388 cxx_compiler="$CXX"
385389
386390 llvmCore_phase1_objdir=$BuildDir/Phase1/$Flavor/llvmCore-$Release-$RC.obj
387 llvmCore_phase1_installdir=$BuildDir/Phase1/$Flavor/llvmCore-$Release-$RC.install
391 llvmCore_phase1_destdir=$BuildDir/Phase1/$Flavor/llvmCore-$Release-$RC.install
388392
389393 llvmCore_phase2_objdir=$BuildDir/Phase2/$Flavor/llvmCore-$Release-$RC.obj
390 llvmCore_phase2_installdir=$BuildDir/Phase2/$Flavor/llvmCore-$Release-$RC.install
394 llvmCore_phase2_destdir=$BuildDir/Phase2/$Flavor/llvmCore-$Release-$RC.install
391395
392396 llvmCore_phase3_objdir=$BuildDir/Phase3/$Flavor/llvmCore-$Release-$RC.obj
393 llvmCore_phase3_installdir=$BuildDir/Phase3/$Flavor/llvmCore-$Release-$RC.install
397 llvmCore_phase3_destdir=$BuildDir/Phase3/$Flavor/llvmCore-$Release-$RC.install
394398
395399 rm -rf $llvmCore_phase1_objdir
396 rm -rf $llvmCore_phase1_installdir
400 rm -rf $llvmCore_phase1_destdir
397401
398402 rm -rf $llvmCore_phase2_objdir
399 rm -rf $llvmCore_phase2_installdir
403 rm -rf $llvmCore_phase2_destdir
400404
401405 rm -rf $llvmCore_phase3_objdir
402 rm -rf $llvmCore_phase3_installdir
406 rm -rf $llvmCore_phase3_destdir
403407
404408 mkdir -p $llvmCore_phase1_objdir
405 mkdir -p $llvmCore_phase1_installdir
409 mkdir -p $llvmCore_phase1_destdir
406410
407411 mkdir -p $llvmCore_phase2_objdir
408 mkdir -p $llvmCore_phase2_installdir
412 mkdir -p $llvmCore_phase2_destdir
409413
410414 mkdir -p $llvmCore_phase3_objdir
411 mkdir -p $llvmCore_phase3_installdir
415 mkdir -p $llvmCore_phase3_destdir
412416
413417 ############################################################################
414418 # Phase 1: Build llvmCore and clang
415419 echo "# Phase 1: Building llvmCore"
416420 configure_llvmCore 1 $Flavor \
417 $llvmCore_phase1_objdir $llvmCore_phase1_installdir
421 $llvmCore_phase1_objdir ""
418422 build_llvmCore 1 $Flavor \
419 $llvmCore_phase1_objdir
420 clean_RPATH $llvmCore_phase1_installdir
421
422 # Test clang
423 if [ "$do_clang" = "yes" ]; then
424 ########################################################################
425 # Phase 2: Build llvmCore with newly built clang from phase 1.
426 c_compiler=$llvmCore_phase1_installdir/bin/clang
427 cxx_compiler=$llvmCore_phase1_installdir/bin/clang++
428 echo "# Phase 2: Building llvmCore"
429 configure_llvmCore 2 $Flavor \
430 $llvmCore_phase2_objdir $llvmCore_phase2_installdir
431 build_llvmCore 2 $Flavor \
432 $llvmCore_phase2_objdir
433 clean_RPATH $llvmCore_phase2_installdir
434
435 ########################################################################
436 # Phase 3: Build llvmCore with newly built clang from phase 2.
437 c_compiler=$llvmCore_phase2_installdir/bin/clang
438 cxx_compiler=$llvmCore_phase2_installdir/bin/clang++
439 echo "# Phase 3: Building llvmCore"
440 configure_llvmCore 3 $Flavor \
441 $llvmCore_phase3_objdir $llvmCore_phase3_installdir
442 build_llvmCore 3 $Flavor \
443 $llvmCore_phase3_objdir
444 clean_RPATH $llvmCore_phase3_installdir
445
446 ########################################################################
447 # Testing: Test phase 3
448 echo "# Testing - built with clang"
449 test_llvmCore 3 $Flavor $llvmCore_phase3_objdir
450
451 ########################################################################
452 # Compare .o files between Phase2 and Phase3 and report which ones
453 # differ.
454 if [ "$do_compare" = "yes" ]; then
455 echo
456 echo "# Comparing Phase 2 and Phase 3 files"
457 for o in `find $llvmCore_phase2_objdir -name '*.o'` ; do
458 p3=`echo $o | sed -e 's,Phase2,Phase3,'`
459 if ! cmp --ignore-initial=16 $o $p3 > /dev/null 2>&1 ; then
460 echo "file `basename $o` differs between phase 2 and phase 3"
461 fi
462 done
463 fi
464 fi
465
466 # Otherwise just test the core.
467 if [ "$do_clang" != "yes" ]; then
468 echo "# Testing - built with system compiler"
469 test_llvmCore 1 $Flavor $llvmCore_phase1_objdir
423 $llvmCore_phase1_objdir $llvmCore_phase1_destdir
424 clean_RPATH $llvmCore_phase1_destdir/usr/local
425
426 ########################################################################
427 # Phase 2: Build llvmCore with newly built clang from phase 1.
428 c_compiler=$llvmCore_phase1_destdir/usr/local/bin/clang
429 cxx_compiler=$llvmCore_phase1_destdir/usr/local/bin/clang++
430 echo "# Phase 2: Building llvmCore"
431 configure_llvmCore 2 $Flavor \
432 $llvmCore_phase2_objdir ""
433 build_llvmCore 2 $Flavor \
434 $llvmCore_phase2_objdir $llvmCore_phase2_destdir
435 clean_RPATH $llvmCore_phase2_destdir/usr/local
436
437 ########################################################################
438 # Phase 3: Build llvmCore with newly built clang from phase 2.
439 c_compiler=$llvmCore_phase2_destdir/usr/local/bin/clang
440 cxx_compiler=$llvmCore_phase2_destdir/usr/local/bin/clang++
441 echo "# Phase 3: Building llvmCore"
442 configure_llvmCore 3 $Flavor \
443 $llvmCore_phase3_objdir ""
444 build_llvmCore 3 $Flavor \
445 $llvmCore_phase3_objdir $llvmCore_phase3_destdir
446 clean_RPATH $llvmCore_phase3_destdir/usr/local
447
448 ########################################################################
449 # Testing: Test phase 3
450 echo "# Testing - built with clang"
451 test_llvmCore 3 $Flavor $llvmCore_phase3_objdir
452
453 ########################################################################
454 # Compare .o files between Phase2 and Phase3 and report which ones
455 # differ.
456 if [ "$do_compare" = "yes" ]; then
457 echo
458 echo "# Comparing Phase 2 and Phase 3 files"
459 for o in `find $llvmCore_phase2_objdir -name '*.o'` ; do
460 p3=`echo $o | sed -e 's,Phase2,Phase3,'`
461 if ! cmp --ignore-initial=16 $o $p3 > /dev/null 2>&1 ; then
462 echo "file `basename $o` differs between phase 2 and phase 3"
463 fi
464 done
470465 fi
471466 done
472467 ) 2>&1 | tee $LogDir/testing.$Release-$RC.log