-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
PEP 617: new PEG-based parser #84514
Comments
Note: PEP-617 is currently under review by the Steering Council, but if they approve we'd like to get it into alpha 6, and reviews are welcome (even though we're still finagling some corner cases of the implementation). |
Once PR 19503 will be merged, I would be interested to see if setjmp()/longjmp() can be avoided. I'm scared by these functions: they require that all functions in between setjmp() and longjmp() call stack have no state and don't need any cleanup at exit. |
VIctor, you were very right about longjmp. See we-like-parsers#119 |
Pablo told me in private that he plans to add a buildbot worker to test the old parser. So this change is fine. |
Looks like the build changes do not work with a build directory outside of the source directory: mkdir build && cd build && ../configure && make gcc -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../Include/internal -IObjects -IInclude -IPython -I. -I../Include -DPy_BUILD_CORE -o Parser/pegen/pegen.o ../Parser/pegen/pegen.c Lots of build processes depend on this, like for putting out a release. |
Opened #19667. Ned, could you review? |
This change removes sys.flags.use_peg which was only used in tests. If someone sees a good reason, we may add it back. In the meanwhile, test.support.use_old_parser() can be used. I didn't like the idea of having a new sys.flags.use_peg flag appears in 3.9 but disappears in 3.10. FYI sys.flags still supports the tuple API! Example: >>> sys.flags[9]
0 I have no idea what is this 10th member of sys.flags :-) |
test_peg_generator emits compiler warnings: https://buildbot.python.org/all/#/builders/612/builds/283 0:08:01 load avg: 1.40 [423/423/1] test_peg_generator passed (7 min 4 sec) |
These are expected. Is this a problem? |
People and bots running tests normally expect to not see any output from each test in the default case unless there are errors. If these are supposed to be emitted, we should find a way to hide them (and check the results, if necessary) unless a verbose option is selected. Personally, I wouldn't consider that a showstopper for a6 but as something to be fixed by b1. |
This is fixed by #19672 |
Those warnings are legitimate: we cannot cast function pointers that have different return types from one to the other. This only happens in the test, but could happen in the grammar if we use lookahead with NAME (&NAME). |
bpo-40370 documents test_peg_generator breakage on an AIX buildbot. |
GCC warning on aarch64 Fedora Rawhide LTO + PGO 3.x buildbot: In function ‘assemble_lnotab’, |
Is this related to this issue? We didn't change that line |
I can provide you access to the buildbot if you'd like to debug the issue. |
I don't know. It's just that I spotted this compiler warnining while reviewing recent buildbot failures. |
Given that is a compiler warning and we didn't change those lines, I would say is not related to this PR :) |
FWIW I propose that we add another Misc/NEWS for the same issue summarizing what happened between alpha6 and beta1. (A lot!) |
There is some discrepancy with the codeop module when running with the new parser: ./python -c "import codeop; codeop.CommandCompiler()('raise = 2\n\n', symbol='exec')" (No error) ./python -Xoldparser -c "import codeop; codeop.CommandCompiler()('raise = 2\n\n', symbol='exec')" |
Thanks Pablo for replying to my tweet, a couple of other non-failing case in (also using this occasion to thanks all of you for your work on the new parser) |
Seem to not be in the new parser but simply in codeop in particular The logic seem weird (but weird logic usually have a reason), it try to compile thrice by appending many
SyntaxError('invalid syntax', ('<input>', 1, 6, 'def a-b'))
vs
SyntaxError('invalid syntax', ('<input>', 1, 6, 'def a-b\n')) This logic seem to go back to the 2000s. |
It definitely has its reasons -- there are pernicious edge cases. Probably revealed by the tests. |
One minor nit: We're getting a nuisance compiler warning: test_peg_generator passed (2 min 40 sec) |
I'm not getting any compiler warnings on macOS (clang) and on Ubuntu (gcc) and I can't find any related warnings on the Windows Github Actions logs either. Could you maybe post a verbose log of test_peg_generator, Raymond? |
All parts of the implementation are now in. New issues should be opened for any potential bugs. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: