diff options
Diffstat (limited to 'gnu/llvm/utils/release')
-rwxr-xr-x | gnu/llvm/utils/release/build_llvm_package.bat | 37 | ||||
-rwxr-xr-x | gnu/llvm/utils/release/merge-request.sh | 198 | ||||
-rwxr-xr-x | gnu/llvm/utils/release/test-release.sh | 57 |
3 files changed, 255 insertions, 37 deletions
diff --git a/gnu/llvm/utils/release/build_llvm_package.bat b/gnu/llvm/utils/release/build_llvm_package.bat index bb6853f57c6..79871781211 100755 --- a/gnu/llvm/utils/release/build_llvm_package.bat +++ b/gnu/llvm/utils/release/build_llvm_package.bat @@ -8,9 +8,10 @@ REM Usage: build_llvm_package.bat <revision> REM Prerequisites:
REM
-REM Visual Studio 2015, CMake, Ninja, SVN, GNUWin32, SWIG, Python 3,
+REM Visual Studio 2017, CMake, Ninja, SVN, GNUWin32, SWIG, Python 3,
REM NSIS with the strlen_8192 patch,
-REM Visual Studio 2015 SDK (for the clang-format plugin).
+REM Visual Studio 2017 SDK and Nuget (for the clang-format plugin),
+REM Perl (for the OpenMP run-time).
REM
REM
REM For LLDB, SWIG version <= 3.0.8 needs to be used to work around
@@ -18,15 +19,15 @@ REM https://github.com/swig/swig/issues/769 REM You need to modify the paths below:
-set vcdir=c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
-set python32_dir=C:\Users\hwennborg\AppData\Local\Programs\Python\Python35-32
-set python64_dir=C:\Users\hwennborg\AppData\Local\Programs\Python\Python35
-set PATH=%PATH%;c:\gnuwin32\bin
+set vsdevcmd=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat
+
+set python32_dir=C:\Users\%USER%\AppData\Local\Programs\Python\Python35-32
+set python64_dir=C:\Users\%USER%\AppData\Local\Programs\Python\Python35
set revision=%1
set branch=trunk
-set package_version=4.0.0-r%revision%
-set clang_format_vs_version=4.0.0.%revision%
+set package_version=5.0.0-r%revision%
+set clang_format_vs_version=5.0.0.%revision%
set build_dir=llvm_package_%revision%
echo Branch: %branch%
@@ -47,14 +48,15 @@ svn.exe export -r %revision% http://llvm.org/svn/llvm-project/clang-tools-extra/ svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lld/%branch% llvm/tools/lld || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/compiler-rt/%branch% llvm/projects/compiler-rt || exit /b
svn.exe export -r %revision% http://llvm.org/svn/llvm-project/openmp/%branch% llvm/projects/openmp || exit /b
+svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lldb/%branch% llvm/tools/lldb || exit /b
REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
-set cmake_flags=-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON -DLLVM_USE_CRT_RELEASE=MT -DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% -DPACKAGE_VERSION=%package_version% -DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe -DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: "
+set cmake_flags=-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON -DCMAKE_INSTALL_UCRT_LIBRARIES=ON -DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% -DPACKAGE_VERSION=%package_version% -DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe -DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: "
REM TODO: Run all tests, including lld and compiler-rt.
-call "%vcdir%/vcvarsall.bat" x86
+call "%vsdevcmd%" -arch=x86
set CC=
set CXX=
mkdir build32_stage0
@@ -69,16 +71,25 @@ mkdir build32 cd build32
set CC=..\build32_stage0\bin\clang-cl
set CXX=..\build32_stage0\bin\clang-cl
-cmake -GNinja %cmake_flags% -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
+cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
ninja all || exit /b
ninja check || ninja check || ninja check || exit /b
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
-copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
ninja package || exit /b
cd ..
+REM The plug-in is built separately as it uses a statically linked clang-format.exe.
+mkdir build_vsix
+cd build_vsix
+set CC=..\build32_stage0\bin\clang-cl
+set CXX=..\build32_stage0\bin\clang-cl
+cmake -GNinja %cmake_flags% -DLLVM_USE_CRT_RELEASE=MT -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DPYTHON_HOME=%python32_dir% ..\llvm || exit /b
+ninja clang_format_vsix || exit /b
+copy ..\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
+cd ..
+
-call "%vcdir%/vcvarsall.bat" amd64
+call "%vsdevcmd%" -arch=amd64
set CC=
set CXX=
mkdir build64_stage0
diff --git a/gnu/llvm/utils/release/merge-request.sh b/gnu/llvm/utils/release/merge-request.sh new file mode 100755 index 00000000000..703023aaa79 --- /dev/null +++ b/gnu/llvm/utils/release/merge-request.sh @@ -0,0 +1,198 @@ +# !/bin/bash +#===-- merge-request.sh ---------------------------------------------------===# +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. +# +#===------------------------------------------------------------------------===# +# +# Submit a merge request to bugzilla. +# +#===------------------------------------------------------------------------===# + +dryrun="" +stable_version="" +revision="" +BUGZILLA_BIN="" +BUGZILLA_CMD="" +release_metabug="" +bugzilla_product="new-bugs" +bugzilla_component="new bugs" +bugzilla_assigned_to="" +bugzilla_user="" +bugzilla_version="" +bugzilla_url="https://bugs.llvm.org/xmlrpc.cgi" + +function usage() { + echo "usage: `basename $0` -user EMAIL -stable-version X.Y -r NUM" + echo "" + echo " -user EMAIL Your email address for logging into bugzilla." + echo " -stable-version X.Y The stable release version (e.g. 4.0, 5.0)." + echo " -r NUM Revision number to merge (e.g. 1234567)." + echo " -bugzilla-bin PATH Path to bugzilla binary (optional)." + echo " -assign-to EMAIL Assign bug to user with EMAIL (optional)." + echo " -dry-run Print commands instead of executing them." +} + +while [ $# -gt 0 ]; do + case $1 in + -user) + shift + bugzilla_user="$1" + ;; + -stable-version) + shift + stable_version="$1" + ;; + -r) + shift + revision="$1" + ;; + -project) + shift + project="$1" + ;; + -component) + shift + bugzilla_component="$1" + ;; + -bugzilla-bin) + shift + BUGZILLA_BIN="$1" + ;; + -assign-to) + shift + bugzilla_assigned_to="--assigned_to=$1" + ;; + -dry-run) + dryrun="echo" + ;; + -help | --help | -h | --h | -\? ) + usage + exit 0 + ;; + * ) + echo "unknown option: $1" + usage + exit 1 + ;; + esac + shift +done + +if [ -z "$stable_version" ]; then + echo "error: no stable version specified" + exit 1 +fi + +case $stable_version in + 4.0) + release_metabug="32061" + ;; + *) + echo "error: invalid stable version" + exit 1 +esac +bugzilla_version=$stable_version + +if [ -z "$revision" ]; then + echo "error: revision not specified" + exit 1 +fi + +if [ -z "$bugzilla_user" ]; then + echo "error: bugzilla username not specified." + exit 1 +fi + +if [ -z "$BUGZILLA_BIN" ]; then + BUGZILLA_BIN=`which bugzilla` + if [ $? -ne 0 ]; then + echo "error: could not find bugzilla executable." + echo "Make sure the bugzilla cli tool is installed on your system: " + echo "pip install python-bugzilla (recommended)" + echo "" + echo "Fedora: dnf install python-bugzilla" + echo "Ubuntu/Debian: apt-get install bugzilla-cli" + exit 1 + fi +fi + +BUGZILLA_MAJOR_VERSION=`$BUGZILLA_BIN --version 2>&1 | cut -d . -f 1` + +if [ $BUGZILLA_MAJOR_VERSION -eq 1 ]; then + + echo "***************************** Warning *******************************" + echo "You are using an older version of the bugzilla cli tool. You will be " + echo "able to create bugs, but this script will crash with the following " + echo "error when trying to read back information about the bug you created:" + echo "" + echo "KeyError: 'internals'" + echo "" + echo "To avoid this error, use version 2.0.0 or higher" + echo "https://pypi.python.org/pypi/python-bugzilla" + echo "*********************************************************************" +fi + +BUGZILLA_CMD="$BUGZILLA_BIN --bugzilla=$bugzilla_url" + +bug_url="https://reviews.llvm.org/rL$revision" + +echo "Checking for duplicate bugs..." + +check_duplicates=`$BUGZILLA_CMD query --url $bug_url` + +if [ -n "$check_duplicates" ]; then + echo "Duplicate bug found:" + echo $check_duplicates + exit 1 +fi + +echo "Done" + +# Get short commit summary +commit_summary='' +commit_msg=`svn log -r $revision https://llvm.org/svn/llvm-project/` +if [ $? -ne 0 ]; then + echo "warning: failed to get commit message." + commit_msg="" +fi + +if [ -n "$commit_msg" ]; then + commit_summary=`echo "$commit_msg" | sed '4q;d' | cut -c1-80` + commit_summary=" : ${commit_summary}" +fi + +bug_summary="Merge r$revision into the $stable_version branch${commit_summary}" + +if [ -z "$dryrun" ]; then + set -x +fi + +${dryrun} $BUGZILLA_CMD --login --user=$bugzilla_user new \ + -p "$bugzilla_product" \ + -c "$bugzilla_component" -u $bug_url --blocked=$release_metabug \ + -o All --priority=P --arch All -v $bugzilla_version \ + --summary "${bug_summary}" \ + -l "Is this patch OK to merge to the $stable_version branch?" \ + $bugzilla_assigned_to \ + --oneline + +set +x + +if [ -n "$dryrun" ]; then + exit 0 +fi + +if [ $BUGZILLA_MAJOR_VERSION -eq 1 ]; then + success=`$BUGZILLA_CMD query --url $bug_url` + if [ -z "$success" ]; then + echo "Failed to create bug." + exit 1 + fi + + echo " Created new bug:" + echo $success +fi diff --git a/gnu/llvm/utils/release/test-release.sh b/gnu/llvm/utils/release/test-release.sh index b0c77157980..66a2c578083 100755 --- a/gnu/llvm/utils/release/test-release.sh +++ b/gnu/llvm/utils/release/test-release.sh @@ -38,7 +38,7 @@ do_test_suite="yes" do_openmp="yes" do_lld="yes" do_lldb="no" -do_polly="no" +do_polly="yes" BuildDir="`pwd`" ExtraConfigureFlags="" ExportBranch="" @@ -68,8 +68,7 @@ function usage() { echo " -no-lld Disable check-out & build lld" echo " -lldb Enable check-out & build lldb" echo " -no-lldb Disable check-out & build lldb (default)" - echo " -polly Enable check-out & build Polly" - echo " -no-polly Disable check-out & build Polly (default)" + echo " -no-polly Disable check-out & build Polly" } while [ $# -gt 0 ]; do @@ -154,9 +153,6 @@ while [ $# -gt 0 ]; do -no-lldb ) do_lldb="no" ;; - -polly ) - do_polly="yes" - ;; -no-polly ) do_polly="no" ;; @@ -173,13 +169,6 @@ while [ $# -gt 0 ]; do shift done -if [ "$do_test_suite" = "yes" ]; then - # See llvm.org/PR26146. - echo Skipping test-suite build when using CMake. - echo It will still be exported. - do_test_suite="export-only" -fi - # Check required arguments. if [ -z "$Release" ]; then echo "error: no release number specified" @@ -315,11 +304,7 @@ function export_sources() { projsrc=llvm.src/projects/$proj ;; test-suite) - if [ $do_test_suite = 'yes' ]; then - projsrc=llvm.src/projects/$proj - else - projsrc=$proj.src - fi + projsrc=$proj.src ;; *) echo "error: unknown project $proj" @@ -417,6 +402,15 @@ function test_llvmCore() { deferred_error $Phase $Flavor "check-all failed" fi + 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 \ + 2>&1 | tee $LogDir/llvm.check-Phase$Phase-$Flavor.log ) ; then + deferred_error $Phase $Flavor "test suite failed" + fi + fi cd $BuildDir } @@ -464,6 +458,19 @@ if [ "$do_checkout" = "yes" ]; then export_sources fi +# Setup the test-suite. Do this early so we can catch failures before +# we do the full 3 stage build. +if [ $do_test_suite = "yes" ]; then + SandboxDir="$BuildDir/sandbox" + Lit=$SandboxDir/bin/lit + TestSuiteBuildDir="$BuildDir/test-suite-build" + TestSuiteSrcDir="$BuildDir/test-suite.src" + + virtualenv $SandboxDir + $SandboxDir/bin/python $BuildDir/llvm.src/utils/lit/setup.py install + mkdir -p $TestSuiteBuildDir +fi + ( Flavors="Release" if [ "$do_debug" = "yes" ]; then @@ -543,6 +550,8 @@ for Flavor in $Flavors ; do ######################################################################## # Testing: Test phase 3 + c_compiler=$llvmCore_phase3_destdir/usr/local/bin/clang + cxx_compiler=$llvmCore_phase3_destdir/usr/local/bin/clang++ echo "# Testing - built with clang" test_llvmCore 3 $Flavor $llvmCore_phase3_objdir @@ -558,7 +567,7 @@ for Flavor in $Flavors ; do # case there are build paths in the debug info. On some systems, # sed adds a newline to the output, so pass $p3 through sed too. if ! cmp -s \ - <(env LC_CTYPE=C sed -e 's,Phase2,Phase3,g' $p2) \ + <(env LC_CTYPE=C sed -e 's,Phase2,Phase3,g' -e 's,Phase1,Phase2,g' $p2) \ <(env LC_CTYPE=C sed -e '' $p3) 16 16; then echo "file `basename $p2` differs between phase 2 and phase 3" fi @@ -568,17 +577,17 @@ done ) 2>&1 | tee $LogDir/testing.$Release-$RC.log +if [ "$use_gzip" = "yes" ]; then + echo "# Packaging the release as $Package.tar.gz" +else + echo "# Packaging the release as $Package.tar.xz" +fi package_release set +e # Woo hoo! echo "### Testing Finished ###" -if [ "$use_gzip" = "yes" ]; then - echo "### Package: $Package.tar.gz" -else - echo "### Package: $Package.tar.xz" -fi echo "### Logs: $LogDir" echo "### Errors:" |