-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
GH-148047: Check early whether tail-calling is possible for MSVC builds on Windows #148036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
15b0bf1
92a236d
3a28aeb
8768351
8e9a47e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -749,4 +749,13 @@ | |
| <Target Name="_DeletePyBuildDirTxt" BeforeTargets="PrepareForBuild"> | ||
| <Delete Files="$(OutDir)pybuilddir.txt" /> | ||
| </Target> | ||
|
|
||
| <Target Name="_CheckTailCalling" BeforeTargets="PrepareForBuild" Condition="'$(UseTailCallInterp)' == 'true' and $(PlatformToolset) != 'ClangCL'"> | ||
| <Error Text="MSVC supports tail-calling only for x64." | ||
| Condition="$(Platform) != 'x64'" /> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not convinced this needs to be an error - if/when MSVC gets support, they may want to test it on CPython themselves before shipping, and we're just going to block them. As with Debug, make it a warning if you really want, but ultimately it's up to the user to decide whether they're enabling a feature or not. We shouldn't prevent users from doing what they want to do. |
||
| <Error Text="Platform toolset >= v145 is required for tail-calling." | ||
| Condition="$(PlatformToolset.Replace('v', '0')) < '145'" /> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't do this check - PlatformToolset is an arbitrary string, you can't assume that it's comparable to a number in any meaningful way. |
||
| <Error Text="MSVC requires optimization to be enabled for tail-calling." | ||
| Condition="$(Configuration) == 'Debug'" /> | ||
|
itamaro marked this conversation as resolved.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would we do this? It makes it annoyingly hard to set tail calling enabled in my environment and then choose between debug/release builds. A warning is fine, if you really want, but a debug build is inherently without optimisations, so there's no reason to remind users that that's what they're getting. |
||
| </Target> | ||
| </Project> | ||
Uh oh!
There was an error while loading. Please reload this page.