Skip to content

Commit 8f6d84a

Browse files
Address PR comment to use PreferredToolArchitecture
1 parent 46c9cd0 commit 8f6d84a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.github/workflows/jit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jobs:
9999
with:
100100
python-version: '3.11'
101101

102+
# test comment to trigger JIT CI
102103
# PCbuild downloads LLVM automatically:
103104
- name: Windows
104105
if: runner.os == 'Windows'

PCbuild/get_external.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ def fetch_zip(commit_hash, zip_dir, *, org='python', binary=False, verbose):
4545

4646

4747
def fetch_release(tag, tarball_dir, *, org='python', verbose=False):
48-
arch = platform.machine()
49-
# i686 (32-bit) builds can use x64 LLVM for cross-compilation
50-
if arch == 'x86':
51-
arch = 'AMD64'
48+
# Use PreferredToolArchitecture if set, otherwise fall back to platform.machine()
49+
arch = os.environ.get('PreferredToolArchitecture')
50+
if not arch:
51+
arch = platform.machine()
52+
arch = {'AMD64': 'x64', 'x86': 'x64'}.get(arch, arch)
5253
reporthook = None
5354
if verbose:
5455
reporthook = print

Tools/jit/jit_infra.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To update the LLVM release artifact for Windows builds, follow these steps:
1414
# For x86_64 (AMD64)
1515
tar -xf clang+llvm-21.1.4-x86_64-pc-windows-msvc.tar.xz
1616
mv clang+llvm-21.1.4-x86_64-pc-windows-msvc llvm-21.1.4.0
17-
tar -cf - llvm-21.1.4.0 | pv | xz > llvm-21.1.4.0-AMD64.tar.xz
17+
tar -cf - llvm-21.1.4.0 | pv | xz > llvm-21.1.4.0-x64.tar.xz
1818
rm -rf llvm-21.1.4.0
1919

2020
# For ARM64
@@ -31,5 +31,5 @@ To update the LLVM release artifact for Windows builds, follow these steps:
3131

3232
### Other notes
3333
- You must make sure that the name of the artifact matches exactly what is expected in `Tools/jit/_llvm.py` and `PCbuild/get_externals.py`.
34-
- The artifact filename must include the architecture suffix (e.g. `llvm-21.1.4.0-AMD64.tar.xz`, `llvm-21.1.4.0-ARM64.tar.xz`).
34+
- The artifact filename must include the architecture suffix (e.g. `llvm-21.1.4.0-x64.tar.xz`, `llvm-21.1.4.0-ARM64.tar.xz`).
3535
- You must have permissions to create releases in the `cpython-bin-deps` repository. If you don't have permissions, you should contact one of the organization admins.

0 commit comments

Comments
 (0)