[llvm] Ensure that python directory exists before starting build (PR #76581)

Saint Wesonga via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 29 11:08:33 PST 2023


https://github.com/swesonga created https://github.com/llvm/llvm-project/pull/76581

Later steps will fail if the python directory does not exist. Performing this check first avoids wasting time downloading and extracting sources only for the build to later fail because python cannot be found.

>From f1026e5773abd9b7ea0ce1a62ee022084f180799 Mon Sep 17 00:00:00 2001
From: Saint Wesonga <saint.wesonga at microsoft.com>
Date: Fri, 29 Dec 2023 12:02:34 -0700
Subject: [PATCH] Ensure that python directory exists before starting build

Later steps will fail if the python directory does not exist.
Performing this check first avoids wasting time downloading
and extracting sources only for the build to later fail because
python cannot be found.
---
 llvm/utils/release/build_llvm_release.bat | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/llvm/utils/release/build_llvm_release.bat b/llvm/utils/release/build_llvm_release.bat
index 2a1503eef8ae5c..61c0100a1965a7 100755
--- a/llvm/utils/release/build_llvm_release.bat
+++ b/llvm/utils/release/build_llvm_release.bat
@@ -110,6 +110,25 @@ set python32_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310-32
 set python64_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python310
 set pythonarm64_dir=C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python311-arm64
 
+if "%x86%" == "true" (
+  if not exist %python32_dir% (
+    echo Can't find python directory %python32_dir%
+    exit /b 1
+  )
+)
+if "%x64%" == "true" (
+  if not exist %python64_dir% (
+    echo Can't find python directory %python64_dir%
+    exit /b 1
+  )
+)
+if "%arm64%" == "true" (
+  if not exist %pythonarm64_dir% (
+    echo Can't find python directory %pythonarm64_dir%
+    exit /b 1
+  )
+)
+
 set revision=llvmorg-%version%
 set package_version=%version%
 set build_dir=%cd%\llvm_package_%package_version%



More information about the llvm-commits mailing list