Skip to content

Windows build favours NuGet over local install of branch version #108051

Closed
@directhex

Description

@directhex

Checklist

  • I am confident this is a bug in CPython, not a bug in a third-party project
  • I have searched the CPython issue tracker,
    and am confident this bug has not been reported before

CPython versions tested on:

3.11, 3.12, CPython main branch

Operating systems tested on:

Windows

Output from running 'python -VV' on the command line:

No response

A clear and concise description of the bug:

Windows builds of Python use a script called find_python.bat to locate a valid python.exe to use during the build.

It tries, in order:

  1. whatever's in VIRTUAL_ENV
  2. whatever's already in externals\pythonx86\tools\
  3. query py.exe from $PATH, but only a permitted version, as per this line https://github.com/python/cpython/blob/main/PCbuild/find_python.bat#L45
  4. downloading Python from the default configured NuGet repo (empty therefore nuget.exe defaults)

The problem is with case 3.

The permitted $PATH versions of Python to build 3.10 are 3.9 or 3.8 - if 3.10 is installed, it is ignored and 3.12RC1 from NuGet is used instead

The permitted $PATH versions of Python to build 3.11 are 3.10 or 3.9 - if 3.11 is installed, it is ignored and 3.12RC1 from NuGet is used instead

The permitted $PATH versions of Python to build 3.12 are 3.11, 3.10 or 3.9 - if 3.12 is installed, it is ignored and 3.12RC1 from NuGet is used instead

The permitted $PATH versions of Python to build main are 3.11, 3.10 or 3.9 - if main is installed, it is ignored and 3.12RC1 from NuGet is used instead

This behaviour is clearly wrong (especially since the version downloaded in the fallback case 4 is not version locked, so right now it's 3.12RC1 and doesn't account for compatibility breakages). Version X should always be in the permitted list to build version X.

3.9 did allow builds from a system install of 3.9, but this seems like an accident rather than design.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsbuildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions