From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
Date: Sun, 12 Apr 2026 05:49:18 +0000 (+0200)
Subject: GH-148047: Check early whether tail-calling is possible for MSVC builds on Windows...
X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cbd81d59cfea4f7b881642e804646da3a328a712;p=thirdparty%2FPython%2Fcpython.git
GH-148047: Check early whether tail-calling is possible for MSVC builds on Windows (#148036)
Rather than failing late when compiling e.g. a debug configuration
```
build.bat -c debug --tail-call-interp
```
with hundreds of
```
error C4737: Unable to perform required tail call. Performance may be degraded.
```
-- fail early with an explicit error message for configurations that are not supported by MSVC.
This is a follow-up on https://github.com/python/cpython/issues/140513 / https://github.com/python/cpython/pull/140548
---
diff --git a/Misc/NEWS.d/next/Build/2026-04-03-20-09-46.gh-issue-148047.HE6iGK.rst b/Misc/NEWS.d/next/Build/2026-04-03-20-09-46.gh-issue-148047.HE6iGK.rst
new file mode 100644
index 000000000000..e43a2695a131
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2026-04-03-20-09-46.gh-issue-148047.HE6iGK.rst
@@ -0,0 +1,2 @@
+Fail fast with an explicit and clear error message if tail-calling is not
+possible for MSVC builds on Windows. Patch by Chris Eibl.
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 61bee29c0af3..9356a66dfb46 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -749,4 +749,13 @@
+
+
+
+
+
+