Skip to content

Commit e867644

Browse files
Fix windows
1 parent b6e7981 commit e867644

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

PCbuild/build.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ if "%IncludeExternals%"=="" set IncludeExternals=true
111111
if "%IncludeCTypes%"=="" set IncludeCTypes=true
112112
if "%IncludeSSL%"=="" set IncludeSSL=true
113113
if "%IncludeTkinter%"=="" set IncludeTkinter=true
114+
if "%UseJIT%" NEQ "true" set IncludeLLVM=false
114115

115116
if "%IncludeExternals%"=="true" call "%dir%get_externals.bat"
116117

PCbuild/get_externals.bat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ set IncludeSSLSrc=false
1515
if "%~1"=="--no-tkinter" (set IncludeTkinter=false) & shift & goto CheckOpts
1616
if "%~1"=="--no-openssl" (set IncludeSSL=false) & shift & goto CheckOpts
1717
if "%~1"=="--no-libffi" (set IncludeLibffi=false) & shift & goto CheckOpts
18+
if "%~1"=="--no-llvm" (set IncludeLLVM=false) & shift & goto CheckOpts
1819
if "%~1"=="--tkinter-src" (set IncludeTkinterSrc=true) & shift & goto CheckOpts
1920
if "%~1"=="--openssl-src" (set IncludeSSLSrc=true) & shift & goto CheckOpts
2021
if "%~1"=="--libffi-src" (set IncludeLibffiSrc=true) & shift & goto CheckOpts
@@ -81,6 +82,7 @@ if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi-3.4.4
8182
if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-3.0.18
8283
if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.15.0
8384
if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06
85+
if NOT "%IncludeLLVM%"=="false" set binaries=%binaries% llvm-20.1.8.0
8486

8587
for %%b in (%binaries%) do (
8688
if exist "%EXTERNALS_DIR%\%%b" (
@@ -99,7 +101,7 @@ goto end
99101

100102
:usage
101103
echo.Valid options: -c, --clean, --clean-only, --organization, --python,
102-
echo.--no-tkinter, --no-openssl
104+
echo.--no-tkinter, --no-openssl, --no-llvm
103105
echo.
104106
echo.Pull all sources and binaries necessary for compiling optional extension
105107
echo.modules that rely on external libraries.
@@ -115,4 +117,4 @@ echo.anything new.
115117
echo.
116118
exit /b -1
117119

118-
:end
120+
:end

PCbuild/regen.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,4 @@
187187
</Target>
188188

189189
<Target Name="PostBuildRegen" DependsOnTargets="_RegenTestFrozenmain;_RegenLicense" />
190-
</Project>
190+
</Project>

Tools/jit/_llvm.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
import subprocess
99
import typing
1010

11+
import _targets
12+
1113
_LLVM_VERSION = 20
1214
_LLVM_VERSION_PATTERN = re.compile(rf"version\s+{_LLVM_VERSION}\.\d+\.\d+\S*\s+")
15+
_EXTERNALS_LLVM_TAG = "llvm-20.1.8.0"
1316

1417
_P = typing.ParamSpec("_P")
1518
_R = typing.TypeVar("_R")
@@ -72,6 +75,11 @@ async def _find_tool(tool: str, *, echo: bool = False) -> str | None:
7275
return path
7376
# Versioned executables:
7477
path = f"{tool}-{_LLVM_VERSION}"
78+
if await _check_tool_version(path, echo=echo):
79+
return path
80+
# PCbuild externals:
81+
externals = os.environ.get("EXTERNALS_DIR", _targets.EXTERNALS)
82+
path = os.path.join(externals, _EXTERNALS_LLVM_TAG, "bin", tool)
7583
if await _check_tool_version(path, echo=echo):
7684
return path
7785
# Homebrew-installed executables:

Tools/jit/_targets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
TOOLS_JIT = TOOLS_JIT_BUILD.parent
2626
TOOLS = TOOLS_JIT.parent
2727
CPYTHON = TOOLS.parent
28+
EXTERNALS = CPYTHON / "externals"
2829
PYTHON_EXECUTOR_CASES_C_H = CPYTHON / "Python" / "executor_cases.c.h"
2930
TOOLS_JIT_TEMPLATE_C = TOOLS_JIT / "template.c"
3031

0 commit comments

Comments
 (0)