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

Problem with "make regen-pegen" #128303

Closed
0xWEBMILK opened this issue Dec 28, 2024 · 3 comments
Closed

Problem with "make regen-pegen" #128303

0xWEBMILK opened this issue Dec 28, 2024 · 3 comments
Labels
build The build process and cross-build invalid

Comments

@0xWEBMILK
Copy link

0xWEBMILK commented Dec 28, 2024

Bug report

Bug description:

Hey there! I have some problem with command make regen-pegen after editing Grammar > python.gram file.

CPython was correctly compiled and lauched.

If i type this after editing grammar file:
make regen-pegen

I got this:

PYTHONPATH=./Tools/peg_generator python3 -m pegen -q c \
        ./Grammar/python.gram \
        ./Grammar/Tokens \
        -o ./Parser/pegen/parse.new.c
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/webmilk/Desktop/cpython-3.9/Tools/peg_generator/pegen/__main__.py", line 16, in <module>
    from pegen.build import Grammar, Parser, Tokenizer, ParserGenerator
  File "/home/webmilk/Desktop/cpython-3.9/Tools/peg_generator/pegen/build.py", line 11, in <module>
    from pegen.c_generator import CParserGenerator
  File "/home/webmilk/Desktop/cpython-3.9/Tools/peg_generator/pegen/c_generator.py", line 2, in <module>
    from dataclasses import field, dataclass
ModuleNotFoundError: No module named 'dataclasses'
Makefile:871: recipe for target 'regen-pegen' failed
make: *** [regen-pegen] Error 1

Ubuntu: 18.04
CPython: 3.9

CPython versions tested on:

3.9

Operating systems tested on:

Linux

@0xWEBMILK 0xWEBMILK added the type-bug An unexpected behavior, bug, or error label Dec 28, 2024
@skirpichev
Copy link
Member

3.9 branch now only for security fixes. Can you reproduce that on 3.12+?

@skirpichev skirpichev added the pending The issue will be closed if no feedback is provided label Dec 28, 2024
@ronaldoussoren
Copy link
Contributor

For the issue at hand: @0xWEBMILK: Make sure that the python3 command on your shell's search path is recent enough. You are currently using Python 3.6 to run the parser generator and that won't work.

@picnixz picnixz added the build The build process and cross-build label Dec 28, 2024
@picnixz
Copy link
Contributor

picnixz commented Dec 28, 2024

The issue is:

File "/home/webmilk/Desktop/cpython-3.9/Tools/peg_generator/pegen/c_generator.py", line 2, in
from dataclasses import field, dataclass

Since dataclasses were introduced in 3.7, this is the reason why the build fails. I will close this one as not an issue (feel free to say otherwise if the issue persists even when upgrading to Python 3.10 (which I think is the minimal version for the parser))

@picnixz picnixz closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2024
@picnixz picnixz added invalid and removed pending The issue will be closed if no feedback is provided type-bug An unexpected behavior, bug, or error labels Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build invalid
Projects
None yet
Development

No branches or pull requests

4 participants