Skip to content

Incorrect minimum version of Python for Windows build bootstrapping #122573

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

Closed
msprotz opened this issue Aug 1, 2024 · 7 comments
Closed

Incorrect minimum version of Python for Windows build bootstrapping #122573

msprotz opened this issue Aug 1, 2024 · 7 comments
Assignees
Labels
3.12 only security fixes 3.13 bugs and security fixes build The build process and cross-build OS-windows type-bug An unexpected behavior, bug, or error

Comments

@msprotz
Copy link
Contributor

msprotz commented Aug 1, 2024

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

@msprotz msprotz added the type-bug An unexpected behavior, bug, or error label Aug 1, 2024
@Eclips4 Eclips4 added OS-windows build The build process and cross-build labels Aug 1, 2024
@Eclips4
Copy link
Member

Eclips4 commented Aug 1, 2024

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

@Eclips4
Copy link
Member

Eclips4 commented Aug 1, 2024

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.

@msprotz
Copy link
Contributor Author

msprotz commented Aug 1, 2024

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)

@msprotz
Copy link
Contributor Author

msprotz commented Aug 1, 2024

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.

@msprotz
Copy link
Contributor Author

msprotz commented Aug 1, 2024

This is the other PR: #119316

@Eclips4
Copy link
Member

Eclips4 commented Aug 1, 2024

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.

@Eclips4 Eclips4 removed the topic-JIT label Aug 1, 2024
@gpshead gpshead added 3.12 only security fixes 3.13 bugs and security fixes labels Aug 4, 2024
@gpshead gpshead self-assigned this Aug 4, 2024
gpshead added a commit that referenced this issue Aug 4, 2024
Match statements in tooling require a more recent Python. Tools/cases_generator/*.py (and `Tools/jit/*.py` in 3.13+).

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 4, 2024
…honGH-122574)

Match statements in tooling require a more recent Python. Tools/cases_generator/*.py (and `Tools/jit/*.py` in 3.13+).

(cherry picked from commit d0b92dd)

Co-authored-by: Jonathan Protzenko <protz@microsoft.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gpshead added a commit to gpshead/cpython that referenced this issue Aug 5, 2024
…honGH-122574)

Match statements in tooling require a more recent Python. `Tools/cases_generator/*.py`

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
@gpshead
Copy link
Member

gpshead commented Aug 5, 2024

backports pending and assigned, closing. thanks!

@gpshead gpshead closed this as completed Aug 5, 2024
Yhg1s pushed a commit that referenced this issue Aug 6, 2024
…-122574) (#122674)

gh-122573: Require Python 3.10 or newer for Windows builds (GH-122574)

Match statements in tooling require a more recent Python. Tools/cases_generator/*.py (and `Tools/jit/*.py` in 3.13+).

(cherry picked from commit d0b92dd)

Co-authored-by: Jonathan Protzenko <protz@microsoft.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Yhg1s pushed a commit that referenced this issue Aug 6, 2024
…-122574) (#122677)

gh-122573: Require Python 3.10 or newer for Windows builds (GH-122574)

Match statements in tooling require a more recent Python. `Tools/cases_generator/*.py`

Co-authored-by: Jonathan Protzenko <protz@microsoft.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
brandtbucher pushed a commit to brandtbucher/cpython that referenced this issue Aug 7, 2024
…honGH-122574)

Match statements in tooling require a more recent Python. Tools/cases_generator/*.py (and `Tools/jit/*.py` in 3.13+).

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
blhsing pushed a commit to blhsing/cpython that referenced this issue Aug 22, 2024
…honGH-122574)

Match statements in tooling require a more recent Python. Tools/cases_generator/*.py (and `Tools/jit/*.py` in 3.13+).

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 only security fixes 3.13 bugs and security fixes build The build process and cross-build OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants