GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-148047: Check early whether tail-calling is possible for MSVC builds on Windows by chris-eibl · Pull Request #148036 · python/cpython

Conversation

@chris-eibl

@chris-eibl chris-eibl commented Apr 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

lets fail early with an explicit error message for configurations that are not supported by MSVC.

This is a follow-up on #140513 / #140548.

  • Issue: Check early whether tail-calling is possible for MSVC builds on Windows #148047

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

stonebig reacted with heart emoji
All reactions
  • ❤️ 1 reaction
chris-eibl added 2 commits March 27, 2026 08:31
@chris-eibl
check tail-calling support in pythoncore.vcxproj
15b0bf1
@chris-eibl
Merge branch 'main' into CheckTailCalling
92a236d
@chris-eibl
chris-eibl requested a review from a team as a code owner April 3, 2026 13:54
@bedevere-app bedevere-app Bot added the awaiting review label Apr 3, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Apr 3, 2026
Tail calling interpreter for MSVC #139922
Closed
@chris-eibl
chris-eibl requested review from Fidget-Spinner and itamaro April 3, 2026 13:56
@chris-eibl chris-eibl added the skip news label Apr 3, 2026
@chris-eibl chris-eibl mentioned this pull request Apr 3, 2026
GH-139922: add interpreter types to InternalDocs/interpreter.md #148035
Merged
@chris-eibl

chris-eibl commented Apr 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

TSan https://github.com/python/cpython/actions/runs/23948631142/job/69850491565?pr=148036 failure for sure unreleated: this is a pure Windows change and would result in a build error on onsupported (Windows) hosts when using --tail-call-interp. Note that there are no such hosts in CI nor in buildbots, and if there were, they would have already failed (but with tons of Unable to perform required tail call messages).

I've checked manually that I get all the expected errors for unsupported configurations.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner

Fidget-Spinner commented Apr 3, 2026

Copy link
Copy Markdown
Member

Please open a separate issue for this, rather than reusing the same closed issue. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl chris-eibl changed the title GH-139922: Check early whether tail calling is possible GH-148047: Check early whether tail calling is possible Apr 3, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Apr 3, 2026
Check early whether tail-calling is possible for MSVC builds on Windows #148047
Closed
@chris-eibl chris-eibl added OS-windows build The build process and cross-build and removed skip news labels Apr 3, 2026
chris-eibl added 2 commits April 3, 2026 20:08
@chris-eibl
Merge remote-tracking branch 'upstream/main' into CheckTailCalling
3a28aeb
@chris-eibl
blurb it
8768351
@chris-eibl chris-eibl changed the title GH-148047: Check early whether tail calling is possible GH-148047: Check early whether tail-calling is possible for MSVC builds on Windows Apr 3, 2026
itamaro
itamaro requested changes Apr 4, 2026
View reviewed changes

@itamaro itamaro left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, thank you for this!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread PCbuild/pythoncore.vcxproj Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread PCbuild/pythoncore.vcxproj Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Build/2026-04-03-20-09-46.gh-issue-148047.HE6iGK.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting changes and removed awaiting review labels Apr 4, 2026
@bedevere-app

bedevere-app Bot commented Apr 4, 2026

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl
update news entry
8e9a47e
itamaro
itamaro approved these changes Apr 5, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting changes labels Apr 5, 2026
@itamaro
itamaro merged commit cbd81d5 into python:main Apr 12, 2026
54 of 55 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 12, 2026
@bedevere-bot

