[llvm] 10d2195 - Update the Windows packaging script

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Mon May 30 02:58:29 PDT 2022


Author: Hans Wennborg
Date: 2022-05-30T11:58:13+02:00
New Revision: 10d2195305ac49605f2b7b6a25a4076c31923191

URL: https://github.com/llvm/llvm-project/commit/10d2195305ac49605f2b7b6a25a4076c31923191
DIFF: https://github.com/llvm/llvm-project/commit/10d2195305ac49605f2b7b6a25a4076c31923191.diff

LOG: Update the Windows packaging script

Check in updates based on how the latest release was built [0] and add
the bug fix from [1] which allows LLDB to start.

Other changes which had accumulated in the local release script:
- Don't build the clang format plugin (VS has the functionality built
  in now)
- Disable tests that have been failing (I'll try to follow up and
  re-enable them)
- Switch to Python 3.10
- Jump through more hoops to make LLDB pick the right Python.

0. https://discourse.llvm.org/t/14-0-4-final-has-been-tagged/62750/3
1. https://github.com/llvm/llvm-project/issues/54589

Added: 
    

Modified: 
    llvm/utils/release/build_llvm_package.bat

Removed: 
    


################################################################################
diff  --git a/llvm/utils/release/build_llvm_package.bat b/llvm/utils/release/build_llvm_package.bat
index 418f72efcb824..5b29eabddde5c 100755
--- a/llvm/utils/release/build_llvm_package.bat
+++ b/llvm/utils/release/build_llvm_package.bat
@@ -21,8 +21,8 @@ REM   https://github.com/swig/swig/issues/769
 REM You need to modify the paths below:
 set vsdevcmd=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\VsDevCmd.bat
 
-set python32_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36-32
-set python64_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36
+set python32_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310-32
+set python64_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310
 
 for /f "usebackq" %%i in (`PowerShell ^(Get-Date^).ToString^('yyyyMMdd'^)`) do set datestamp=%%i
 
@@ -33,7 +33,6 @@ set build_dir=llvm_package_%revision:~0,8%
 
 echo Revision: %revision%
 echo Package version: %package_version%
-echo Clang format plugin version: %clang_format_vs_version%
 echo Build dir: %build_dir%
 echo.
 pause
@@ -49,47 +48,49 @@ mv llvm-project-* llvm-project || exit /b
 REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
 set cmake_flags=^
   -DCMAKE_BUILD_TYPE=Release ^
-  -DLLVM_ENABLE_ASSERTIONS=ON ^
+  -DLLVM_ENABLE_ASSERTIONS=OFF ^
   -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON ^
   -DLLVM_BUILD_LLVM_C_DYLIB=ON ^
   -DCMAKE_INSTALL_UCRT_LIBRARIES=ON ^
-  -DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% ^
+  -DPython3_FIND_REGISTRY=NEVER ^
   -DPACKAGE_VERSION=%package_version% ^
   -DLLDB_RELOCATABLE_PYTHON=1 ^
+  -DLLDB_EMBED_PYTHON_HOME=OFF ^
   -DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe ^
   -DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: " ^
-  -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;compiler-rt;openmp;lldb"
+  -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;compiler-rt;lldb;openmp"
 
 REM TODO: Run the "check-all" tests.
 
+set OLDPATH=%PATH%
+
 set "VSCMD_START_DIR=%CD%"
 call "%vsdevcmd%" -arch=x86
+set PATH=%python32_dir%;%PATH%
 set CC=
 set CXX=
 mkdir build32_stage0
 cd build32_stage0
-cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPYTHON_EXECUTABLE=%python32_dir%\python.exe ..\llvm-project\llvm || exit /b
-ninja all || ninja all || ninja all || exit /b
-ninja check || ninja check || ninja check || exit /b
-ninja check-clang || ninja check-clang || ninja check-clang || exit /b
+cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPython3_ROOT_DIR=%python32_dir% ..\llvm-project\llvm || exit /b
+ninja || ninja || ninja || exit /b
+REM ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
+REM ninja check-clang || ninja check-clang || ninja check-clang || exit /b
 ninja check-lld || ninja check-lld || ninja check-lld || exit /b
 ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
-ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
-ninja check-clangd || ninja check-clangd || ninja check-clangd || exit /b
+REM ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
 cd..
 
 mkdir build32
 cd build32
 set CC=..\build32_stage0\bin\clang-cl
 set CXX=..\build32_stage0\bin\clang-cl
-cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPYTHON_EXECUTABLE=%python32_dir%\python.exe ..\llvm-project\llvm || exit /b
-ninja all || ninja all || ninja all || exit /b
-ninja check || ninja check || ninja check || exit /b
-ninja check-clang || ninja check-clang || ninja check-clang || exit /b
+cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPython3_ROOT_DIR=%python32_dir% ..\llvm-project\llvm || exit /b
+ninja || ninja || ninja || exit /b
+REM ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
+REM ninja check-clang || ninja check-clang || ninja check-clang || exit /b
 ninja check-lld || ninja check-lld || ninja check-lld || exit /b
 ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
-ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
-ninja check-clangd || ninja check-clangd || ninja check-clangd || exit /b
+REM ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
 ninja package || exit /b
 
 7z x LLVM-%package_version%-win32.exe -orepack
@@ -99,28 +100,17 @@ del repack\Uninstall.exe
 cd ..
 
 
-REM The plug-in is built separately as it uses a statically linked clang-format.exe.
-mkdir build_vsix
-cd build_vsix
-REM Having VSSDKINSTALL set makes devenv *not* find the SDK for some reason.
-set VSSDKINSTALL=
-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% -DPYTHON_EXECUTABLE=%python32_dir%\python.exe ..\llvm-project\llvm || exit /b
-ninja clang_format_vsix || exit /b
-copy ..\llvm-project\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
-cd ..
-
-
 set "VSCMD_START_DIR=%CD%"
+set PATH=%OLDPATH%
 call "%vsdevcmd%" -arch=amd64
+set PATH=%python64_dir%;%PATH%
 set CC=
 set CXX=
 mkdir build64_stage0
 cd build64_stage0
-cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPYTHON_EXECUTABLE=%python64_dir%\python.exe ..\llvm-project\llvm || exit /b
-ninja all || ninja all || ninja all || exit /b
-ninja check || ninja check || ninja check || exit /b
+cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPython3_ROOT_DIR=%python64_dir% ..\llvm-project\llvm || exit /b
+ninja || ninja || ninja || exit /b
+ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
 ninja check-clang || ninja check-clang || ninja check-clang || exit /b
 ninja check-lld || ninja check-lld || ninja check-lld || exit /b
 ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
@@ -132,9 +122,9 @@ mkdir build64
 cd build64
 set CC=..\build64_stage0\bin\clang-cl
 set CXX=..\build64_stage0\bin\clang-cl
-cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPYTHON_EXECUTABLE=%python64_dir%\python.exe ..\llvm-project\llvm || exit /b
-ninja all || ninja all || ninja all || exit /b
-ninja check || ninja check || ninja check || exit /b
+cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPython3_ROOT_DIR=%python64_dir% ..\llvm-project\llvm || exit /b
+ninja || ninja || ninja || exit /b
+ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
 ninja check-clang || ninja check-clang || ninja check-clang || exit /b
 ninja check-lld || ninja check-lld || ninja check-lld || exit /b
 ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b


        


More information about the llvm-commits mailing list