Skip to content

Commit cd0aee7

Browse files
committed
Undo script hacks
1 parent af9dc8b commit cd0aee7

File tree

1 file changed

+32
-28
lines changed

1 file changed

+32
-28
lines changed

llvm/utils/release/build_llvm_release.bat

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
echo off
1+
@echo off
22

33
REM Filter out tests that are known to fail.
44
set "LIT_FILTER_OUT=gh110231.cpp|crt_initializers.cpp|init-order-atexit.cpp|use_after_return_linkage.cpp|initialization-bug.cpp|initialization-bug-no-global.cpp|trace-malloc-unbalanced.test|trace-malloc-2.test|TraceMallocTest"
@@ -220,14 +220,15 @@ set "stage0_bin_dir=%build_dir%/build32_stage0/bin"
220220
set cmake_flags=^
221221
%common_cmake_flags% ^
222222
-DLLVM_ENABLE_RPMALLOC=OFF ^
223+
-DPython3_ROOT_DIR=%PYTHONHOME% ^
223224
-DLIBXML2_INCLUDE_DIR=%libxmldir%/include/libxml2 ^
224225
-DLIBXML2_LIBRARIES=%libxmldir%/lib/libxml2s.lib
225226

226227
cmake -GNinja %cmake_flags% %llvm_src%\llvm || exit /b 1
227-
ninja || exit /b 1
228+
ninja || ninja || ninja || exit /b 1
228229
REM ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b 1
229230
REM ninja check-clang || ninja check-clang || ninja check-clang || exit /b 1
230-
ninja check-lld || exit /b 1
231+
ninja check-lld || ninja check-lld || ninja check-lld || exit /b 1
231232
REM ninja check-runtimes || ninja check-runtimes || ninja check-runtimes || exit /b 1
232233
REM ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b 1
233234
cd..
@@ -238,6 +239,7 @@ set all_cmake_flags=^
238239
%cmake_flags% ^
239240
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;" ^
240241
%common_lldb_flags% ^
242+
-DPYTHON_HOME=%PYTHONHOME% ^
241243
-DCMAKE_C_COMPILER=%stage0_bin_dir%/clang-cl.exe ^
242244
-DCMAKE_CXX_COMPILER=%stage0_bin_dir%/clang-cl.exe ^
243245
-DCMAKE_LINKER=%stage0_bin_dir%/lld-link.exe ^
@@ -248,10 +250,10 @@ set cmake_flags=%all_cmake_flags:\=/%
248250
mkdir build32
249251
cd build32
250252
cmake -GNinja %cmake_flags% %llvm_src%\llvm || exit /b 1
251-
ninja || ninja || ninja || ninja || exit /b 1
253+
ninja || ninja || ninja || exit /b 1
252254
REM ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b 1
253255
REM ninja check-clang || ninja check-clang || ninja check-clang || exit /b 1
254-
ninja check-lld || exit /b 1
256+
ninja check-lld || ninja check-lld || ninja check-lld || exit /b 1
255257
REM ninja check-runtimes || ninja check-runtimes || ninja check-runtimes || exit /b 1
256258
REM ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b 1
257259
ninja package || exit /b 1
@@ -278,6 +280,7 @@ REM Stage0 binaries directory; used in stage1.
278280
set "stage0_bin_dir=%build_dir%/build_%arch%_stage0/bin"
279281
set cmake_flags=^
280282
%common_cmake_flags% ^
283+
-DPython3_ROOT_DIR=%PYTHONHOME% ^
281284
-DLIBXML2_INCLUDE_DIR=%libxmldir%/include/libxml2 ^
282285
-DLIBXML2_LIBRARIES=%libxmldir%/lib/libxml2s.lib ^
283286
-DCLANG_DEFAULT_LINKER=lld
@@ -289,15 +292,15 @@ if "%arch%"=="arm64" (
289292
cmake -GNinja %cmake_flags% ^
290293
-DLLVM_TARGETS_TO_BUILD=Native ^
291294
%llvm_src%\llvm || exit /b 1
292-
ninja || exit /b 1
293-
ninja check-llvm || exit /b 1
294-
ninja check-clang || exit /b 1
295-
ninja check-lld || exit /b 1
295+
ninja || ninja || ninja || exit /b 1
296+
ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b 1
297+
ninja check-clang || ninja check-clang || ninja check-clang || exit /b 1
298+
ninja check-lld || ninja check-lld || ninja check-lld || exit /b 1
296299
if "%arch%"=="amd64" (
297-
ninja check-runtimes || exit /b 1
300+
ninja check-runtimes || ninja check-runtimes || ninja check-runtimes || exit /b 1
298301
)
299-
REM ninja check-clang-tools || exit /b 1
300-
REM ninja check-clangd || exit /b 1
302+
ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b 1
303+
ninja check-clangd || ninja check-clangd || ninja check-clangd || exit /b 1
301304
cd..
302305

303306
REM CMake expects the paths that specifies the compiler and linker to be
@@ -318,19 +321,20 @@ set cmake_flags=%all_cmake_flags:\=/%
318321
mkdir build_%arch%
319322
cd build_%arch%
320323
call :do_generate_profile || exit /b 1
321-
cmake --trace-expand -GNinja %cmake_flags% ^
324+
cmake -GNinja %cmake_flags% ^
322325
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;flang;mlir" ^
323326
%common_lldb_flags% ^
327+
-DPYTHON_HOME=%PYTHONHOME% ^
324328
%cmake_profile_flags% %llvm_src%\llvm || exit /b 1
325-
ninja -v || ninja -v || ninja -v || exit /b 1
326-
ninja check-llvm || exit /b 1
327-
ninja check-clang || exit /b 1
328-
ninja check-lld || exit /b 1
329+
ninja || ninja || ninja || exit /b 1
330+
ninja check-llvm || ninja check-llvm || ninja check-llvm || exit /b 1
331+
ninja check-clang || ninja check-clang || ninja check-clang || exit /b 1
332+
ninja check-lld || ninja check-lld || ninja check-lld || exit /b 1
329333
if "%arch%"=="amd64" (
330-
ninja check-runtimes || exit /b 1
334+
ninja check-runtimes || ninja check-runtimes || ninja check-runtimes || exit /b 1
331335
)
332-
REM ninja check-clang-tools || exit /b 1
333-
REM ninja check-clangd || exit /b 1
336+
ninja check-clang-tools || ninja check-clang-tools || ninja check-clang-tools || exit /b 1
337+
ninja check-clangd || ninja check-clangd || ninja check-clangd || exit /b 1
334338
REM ninja check-flang || ninja check-flang || ninja check-flang || exit /b 1
335339
REM ninja check-mlir || ninja check-mlir || ninja check-mlir || exit /b 1
336340
REM ninja check-lldb || ninja check-lldb || ninja check-lldb || exit /b 1
@@ -362,14 +366,14 @@ set PATH=%OLDPATH%
362366
set python_dir=%1
363367

364368
REM Set Python environment
365-
::if "%local-python%" == "true" (
366-
:: FOR /F "delims=" %%i IN ('where python.exe ^| head -1') DO set python_exe=%%i
367-
:: set PYTHONHOME=!python_exe:~0,-11!
368-
::) else (
369-
:: %python_dir%/python.exe --version || exit /b 1
370-
:: set PYTHONHOME=%python_dir%
371-
::)
372-
::set PATH=%PYTHONHOME%;%PATH%
369+
if "%local-python%" == "true" (
370+
FOR /F "delims=" %%i IN ('where python.exe ^| head -1') DO set python_exe=%%i
371+
set PYTHONHOME=!python_exe:~0,-11!
372+
) else (
373+
%python_dir%/python.exe --version || exit /b 1
374+
set PYTHONHOME=%python_dir%
375+
)
376+
set PATH=%PYTHONHOME%;%PATH%
373377

374378
set "VSCMD_START_DIR=%build_dir%"
375379

0 commit comments

Comments
 (0)