Skip to content

Incorrect minimum version of Python for Windows build bootstrapping #122573

Closed

Description

@msprotz

Bug report

Bug description:

Python now requires 3.10 to build itself, because match case statements have begun proliferating in the cpython repository. However, the Windows build still thinks 3.9 is enough, which results in a build error on a standard Visual Studio 2022 environment.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Aug 1, 2024
  2. Eclips4 commented on Aug 1, 2024

    @Eclips4
    Member

    Hello!
    I can build CPython on Windows using the 3.9 version. Can you please show the error?

  3. Eclips4 commented on Aug 1, 2024

    @Eclips4
    Member

    I can reproduce it by building CPython with the --experimental-jit option:

      Regenerate Global Objects
      # not changed: C:\Users\KIRILL-1\CLionProjects\cpython\Include\internal\pycore_global_strings.h
      # not changed: C:\Users\KIRILL-1\CLionProjects\cpython\Include\internal\pycore_runtime_init_generated.h
      # not changed: C:\Users\KIRILL-1\CLionProjects\cpython\Include\internal\pycore_unicodeobject_generated.h
      # not changed: C:\Users\KIRILL-1\CLionProjects\cpython\Include\internal\pycore_global_objects_fini_generated.h
      Traceback (most recent call last):
        File "C:\Users\KIRILL-1\CLionProjects\cpython\Tools\jit\build.py", line 8, in <module>
          import _targets
        File "C:\Users\KIRILL-1\CLionProjects\cpython\Tools\jit\_targets.py", line 275
          match relocation:
                ^
      SyntaxError: invalid syntax
    

    So it's actually related only to the jit build. The default build is not affected.

  4. msprotz commented on Aug 1, 2024

    @msprotz
    ContributorAuthor
    C:\Users\protz\Desktop\cpython\PCbuild>build
    Using py -3.9 (found 3.9 with py.exe)
    ...
      Regenerate keyword.py
      Regenerate Global Objects
      # not changed: C:\Users\protz\Desktop\cpython\Include\internal\pycore_global_strings.h
      # not changed: C:\Users\protz\Desktop\cpython\Include\internal\pycore_runtime_init_generated.h
      # not changed: C:\Users\protz\Desktop\cpython\Include\internal\pycore_unicodeobject_generated.h
      # not changed: C:\Users\protz\Desktop\cpython\Include\internal\pycore_global_objects_fini_generated.h
      Regenerate cases
      Traceback (most recent call last):
        File "C:\Users\protz\Desktop\cpython\Tools\cases_generator\opcode_id_generator.py", line 8, in <module>
          from analyzer import (
        File "C:\Users\protz\Desktop\cpython\Tools\cases_generator\analyzer.py", line 724
          match part:
                ^
      SyntaxError: invalid syntax
    C:\Users\protz\Desktop\cpython\PCbuild\regen.targets(93,5): error MSB3073: The command "py -3.9 Tools\cases_generator\o
    pcode_id_generator.py Python\bytecodes.c" exited with code 1. [C:\Users\protz\Desktop\cpython\PCbuild\pythoncore.vcxpro
    j]
    
    Build FAILED.
    
    C:\Users\protz\Desktop\cpython\PCbuild\regen.targets(93,5): error MSB3073: The command "py -3.9 Tools\cases_generator\o
    pcode_id_generator.py Python\bytecodes.c" exited with code 1. [C:\Users\protz\Desktop\cpython\PCbuild\pythoncore.vcxpro
    j]
        0 Warning(s)
        1 Error(s)
    
  5. msprotz commented on Aug 1, 2024

    @msprotz
    ContributorAuthor

    This is without the --jit option -- I believe my other PR touched something related to global objects, which in turn triggered the invocation of cases_generator/opcode_id_generator.py, which failed, on the default build.

  6. msprotz commented on Aug 1, 2024

    @msprotz
    ContributorAuthor

    This is the other PR: #119316

  7. Eclips4 commented on Aug 1, 2024

    @Eclips4
    Member

    This is without the --jit option -- I believe my other PR touched something related to global objects, which in turn triggered the invocation of cases_generator/opcode_id_generator.py, which failed, on the default build.

    You're right.

  8. added
    3.12only security fixes
    3.13only security fixes
    on Aug 4, 2024
  9. self-assigned this
    on Aug 4, 2024
  10. added a commit that references this issue on Aug 4, 2024
  11. added a commit that references this issue on Aug 4, 2024
  12. added a commit that references this issue on Aug 5, 2024
  13. gpshead commented on Aug 5, 2024

    @gpshead
    Member

    backports pending and assigned, closing. thanks!

  14. added 2 commits that reference this issue on Aug 6, 2024
  15. added a commit that references this issue on Aug 7, 2024
  16. added a commit that references this issue on Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.12only security fixes3.13only security fixesOS-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