From 16c9a50164d3ebed1c20c47f3d91e168b046abc0 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 4 Mar 2025 16:55:14 -0600 Subject: [PATCH 1/5] Update Windows builds to use ClangCL --- cpython-windows/build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 47bdc493..47d6f321 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -653,6 +653,9 @@ def run_msbuild( # This can also work around known incompatibilities with the Windows 11 # SDK as of at least CPython 3.9.7. f"/property:DefaultWindowsSDKVersion={windows_sdk_version}", + # Use ClangCL for better build and runtime performance + # https://github.com/python/cpython/issues/130090 + "/p:PlatformToolset=ClangCL", ] if freethreaded: From 2636c55c33ab4e51b76d8d9f3a70c3fb627af970 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 18 Mar 2025 17:04:57 -0500 Subject: [PATCH 2/5] debug: Try setting some clang compatibility flags? --- cpython-windows/build.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 47d6f321..92ce922c 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -656,6 +656,7 @@ def run_msbuild( # Use ClangCL for better build and runtime performance # https://github.com/python/cpython/issues/130090 "/p:PlatformToolset=ClangCL", + "/p:AdditionalOptions=/clang:-fms-compatibility-version=19.29 /clang:-Wno-ignored-attributes" ] if freethreaded: From 4033e0d59e88065a4992b77e7099ae8a24bc1b10 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 18 Mar 2025 17:22:01 -0500 Subject: [PATCH 3/5] debug: explicitly set `-m64`? --- cpython-windows/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 92ce922c..45cf5d0c 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -656,7 +656,7 @@ def run_msbuild( # Use ClangCL for better build and runtime performance # https://github.com/python/cpython/issues/130090 "/p:PlatformToolset=ClangCL", - "/p:AdditionalOptions=/clang:-fms-compatibility-version=19.29 /clang:-Wno-ignored-attributes" + "/p:AdditionalOptions=-m64", ] if freethreaded: From 093564335adaf1af9beab9cd6d771b4aa94a3dba Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 18 Mar 2025 18:02:47 -0500 Subject: [PATCH 4/5] debug: try `"/p:PreferredToolArchitecture=x64"` --- cpython-windows/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 45cf5d0c..d9252a19 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -656,7 +656,7 @@ def run_msbuild( # Use ClangCL for better build and runtime performance # https://github.com/python/cpython/issues/130090 "/p:PlatformToolset=ClangCL", - "/p:AdditionalOptions=-m64", + "/p:PreferredToolArchitecture=%s" % platform, ] if freethreaded: From 10a69b0440e4f5c9eb7b38afbf2311d879d172fb Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 18 Mar 2025 18:50:14 -0500 Subject: [PATCH 5/5] Drop "exp" file --- cpython-windows/build.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index d9252a19..c1864966 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -1073,6 +1073,13 @@ def find_additional_dependencies(project: pathlib.Path): exts = ("lib", "exp") for ext in exts: + # On 3.14+, we're building with ClangCL which does not produce `.exp` + # files. + if ext == "exp" and python_majmin == "314": + # TODO(zanieb): Scope this specifically to use of ClangCL instead of + # MSVC / determine if it's a bug that this file is missing. + continue + source = outputs_path / ("python%s%s.%s" % (python_majmin, lib_suffix, ext)) dest = core_dir / ("python%s%s.%s" % (python_majmin, lib_suffix, ext)) log("copying %s" % source)