bedevere-bot commented Apr 12, 2026

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86 Debian Installed with X 3.x (no tier) has failed when building commit cbd81d5.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1244/builds/7983) and take a look at the build logs.
  4. Check if the failure is related to this commit (cbd81d5) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1244/builds/7983

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/contextlib.py"�[0m, line �[35m85�[0m, in �[35minner�[0m
    return func(*args, **kwds)
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/test/_test_multiprocessing.py"�[0m, line �[35m649�[0m, in �[35mtest_interrupt�[0m
    exitcode = self._kill_process(multiprocessing.Process.interrupt)
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/contextlib.py"�[0m, line �[35m85�[0m, in �[35minner�[0m
    return func(*args, **kwds)
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/test/_test_multiprocessing.py"�[0m, line �[35m630�[0m, in �[35m_kill_process�[0m
    self.assertEqual(�[31mjoin�[0m�[1;31m()�[0m, None)
                     �[31m~~~~�[0m�[1;31m^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/test/_test_multiprocessing.py"�[0m, line �[35m303�[0m, in �[35m__call__�[0m
    return �[31mself.func�[0m�[1;31m(*args, **kwds)�[0m
           �[31m~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/multiprocessing/process.py"�[0m, line �[35m156�[0m, in �[35mjoin�[0m
    res = self._popen.wait(timeout)
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/multiprocessing/popen_fork.py"�[0m, line �[35m44�[0m, in �[35mwait�[0m
    return �[31mself.poll�[0m�[1;31m(os.WNOHANG if timeout == 0.0 else 0)�[0m
           �[31m~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/multiprocessing/popen_fork.py"�[0m, line �[35m28�[0m, in �[35mpoll�[0m
    pid, sts = �[31mos.waitpid�[0m�[1;31m(self.pid, flag)�[0m
               �[31m~~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/test/_test_multiprocessing.py"�[0m, line �[35m626�[0m, in �[35mhandler�[0m
    raise RuntimeError('join took too long: %s' % p)
�[1;35mRuntimeError�[0m: �[35mjoin took too long: <Process name='Process-158' pid=28453 parent=26696 started daemon>�[0m


Traceback (most recent call last):
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/contextlib.py"�[0m, line �[35m85�[0m, in �[35minner�[0m
    return func(*args, **kwds)
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/test/_test_multiprocessing.py"�[0m, line �[35m649�[0m, in �[35mtest_interrupt�[0m
    exitcode = self._kill_process(multiprocessing.Process.interrupt)
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/contextlib.py"�[0m, line �[35m85�[0m, in �[35minner�[0m
    return func(*args, **kwds)
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/test/_test_multiprocessing.py"�[0m, line �[35m630�[0m, in �[35m_kill_process�[0m
    self.assertEqual(�[31mjoin�[0m�[1;31m()�[0m, None)
                     �[31m~~~~�[0m�[1;31m^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/test/_test_multiprocessing.py"�[0m, line �[35m303�[0m, in �[35m__call__�[0m
    return �[31mself.func�[0m�[1;31m(*args, **kwds)�[0m
           �[31m~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/multiprocessing/process.py"�[0m, line �[35m156�[0m, in �[35mjoin�[0m
    res = self._popen.wait(timeout)
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/multiprocessing/popen_fork.py"�[0m, line �[35m44�[0m, in �[35mwait�[0m
    return �[31mself.poll�[0m�[1;31m(os.WNOHANG if timeout == 0.0 else 0)�[0m
           �[31m~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/multiprocessing/popen_fork.py"�[0m, line �[35m28�[0m, in �[35mpoll�[0m
    pid, sts = �[31mos.waitpid�[0m�[1;31m(self.pid, flag)�[0m
               �[31m~~~~~~~~~~�[0m�[1;31m^^^^^^^^^^^^^^^^�[0m
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.15/test/_test_multiprocessing.py"�[0m, line �[35m626�[0m, in �[35mhandler�[0m
    raise RuntimeError('join took too long: %s' % p)
�[1;35mRuntimeError�[0m: �[35mjoin took too long: <Process name='Process-1' pid=2089 parent=2087 started daemon>�[0m
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl
chris-eibl deleted the CheckTailCalling branch April 12, 2026 05:58
zooba
zooba reviewed Apr 14, 2026
View reviewed changes
Comment thread PCbuild/pythoncore.vcxproj
<Error Text="MSVC supports tail-calling only for x64."
Condition="$(Platform) != 'x64'" />
<Error Text="Platform toolset >= v145 is required for tail-calling."
Condition="$(PlatformToolset.Replace('v', '0')) &lt; '145'" />

@zooba zooba Apr 14, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Fidget-Spinner and chris-eibl reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
zooba
zooba reviewed Apr 14, 2026
View reviewed changes
Comment thread PCbuild/pythoncore.vcxproj
<Error Text="Platform toolset >= v145 is required for tail-calling."
Condition="$(PlatformToolset.Replace('v', '0')) &lt; '145'" />
<Error Text="MSVC requires optimization to be enabled for tail-calling."
Condition="$(Configuration) == 'Debug'" />

@zooba zooba Apr 14, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
zooba
zooba reviewed Apr 14, 2026
View reviewed changes
Comment thread PCbuild/pythoncore.vcxproj

<Target Name="_CheckTailCalling" BeforeTargets="PrepareForBuild" Condition="'$(UseTailCallInterp)' == 'true' and $(PlatformToolset) != 'ClangCL'">
<Error Text="MSVC supports tail-calling only for x64."
Condition="$(Platform) != 'x64'" />

@zooba zooba Apr 14, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Fidget-Spinner and chris-eibl reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@Fidget-Spinner

Fidget-Spinner commented Apr 14, 2026

Copy link
Copy Markdown
Member

Really sorry @chris-eibl, but I'm going to revert this change. I think users can just let the compiler fail to build if it's not available.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Fidget-Spinner added a commit to Fidget-Spinner/cpython that referenced this pull request Apr 14, 2026
@Fidget-Spinner
Revert "pythonGH-148047: Check early whether tail-calling is possible…
0550f09
… for MSVC builds on Windows (python#148036)"

This reverts commit cbd81d5.
@Fidget-Spinner

Fidget-Spinner commented Apr 14, 2026

Copy link
Copy Markdown
Member

Revert up at #148558

chris-eibl reacted with thumbs up emoji chris-eibl reacted with heart emoji
All reactions
  • 👍 1 reaction
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl

chris-eibl commented Apr 14, 2026

Copy link
Copy Markdown
Member Author

Really sorry @chris-eibl, but I'm going to revert this change. I think users can just let the compiler fail to build if it's not available.

No worries, totally fine with me. That's why we have discussions and reviews.

Sorry for the churn.

Fidget-Spinner and zooba reacted with heart emoji
All reactions
  • ❤️ 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner

Fidget-Spinner commented Apr 14, 2026

Copy link
Copy Markdown
Member

No problem, nothing to apologise for!

chris-eibl reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Fidget-Spinner added a commit that referenced this pull request Apr 14, 2026
@Fidget-Spinner
gh-148047: Revert "GH-148047: Check early whether tail-calling is pos…
11da7d4
…sible for MSVC builds on Windows (#148036)" (#148558)

This reverts commit cbd81d5.
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@chris-eibl @ljfp
pythonGH-148047: Check early whether tail-calling is possible for MSV…
ad923b5
…C builds on Windows (python#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 python#140513 / python#140548
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@Fidget-Spinner @ljfp
pythongh-148047: Revert "pythonGH-148047: Check early whether tail-ca…
a236471
…lling is possible for MSVC builds on Windows (python#148036)" (python#148558)

This reverts commit cbd81d5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@zooba zooba zooba left review comments
@itamaro itamaro itamaro approved these changes
@Fidget-Spinner Fidget-Spinner Awaiting requested review from Fidget-Spinner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

build The build process and cross-build OS-windows

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@chris-eibl @Fidget-Spinner @bedevere-bot @itamaro @zooba
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.