Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deps/cpython.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ run_binary(
"libffi_win_dir",
"openssl-bin_win_dir",
"tcltk_win_dir",
"@python_3_12//:python3",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does that work while building python 3.13? I thought python required the local interpreter to match the version being built

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

guess who didn't read the PR description before reviewing the change...

Copy link
Copy Markdown
Contributor Author

@rdesgroppes rdesgroppes Mar 24, 2026

Choose a reason for hiding this comment

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

https://github.com/python/cpython/blob/3.13/PCbuild/readme.txt#L6-L8:

1a. Optionally install Python 3.6 or later.  If not installed,
    get_externals.bat (via build.bat) will download and use Python via
    NuGet.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suppose the requirement for matching version only applies to cross compilation then, my bad!

Copy link
Copy Markdown
Contributor

@alopezz alopezz Mar 24, 2026

Choose a reason for hiding this comment

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

According to the readme, as linked in the PR description, yes: https://github.com/python/cpython/blob/3.13/PCbuild/readme.txt#L6

As far as I remember this python is used to run specific scripts during the build and doesn't need to match the python being built. https://github.com/search?q=repo%3Apython%2Fcpython%20PythonForBuild&type=code

The only concern with this reference now is that iiuc it needs to stay in sync with

PYTHON_VERSION = "3.12"
. But we could address that later for sure.

EDIT: And of course my comment came in late :D

Copy link
Copy Markdown
Contributor Author

@rdesgroppes rdesgroppes Mar 24, 2026

Choose a reason for hiding this comment

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

That being said, Python 3.10+ will be required for Python 3.14, https://github.com/python/cpython/blob/3.14/PCbuild/readme.txt#L6-L8:

1a. Optionally install Python 3.10 or later.  If not installed,
    get_externals.bat (via build.bat) will download and use Python via
    NuGet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TBH, I didn't find a quick alias to the configured toolchain's Python interpreter. It's possible by mean of a repo rule... overkill, I guess.

"@visual_studio//:msbuild",
]
),
Expand All @@ -84,6 +85,7 @@ run_binary(
"TCLTK_DIR": r"$(location tcltk_win_dir)\amd64",
"TCL_VERSION": python_externals["tcltk"],
"MSBUILD": "$(location @visual_studio//:msbuild)",
"PYTHON_FOR_BUILD": "$(location @python_3_12//:python3)",
},
outs = [
"build/{}".format(file)
Expand Down
1 change: 1 addition & 0 deletions deps/cpython/build_python.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ for %%F in (%SRCFILE%) do set sourcedir=%%~dpF
:: Make sure input paths are proper Windows paths as needed
for %%F in (%OUTDIR%) do set destdir=%%~fF\\
for %%F in (%MSBUILD%) do set MSBUILD=%%~fF
for %%F in (%PYTHON_FOR_BUILD%) do set PYTHON_FOR_BUILD=%%~fF

set build_outdir=%sourcedir%\PCbuild\amd64

Expand Down
Loading