Skip to content

Commit 476508d

Browse files
committed
maybe install llvm for all windows jobs?
1 parent 2326b9a commit 476508d

4 files changed

Lines changed: 10 additions & 26 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,6 @@ jobs:
167167
arch: ${{ matrix.arch }}
168168
free-threading: ${{ matrix.free-threading }}
169169

170-
build-windows-system-llvm:
171-
name: Windows (Chocolatey LLVM)
172-
needs: build-context
173-
if: fromJSON(needs.build-context.outputs.run-windows-tests)
174-
uses: ./.github/workflows/reusable-windows.yml
175-
with:
176-
arch: x64
177-
llvm-from-choco: true
178-
179170
build-windows-msi:
180171
# ${{ '' } is a hack to nest jobs under the same sidebar category.
181172
name: Windows MSI${{ '' }} # zizmor: ignore[obfuscation]

.github/workflows/reusable-windows-msi.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@ jobs:
2222
env:
2323
ARCH: ${{ inputs.arch }}
2424
IncludeFreethreaded: true
25-
IncludeLLVM: true
26-
LIBCLANG_PATH: "${{ github.workspace }}\\externals\\llvm-21.1.4.0\\bin"
2725
steps:
2826
- uses: actions/checkout@v4
2927
with:
3028
persist-credentials: false
3129
- uses: dtolnay/[email protected]
3230
with:
3331
targets: i686-pc-windows-msvc,x86_64-pc-windows-msvc,aarch64-pc-windows-msvc
32+
- name: Install LLVM for bindgen
33+
shell: cmd
34+
run: |
35+
choco install llvm --allow-downgrade --no-progress --version 21.1.0
36+
if not exist "C:\Program Files\LLVM\bin\libclang.dll" exit /b 1
37+
echo LIBCLANG_PATH=C:\Program Files\LLVM\bin>> "%GITHUB_ENV%"
38+
echo LLVMInstallDir=C:\Program Files\LLVM>> "%GITHUB_ENV%"
3439
- name: Build CPython installer
3540
run: ./Tools/msi/build.bat --doc -"${ARCH}"
3641
shell: bash

.github/workflows/reusable-windows.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ on:
77
description: CPU architecture
88
required: true
99
type: string
10-
llvm-from-choco:
11-
description: Whether to install LLVM from Chocolatey and expose LIBCLANG_PATH
12-
required: false
13-
type: boolean
14-
default: false
1510
free-threading:
1611
description: Whether to compile CPython in free-threading mode
1712
required: false
@@ -37,21 +32,13 @@ jobs:
3732
- uses: dtolnay/[email protected]
3833
with:
3934
targets: i686-pc-windows-msvc,x86_64-pc-windows-msvc,aarch64-pc-windows-msvc
40-
- name: Install LLVM from Chocolatey
41-
if: fromJSON(inputs.llvm-from-choco)
35+
- name: Install LLVM for bindgen
4236
shell: cmd
4337
run: |
4438
choco install llvm --allow-downgrade --no-progress --version 21.1.0
4539
if not exist "C:\Program Files\LLVM\bin\libclang.dll" exit /b 1
46-
echo IncludeLLVM=false>> "%GITHUB_ENV%"
4740
echo LIBCLANG_PATH=C:\Program Files\LLVM\bin>> "%GITHUB_ENV%"
4841
echo LLVMInstallDir=C:\Program Files\LLVM>> "%GITHUB_ENV%"
49-
- name: Use bundled LLVM
50-
if: ${{ !fromJSON(inputs.llvm-from-choco) }}
51-
shell: cmd
52-
run: |
53-
echo IncludeLLVM=true>> "%GITHUB_ENV%"
54-
echo LIBCLANG_PATH=%GITHUB_WORKSPACE%\externals\llvm-21.1.4.0\bin>> "%GITHUB_ENV%"
5542
- name: Register MSVC problem matcher
5643
if: inputs.arch != 'Win32'
5744
run: echo "::add-matcher::.github/problem-matchers/msvc.json"

PCbuild/_base64.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ if "$(Configuration)"=="Debug" (set "PY_DEBUG=1") else (set "PY_DEBUG=")
126126
if "$(DisableGil)"=="true" (set "PY_GIL_DISABLED=1") else (set "PY_GIL_DISABLED=")
127127
where cargo >NUL 2>NUL || (echo WARNING: cargo was not found on PATH, skipping _base64 & exit /b 0)
128128
if not "$(LibClangPath)"=="" set "LIBCLANG_PATH=$(LibClangPath)"
129-
if "$(LibClangPath)"=="" if not defined LIBCLANG_PATH (echo WARNING: libclang.dll was not found, skipping _base64. Install LLVM or the Visual Studio Clang tools and set LIBCLANG_PATH. & exit /b 0)
129+
if "$(LibClangPath)"=="" if not defined LIBCLANG_PATH (echo WARNING: libclang was not found, skipping _base64 & exit /b 0)
130+
if defined LIBCLANG_PATH if not exist "%LIBCLANG_PATH%\libclang.dll" if not exist "%LIBCLANG_PATH%\clang.dll" (echo WARNING: libclang.dll not found at %LIBCLANG_PATH%, skipping _base64 & exit /b 0)
130131
if not exist "$(CargoTargetDirNoSlash)" mkdir "$(CargoTargetDirNoSlash)"
131132
set "CARGO_TARGET_DIR=$(CargoTargetDirNoSlash)"
132133
set "PYTHON_BUILD_DIR=$(PythonBuildDir)"

0 commit comments

Comments
 (0)