Skip to content

Commit 10d2195

Browse files
committed
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. #54589
1 parent d245974 commit 10d2195

File tree

1 file changed

+27
-37
lines changed

1 file changed

+27
-37
lines changed

llvm/utils/release/build_llvm_package.bat

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ REM https://github.com/swig/swig/issues/769
2121
REM You need to modify the paths below:
2222
set vsdevcmd=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\VsDevCmd.bat
2323

24-
set python32_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36-32
25-
set python64_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36
24+
set python32_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310-32
25+
set python64_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310
2626

2727
for /f "usebackq" %%i in (`PowerShell ^(Get-Date^).ToString^('yyyyMMdd'^)`) do set datestamp=%%i
2828

@@ -33,7 +33,6 @@ set build_dir=llvm_package_%revision:~0,8%
3333

3434
echo Revision: %revision%
3535
echo Package version: %package_version%
36-
echo Clang format plugin version: %clang_format_vs_version%
3736
echo Build dir: %build_dir%
3837
echo.
3938
pause
@@ -49,47 +48,49 @@ mv llvm-project-* llvm-project || exit /b
4948
REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
5049
set cmake_flags=^
5150
-DCMAKE_BUILD_TYPE=Release ^
52-
-DLLVM_ENABLE_ASSERTIONS=ON ^
51+
-DLLVM_ENABLE_ASSERTIONS=OFF ^
5352
-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON ^
5453
-DLLVM_BUILD_LLVM_C_DYLIB=ON ^
5554
-DCMAKE_INSTALL_UCRT_LIBRARIES=ON ^
56-
-DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% ^
55+
-DPython3_FIND_REGISTRY=NEVER ^
5756
-DPACKAGE_VERSION=%package_version% ^
5857
-DLLDB_RELOCATABLE_PYTHON=1 ^
58+
-DLLDB_EMBED_PYTHON_HOME=OFF ^
5959
-DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe ^
6060
-DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: " ^
61-
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;compiler-rt;openmp;lldb"
61+
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;compiler-rt;lldb;openmp"
6262

6363
REM TODO: Run the "check-all" tests.
6464

65+
set OLDPATH=%PATH%
66+
6567
set "VSCMD_START_DIR=%CD%"
6668
call "%vsdevcmd%" -arch=x86
69+
set PATH=%python32_dir%;%PATH%
6770
set CC=
6871
set CXX=
6972
mkdir build32_stage0
7073
cd build32_stage0
71-
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPYTHON_EXECUTABLE=%python32_dir%\python.exe ..\llvm-project\llvm || exit /b
72-
ninja all || ninja all || ninja all || exit /b
73-
ninja check || ninja check || ninja check || exit /b
74-
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
74+
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPython3_ROOT_DIR=%python32_dir% ..\llvm-project\llvm || exit /b
75+
ninja || ninja || ninja || exit /b
76+
REM ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
77+
REM ninja check-clang || ninja check-clang || ninja check-clang || exit /b
7578
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
7679
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
77-
ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
78-
ninja check-clangd || ninja check-clangd || ninja check-clangd || exit /b
80+
REM ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
7981
cd..
8082

8183
mkdir build32
8284
cd build32
8385
set CC=..\build32_stage0\bin\clang-cl
8486
set CXX=..\build32_stage0\bin\clang-cl
85-
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPYTHON_EXECUTABLE=%python32_dir%\python.exe ..\llvm-project\llvm || exit /b
86-
ninja all || ninja all || ninja all || exit /b
87-
ninja check || ninja check || ninja check || exit /b
88-
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
87+
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python32_dir% -DPython3_ROOT_DIR=%python32_dir% ..\llvm-project\llvm || exit /b
88+
ninja || ninja || ninja || exit /b
89+
REM ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
90+
REM ninja check-clang || ninja check-clang || ninja check-clang || exit /b
8991
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
9092
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
91-
ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
92-
ninja check-clangd || ninja check-clangd || ninja check-clangd || exit /b
93+
REM ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b
9394
ninja package || exit /b
9495

9596
7z x LLVM-%package_version%-win32.exe -orepack
@@ -99,28 +100,17 @@ del repack\Uninstall.exe
99100
cd ..
100101

101102

102-
REM The plug-in is built separately as it uses a statically linked clang-format.exe.
103-
mkdir build_vsix
104-
cd build_vsix
105-
REM Having VSSDKINSTALL set makes devenv *not* find the SDK for some reason.
106-
set VSSDKINSTALL=
107-
set CC=..\build32_stage0\bin\clang-cl
108-
set CXX=..\build32_stage0\bin\clang-cl
109-
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
110-
ninja clang_format_vsix || exit /b
111-
copy ..\llvm-project\llvm\tools\clang\tools\clang-format-vs\ClangFormat\bin\Release\ClangFormat.vsix ClangFormat-r%revision%.vsix
112-
cd ..
113-
114-
115103
set "VSCMD_START_DIR=%CD%"
104+
set PATH=%OLDPATH%
116105
call "%vsdevcmd%" -arch=amd64
106+
set PATH=%python64_dir%;%PATH%
117107
set CC=
118108
set CXX=
119109
mkdir build64_stage0
120110
cd build64_stage0
121-
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPYTHON_EXECUTABLE=%python64_dir%\python.exe ..\llvm-project\llvm || exit /b
122-
ninja all || ninja all || ninja all || exit /b
123-
ninja check || ninja check || ninja check || exit /b
111+
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPython3_ROOT_DIR=%python64_dir% ..\llvm-project\llvm || exit /b
112+
ninja || ninja || ninja || exit /b
113+
ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
124114
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
125115
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
126116
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b
@@ -132,9 +122,9 @@ mkdir build64
132122
cd build64
133123
set CC=..\build64_stage0\bin\clang-cl
134124
set CXX=..\build64_stage0\bin\clang-cl
135-
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPYTHON_EXECUTABLE=%python64_dir%\python.exe ..\llvm-project\llvm || exit /b
136-
ninja all || ninja all || ninja all || exit /b
137-
ninja check || ninja check || ninja check || exit /b
125+
cmake -GNinja %cmake_flags% -DPYTHON_HOME=%python64_dir% -DPython3_ROOT_DIR=%python64_dir% ..\llvm-project\llvm || exit /b
126+
ninja || ninja || ninja || exit /b
127+
ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b
138128
ninja check-clang || ninja check-clang || ninja check-clang || exit /b
139129
ninja check-lld || ninja check-lld || ninja check-lld || exit /b
140130
ninja check-sanitizer || ninja check-sanitizer || ninja check-sanitizer || exit /b

0 commit comments

Comments
 (0)