Lines Matching +full:- +full:release

2 #===-- test-release.sh - Test the LLVM release candidates ------------------===#
6 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 #===------------------------------------------------------------------------===#
10 # Download, build, and test the release candidate for an LLVM release.
12 #===------------------------------------------------------------------------===#
14 System=`uname -s`
15 Machine=`uname -m`
23 Release=""
60 echo "usage: `basename $0` -release X.Y.Z -rc NUM [OPTIONS]"
62 echo " -release X.Y.Z The release version to test."
63 echo " -rc NUM The pre-release candidate number."
64 echo " -final The final release candidate."
65 echo " -triple TRIPLE The target triple for this machine."
66 echo " -j NUM Number of compile jobs to run. [default: 3]"
67 echo " -build-dir DIR Directory to perform testing in. [default: pwd]"
68 echo " -no-checkout Don't checkout the sources from SVN."
69 echo " -test-debug Test the debug build. [default: no]"
70 echo " -test-asserts Test with asserts on. [default: no]"
71 echo " -no-compare-files Don't test that phase 2 and 3 files are identical."
72 echo " -use-gzip Use gzip instead of xz."
73 echo " -use-ninja Use ninja instead of make/gmake."
74 echo " -configure-flags FLAGS Extra flags to pass to the configure step."
75 echo " -git-ref sha Use the specified git ref for testing instead of a release."
76 echo " -no-rt Disable check-out & build Compiler-RT"
77 echo " -no-clang-tools Disable check-out & build clang-tools-extra"
78 echo " -no-libs Disable check-out & build libcxx/libcxxabi/libunwind"
79 echo " -no-libcxxabi Disable check-out & build libcxxabi"
80 echo " -no-libunwind Disable check-out & build libunwind"
81 echo " -no-test-suite Disable check-out & build test-suite"
82 echo " -no-openmp Disable check-out & build libomp"
83 echo " -no-lld Disable check-out & build lld"
84 echo " -lldb Enable check-out & build lldb"
85 echo " -no-lldb Disable check-out & build lldb (default)"
86 echo " -no-polly Disable check-out & build Polly"
87 echo " -no-mlir Disable check-out & build MLIR"
88 echo " -no-flang Disable check-out & build Flang"
89 echo " -silent-log Don't output build logs to stdout"
90 echo " -use-cmake-cache Build using a CMake cache file"
93 while [ $# -gt 0 ]; do
95 -release | --release )
97 Release="$1"
98 Release_no_dot="`echo $1 | sed -e 's,\.,,g'`"
100 -rc | --rc | -RC | --RC )
104 -final | --final )
107 -git-ref | --git-ref )
109 Release="test"
112 RC="`echo $ExportBranch | sed -e 's,/,_,g'`"
114 echo "WARNING: Using the ref $git_ref instead of a release tag"
118 -triple | --triple )
122 -configure-flags | --configure-flags )
126 -j* )
127 NumJobs="`echo $1 | sed -e 's,-j\([0-9]*\),\1,g'`"
128 if [ -z "$NumJobs" ]; then
133 -use-ninja )
137 -build-dir | --build-dir | -builddir | --builddir )
141 -no-checkout | --no-checkout )
144 -test-debug | --test-debug )
147 -test-asserts | --test-asserts )
150 -no-compare-files | --no-compare-files )
153 -use-gzip | --use-gzip )
156 -no-rt )
159 -no-libs )
162 -no-clang-tools )
165 -no-libcxxabi )
168 -no-libunwind )
171 -no-test-suite )
174 -no-openmp )
177 -bolt )
180 -no-bolt )
183 -no-lld )
186 -lldb )
189 -no-lldb )
192 -no-polly )
195 -no-mlir )
198 -no-flang )
201 -silent-log )
204 -use-cmake-cache | --use-cmake-cache )
207 -help | --help | -h | --h | -\? )
226 if [ -z "$Release" ]; then
227 echo "error: no release number specified"
230 if [ -z "$RC" ]; then
231 echo "error: no release candidate number specified"
234 if [ -z "$ExportBranch" ]; then
237 if [ -z "$Triple" ]; then
242 if [ "$Release" != "test" ]; then
243 if [ -n "$git_ref" ]; then
244 echo "error: can't specify both -release and -git-ref"
247 git_ref=llvmorg-$Release
249 git_ref="$git_ref-$RC"
256 if [ -z "$NumJobs" ]; then
257 NumJobs=`sysctl -n hw.activecpu 2> /dev/null || true`
259 if [ -z "$NumJobs" ]; then
260 NumJobs=`sysctl -n hw.ncpu 2> /dev/null || true`
262 if [ -z "$NumJobs" ]; then
263 NumJobs=`grep -c processor /proc/cpuinfo 2> /dev/null || true`
265 if [ -z "$NumJobs" ]; then
269 if [ "$MAKE" = "ninja" ] && [ -z "$UserNumJobs" ]; then
273 J_ARG="-j $NumJobs"
279 projects="${projects:+$projects;}clang-tools-extra"
283 runtimes="${runtimes:+$runtimes;}compiler-rt"
318 mkdir -p $BuildDir
323 mkdir -p $LogDir
326 Package=clang+llvm-$Release
328 Package=$Package-$RC
330 Package=$Package-$Triple
333 echo -n > $LogDir/deferred_errors.log
337 echo "# Silencing build logs because of -silent-log flag..."
345 SrcDir=$BuildDir/llvm-project/
348 rm -rf $CMakeBuildDir
351 set -x
354 cmake -G "$generator" -B $CMakeBuildDir -S $SrcDir/llvm \
355 -C $SrcDir/clang/cmake/caches/Release.cmake \
356 -DCLANG_BOOTSTRAP_PASSTHROUGH="LLVM_LIT_ARGS" \
357 -DLLVM_LIT_ARGS="-j $NumJobs $LitVerbose" \
359 2>&1 | tee $LogDir/llvm.configure-$Flavor.log
361 ${MAKE} $J_ARG $Verbose -C $CMakeBuildDir stage2-check-all \
362 2>&1 | tee $LogDir/llvm.make-$Flavor.log > $redir
365 ${MAKE} -C $CMakeBuildDir stage2-install \
366 2>&1 | tee $LogDir/llvm.install-$Flavor.log > $redir
368 mkdir -p $BuildDir/Release
369 pushd $BuildDir/Release
372 tar cf - $Package | gzip -9c > $BuildDir/$Package.tar.gz
374 tar cf - $Package | xz -9ce -T $NumJobs > $BuildDir/$Package.tar.xz
378 ) 2>&1 | tee $LogDir/testing.$Release-$RC.log
387 echo "[${Flavor} Phase${Phase}] ${Msg}" | tee -a $LogDir/deferred_errors.log
393 if ! type -P $program > /dev/null 2>&1 ; then
412 SrcDir=$BuildDir/llvm-project
413 mkdir -p $SrcDir
418 curl -L https://github.com/llvm/llvm-project/archive/$git_ref.tar.gz | \
419 tar -C $SrcDir --strip-components=1 -xzf -
422 TestSuiteSrcDir=$BuildDir/llvm-test-suite
423 mkdir -p $TestSuiteSrcDir
426 # both the llvm-project and test-suite repos if we want to run the
428 # If the test-suite fails to download assume we are using a ref that
431 curl -L https://github.com/llvm/test-suite/archive/$git_ref.tar.gz | \
432 tar -C $TestSuiteSrcDir --strip-components=1 -xzf -
433 if [ $? -ne -0 ]; then
434 echo "$git_ref not found in test-suite repo, test-suite disabled."
437 set -e
449 Release )
450 BuildType="Release"
453 Release+Asserts )
454 BuildType="Release"
471 if [ "$Phase" -lt "3" ]; then
479 if [ "$Phase" -lt "2" ]; then
481 # compiler-rt builtins is needed on AIX to have a functional Phase 1 clang.
483 runtime_list="compiler-rt"
493 echo "# Configuring llvm $Release-$RC $Flavor"
496 cmake -G "$generator" \
497 -DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
498 -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
499 -DLLVM_ENABLE_PROJECTS="$project_list" \
500 -DLLVM_LIT_ARGS="-j $NumJobs $LitVerbose" \
501 -DLLVM_ENABLE_RUNTIMES="$runtime_list" \
502 $ExtraConfigureFlags $BuildDir/llvm-project/llvm \
503 2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
505 cmake -G "$generator" \
506 -DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
507 -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
508 -DLLVM_ENABLE_PROJECTS="$project_list" \
509 -DLLVM_LIT_ARGS="-j $NumJobs $LitVerbose" \
510 -DLLVM_ENABLE_RUNTIMES="$runtime_list" \
511 $ExtraConfigureFlags $BuildDir/llvm-project/llvm \
512 2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
525 Verbose="-v"
527 LitVerbose="-v"
530 if [ "$Phase" -lt "3" ]; then
532 InstallTarget="install-clang install-clang-resource-headers"
533 # compiler-rt builtins is needed on AIX to have a functional Phase 1 clang.
536 InstallTarget="$InstallTarget install-builtins"
539 if [ "$Phase" -eq "3" ]; then
546 echo "# Compiling llvm $Release-$RC $Flavor"
549 2>&1 | tee $LogDir/llvm.make-Phase$Phase-$Flavor.log > $redir
551 echo "# Installing llvm $Release-$RC $Flavor"
554 2>&1 | tee $LogDir/llvm.install-Phase$Phase-$Flavor.log > $redir
563 KeepGoing="-k"
565 # Ninja doesn't have a documented "keep-going-forever" mode, we need to
567 KeepGoing="-k 100"
571 if ! ( ${MAKE} $J_ARG $KeepGoing $Verbose check-all \
572 2>&1 | tee $LogDir/llvm.check-Phase$Phase-$Flavor.log ) ; then
573 deferred_error $Phase $Flavor "check-all failed"
579 cmake $TestSuiteSrcDir -G "$generator" -DTEST_SUITE_LIT=$Lit \
580 -DTEST_SUITE_HOST_CC=$build_compiler
583 2>&1 | tee $LogDir/llvm.check-Phase$Phase-$Flavor.log ) ; then
591 # not necessary --- and even harmful --- for the binary packages we release.
597 for Candidate in `find $InstallPath/{bin,lib} -type f`; do
599 if rpath=`objdump -x $Candidate | grep 'RPATH'` ; then
600 rpath=`echo $rpath | sed -e's/^ *RPATH *//'`
601 if [ -n "$rpath" ]; then
602 newrpath=`echo $rpath | sed -e's/.*\(\$ORIGIN[^:]*\).*/\1/'`
603 chrpath -r $newrpath $Candidate 2>&1 > /dev/null 2>&1
610 # Create a package of the release binaries.
613 cd $BuildDir/Phase3/Release
614 mv llvmCore-$Release-$RC.install/usr/local $Package
616 tar cf - $Package | gzip -9c > $BuildDir/$Package.tar.gz
618 tar cf - $Package | xz -9ce -T $NumJobs > $BuildDir/$Package.tar.xz
620 mv $Package llvmCore-$Release-$RC.install/usr/local
627 set -e
628 set -o pipefail
632 ulimit -c 0
638 # Setup the test-suite. Do this early so we can catch failures before
642 venv="python3 -m venv"
646 TestSuiteBuildDir="$BuildDir/test-suite-build"
647 TestSuiteSrcDir="$BuildDir/llvm-test-suite"
650 $SandboxDir/bin/python -m pip install $BuildDir/llvm-project/llvm/utils/lit
651 mkdir -p $TestSuiteBuildDir
661 Flavors="Release"
666 Flavors="$Flavors Release+Asserts"
673 echo " Release: $Release-$RC"
676 echo " `uname -a`"
683 [[ -z "$build_compiler" ]] && build_compiler="cc"
684 llvmCore_phase1_objdir=$BuildDir/Phase1/$Flavor/llvmCore-$Release-$RC.obj
685 llvmCore_phase1_destdir=$BuildDir/Phase1/$Flavor/llvmCore-$Release-$RC.install
687 llvmCore_phase2_objdir=$BuildDir/Phase2/$Flavor/llvmCore-$Release-$RC.obj
688 llvmCore_phase2_destdir=$BuildDir/Phase2/$Flavor/llvmCore-$Release-$RC.install
690 llvmCore_phase3_objdir=$BuildDir/Phase3/$Flavor/llvmCore-$Release-$RC.obj
691 llvmCore_phase3_destdir=$BuildDir/Phase3/$Flavor/llvmCore-$Release-$RC.install
693 rm -rf $llvmCore_phase1_objdir
694 rm -rf $llvmCore_phase1_destdir
696 rm -rf $llvmCore_phase2_objdir
697 rm -rf $llvmCore_phase2_destdir
699 rm -rf $llvmCore_phase3_objdir
700 rm -rf $llvmCore_phase3_destdir
702 mkdir -p $llvmCore_phase1_objdir
703 mkdir -p $llvmCore_phase1_destdir
705 mkdir -p $llvmCore_phase2_objdir
706 mkdir -p $llvmCore_phase2_destdir
708 mkdir -p $llvmCore_phase3_objdir
709 mkdir -p $llvmCore_phase3_destdir
743 echo "# Testing - built with clang"
752 for p2 in `find $llvmCore_phase2_objdir -name '*.o'` ; do
753 p3=`echo $p2 | sed -e 's,Phase2,Phase3,'`
755 # case there are build paths in the debug info. Do the same sub-
757 if ! cmp -s \
758 <(env LC_ALL=C sed -e 's,Phase1,Phase2,g' -e 's,Phase2,Phase3,g' $p2) \
759 <(env LC_ALL=C sed -e 's,Phase1,Phase2,g' -e 's,Phase2,Phase3,g' $p3) \
767 ) 2>&1 | tee $LogDir/testing.$Release-$RC.log
770 echo "# Packaging the release as $Package.tar.gz"
772 echo "# Packaging the release as $Package.tar.xz"
783 if [ -s "$LogDir/deferred_errors.log" ]; then