Skip to content

Build tail-calling Python 3.15 on Windows#970

Merged
jjhelmus merged 13 commits intoastral-sh:mainfrom
jjhelmus:wip-vs2026
Feb 6, 2026
Merged

Build tail-calling Python 3.15 on Windows#970
jjhelmus merged 13 commits intoastral-sh:mainfrom
jjhelmus:wip-vs2026

Conversation

@jjhelmus
Copy link
Contributor

@jjhelmus jjhelmus commented Feb 4, 2026

Build Python 3.15 with tail-calling enabled on Windows.
Use Visual Studio 2026 and v145 platform toolset for this build.

closes #933

@jjhelmus
Copy link
Contributor Author

jjhelmus commented Feb 4, 2026

The depot-windows-2025 nor the depot-windows-2022 runner have Visual Studio 2026 installed. Recorded finding for future work in #971

@jjhelmus jjhelmus closed this Feb 4, 2026
@jjhelmus jjhelmus reopened this Feb 6, 2026
@jjhelmus
Copy link
Contributor Author

jjhelmus commented Feb 6, 2026

VS 2026 is now available in beta in the windows-2025-vs202 runner, testing.

@Fidget-Spinner
Copy link

Fidget-Spinner commented Feb 6, 2026

Hmm it seems the TC interpreter doesn't support FT Python at the moment. That's probably a bug in CPython. Could you please open an issue and we'll look into it?

@Fidget-Spinner
Copy link

Tracked upstream here python/cpython#144549

@Fidget-Spinner
Copy link

Alright, the bug has been fixed upstream, and should be released for Python 3.15a6 which is in 4 days time on 10 Feb.

@jjhelmus
Copy link
Contributor Author

jjhelmus commented Feb 6, 2026

Alright, the bug has been fixed upstream, and should be released for Python 3.15a6 which is in 4 days time on 10 Feb.

Awesome! I was about to file an issue but had to step out to walk my dog. Nice to see the issue reported in fixed before I got back 😄

@jjhelmus jjhelmus changed the title Testing VS 2026 build Build tail-call Python 3.15 Feb 6, 2026
@jjhelmus jjhelmus changed the title Build tail-call Python 3.15 Build tail-calling Python 3.15 on Windows Feb 6, 2026
@jjhelmus jjhelmus closed this Feb 6, 2026
@jjhelmus jjhelmus reopened this Feb 6, 2026
@jjhelmus jjhelmus marked this pull request as ready for review February 6, 2026 21:17
Copy link

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

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

I don't know this repo that well, but LGTM from the CPython side of things.

@Fidget-Spinner
Copy link

It seems it's using VS2022 to build the 3.15 interpreter instead of VS2026.

Comment on lines +159 to +163
IF "%MATRIX_VS_VERSION%"=="2026" (
call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\%MATRIX_VCVARS%"
) ELSE (
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\%MATRIX_VCVARS%"
)
Copy link
Member

Choose a reason for hiding this comment

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

Can we just template the year via an environment variable too? lol

Copy link
Contributor Author

@jjhelmus jjhelmus Feb 6, 2026

Choose a reason for hiding this comment

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

VS 2026 uses 18 for the directory, vs 2022 for VS 2022. We could template the Visual Studio directory as another variable but the version is sufficient it just needs some lookup logic.

@Fidget-Spinner
Copy link

Oh dear, CI seems to get stuck building openssl with crypto libraries with platformtoolset v145. https://github.com/astral-sh/python-build-standalone/actions/runs/21767390686/job/62806779374?pr=970

@jjhelmus
Copy link
Contributor Author

jjhelmus commented Feb 6, 2026

Oh dear, CI seems to get stuck building openssl with crypto libraries with platformtoolset v145. https://github.com/astral-sh/python-build-standalone/actions/runs/21767390686/job/62806779374?pr=970

But OpenSSL built fine on the GIL version and back in https://github.com/astral-sh/python-build-standalone/actions/runs/21735578158/job/62699943965 with the v145 toolset. Maybe this is just flaky?

@jjhelmus
Copy link
Contributor Author

jjhelmus commented Feb 6, 2026

Ah proceeding again. I've noticed the logs sometimes get out of sync.

@jjhelmus jjhelmus merged commit ece6423 into astral-sh:main Feb 6, 2026
14 checks passed
# Build tail-calling Python for 3.15+
# TODO(jjh) Remove 'not freethreaded' when 3.15.0a6 released
if python_version.startswith("3.15") and platform == "x64" and not freethreaded:
args.append("/property:PlatformToolset=v145")

Choose a reason for hiding this comment

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

Just a heads up: since python/cpython#144679, the PlatformToolset doesn't have to be specified any longer if VS2026 is used to build.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build Python 3.15 with tail-calling on Windows

4 participants