https://github.com/python/cpython/commit/dea4083aa952c955a7c3a7657034bd38889a4e22
commit: dea4083aa952c955a7c3a7657034bd38889a4e22
branch: main
author: Chris Eibl <[email protected]>
committer: savannahostrowski <[email protected]>
date: 2026-04-03T12:42:13-07:00
summary:

GH-146210: Fix building the jit stencils on Windows when the interpreter is 
built with a different clang version (#146338)

Co-authored-by: Savannah Ostrowski <[email protected]>

files:
A Misc/NEWS.d/next/Build/2026-03-23-20-06-35.gh-issue-146210.C01Rmq.rst
M Tools/jit/_llvm.py

diff --git 
a/Misc/NEWS.d/next/Build/2026-03-23-20-06-35.gh-issue-146210.C01Rmq.rst 
b/Misc/NEWS.d/next/Build/2026-03-23-20-06-35.gh-issue-146210.C01Rmq.rst
new file mode 100644
index 00000000000000..ce59a9a3a571b4
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2026-03-23-20-06-35.gh-issue-146210.C01Rmq.rst
@@ -0,0 +1,2 @@
+Fix building the jit stencils on Windows when the interpreter is built with
+a different clang version. Patch by Chris Eibl.
diff --git a/Tools/jit/_llvm.py b/Tools/jit/_llvm.py
index 8b68c1e8636af7..a4aaacdf41249d 100644
--- a/Tools/jit/_llvm.py
+++ b/Tools/jit/_llvm.py
@@ -42,9 +42,19 @@ async def _run(tool: str, args: typing.Iterable[str], echo: 
bool = False) -> str
     async with _CORES:
         if echo:
             print(shlex.join(command))
+
+        if os.name == "nt":
+            # When building with /p:PlatformToolset=ClangCL, the VS build
+            # system puts that clang's include path into INCLUDE. The JIT's
+            # clang may be a different version, and mismatched headers cause
+            # build errors. See 
https://github.com/python/cpython/issues/146210.
+            env = os.environ.copy()
+            env.pop("INCLUDE", None)
+        else:
+            env = None
         try:
             process = await asyncio.create_subprocess_exec(
-                *command, stdout=subprocess.PIPE
+                *command, stdout=subprocess.PIPE, env=env
             )
         except FileNotFoundError:
             return None

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to