Skip to content
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

Build hangs under Visual Studio in deepfreeze stage #90246

Closed
gvanrossum opened this issue Dec 15, 2021 · 6 comments
Closed

Build hangs under Visual Studio in deepfreeze stage #90246

gvanrossum opened this issue Dec 15, 2021 · 6 comments
Labels
3.11 only security fixes build The build process and cross-build OS-windows

Comments

@gvanrossum
Copy link
Member

BPO 46088
Nosy @gvanrossum, @pfmoore, @tiran, @tjguk, @zware, @zooba
PRs
  • bpo-46088: Provide a default value for PythonForBuild #30127
  • bpo-46088: Automatically detect or install bootstrap Python runtime when building from Visual Studio #30143
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-12-18.13:09:12.996>
    created_at = <Date 2021-12-15.19:07:01.444>
    labels = ['build', 'OS-windows', '3.11']
    title = 'Build hangs under Visual Studio in deepfreeze stage'
    updated_at = <Date 2021-12-18.13:09:12.996>
    user = 'https://github.com/gvanrossum'

    bugs.python.org fields:

    activity = <Date 2021-12-18.13:09:12.996>
    actor = 'steve.dower'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-12-18.13:09:12.996>
    closer = 'steve.dower'
    components = ['Build', 'Windows']
    creation = <Date 2021-12-15.19:07:01.444>
    creator = 'gvanrossum'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46088
    keywords = ['patch']
    message_count = 6.0
    messages = ['408635', '408703', '408706', '408709', '408735', '408845']
    nosy_count = 6.0
    nosy_names = ['gvanrossum', 'paul.moore', 'christian.heimes', 'tim.golden', 'zach.ware', 'steve.dower']
    pr_nums = ['30127', '30143']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue46088'
    versions = ['Python 3.11']

    @gvanrossum
    Copy link
    Member Author

    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?

    @gvanrossum gvanrossum added 3.11 only security fixes build The build process and cross-build OS-windows labels Dec 15, 2021
    @zooba
    Copy link
    Member

    zooba commented Dec 16, 2021

    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.

    @tiran
    Copy link
    Member

    tiran commented Dec 16, 2021

    VS builds could use the bootstrap interpreter again. This will remove the need to have a Python interpreter installed to build Python on Windows.

    @zooba
    Copy link
    Member

    zooba commented Dec 16, 2021

    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?

    @gvanrossum
    Copy link
    Member Author

    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.

    @zooba
    Copy link
    Member

    zooba commented Dec 18, 2021

    New changeset 6fc91da by Steve Dower in branch 'main':
    bpo-46088: Automatically detect or install bootstrap Python runtime when building from Visual Studio (GH-30143)
    6fc91da

    @zooba zooba closed this as completed Dec 18, 2021
    @zooba zooba closed this as completed Dec 18, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes build The build process and cross-build OS-windows
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants