This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Build hangs under Visual Studio in deepfreeze stage
Type: compile error Stage: resolved
Components: Build, Windows Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords: patch

Created on 2021-12-15 19:07 by gvanrossum, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30127 closed gvanrossum, 2021-12-15 22:06
PR 30143 merged steve.dower, 2021-12-16 14:18
Messages (6)
msg408635 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2021-12-15 19:07
I am trying to build under Visual Studio (the 2019 release) and I'm encountering the following weird issue. In the project file PCbuild\_freeze_module.vcxproj there's a command that runs the Tools\scripts\deepfreeze.py script to generate some code.

The invocation is as follows:

    <Exec Command='$(PythonForBuild) "$(PySourcePath)Tools\scripts\deepfreeze.py" "%(None.OutFile)" "-m" "%(None.ModName)" -o "%(None.IntFile)"' />

Apparently the PythonForBuild variable is unset, because this steps is trying to *open* the deepfreeze.py script using the default app for opening .py files, which in my case is VS Code.

It seems that when using PCbuild\build.bat, PythonForBuild is set (on line 121) to %PYTHON%, which presumably points to some Python interpreter. But apparently when the build is driven by VS, this is not executed and now we're stuck.

Is there someone with enough MSBUILD skills to help me fix this?
msg408703 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-12-16 14:22
I posted a PR that shells out to the find_python script and captures its output to use during VS builds.

Theoretically, this could save us from running it in build.bat, but I like having the detection and messages up front rather than buried deep in the build logs.
msg408706 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-12-16 14:32
VS builds could use the bootstrap interpreter again. This will remove the need to have a Python interpreter installed to build Python on Windows.
msg408709 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-12-16 14:51
On Windows we automatically download a runtime if you don't have one, so this isn't such a big deal. You *do* need an internet connection to do this, of course, but that's the case for most of our external dependencies already.

Plus I don't think we're even building the bootstrap interpreter on Windows yet?
msg408735 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2021-12-16 20:05
I don't see a reason to go through the bootstrap python on Windows. It would increase the build time, which is already pretty slow.
msg408845 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-12-18 13:05
New changeset 6fc91daf730c60b08b4b32cdce28ff26505a0622 by Steve Dower in branch 'main':
bpo-46088: Automatically detect or install bootstrap Python runtime when building from Visual Studio (GH-30143)
https://github.com/python/cpython/commit/6fc91daf730c60b08b4b32cdce28ff26505a0622
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90246
2021-12-18 13:09:12steve.dowersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-12-18 13:05:49steve.dowersetmessages: + msg408845
2021-12-16 20:05:11gvanrossumsetmessages: + msg408735
2021-12-16 14:51:59steve.dowersetmessages: + msg408709
2021-12-16 14:32:52christian.heimessetnosy: + christian.heimes
messages: + msg408706
2021-12-16 14:22:16steve.dowersetmessages: + msg408703
2021-12-16 14:18:52steve.dowersetpull_requests: + pull_request28361
2021-12-15 22:06:14gvanrossumsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request28346
2021-12-15 19:07:01gvanrossumcreate