This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: undefined symbol: _PyParser_Grammar
Type: compile error Stage: resolved
Components: Build, Interpreter Core Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, arigo, doko, iritkatriel, martin.panter, ned.deily
Priority: normal Keywords:

Created on 2013-09-15 17:20 by arigo, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg197797 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2013-09-15 17:20
It is possible to get the working copy of Python 2.7 in a state such that any attempt to do "make" ends with the error shown in the title.  The working copy is perfectly valid; it is a matter of getting the wrong timestamps on the files.

(Despite the error message, this is not directly related to issue10013 or "make -j".)

I didn't try Python 3.x, but the same issue might apply.

How to reproduce:

- get your checkout, let's say in python/src/

- go to your build directory, say python/build/, and run "../src/configure; make".

- then, in the src dir, give Include/graminit.h a more recent timestamp than Python/graminit.c, for example by saying "touch Include/graminit.h" (this is the crux: a common mercurial checkout will order them the other way, just because of alphabetical ordering).

- remove your python/build/ directory completely, create it anew, and run again "../src/configure; make".

The cause of the message is that the Makefile rule for $(GRAMMAR_C) runs, because the GRAMMAR_H file is more recent; but the GRAMMAR_H rule does nothing, because the latter is already up-to-date.  So the only thing that runs is "touch $(GRAMMAR_C)".  But this creates an empty file build/Python/graminit.c!
msg199803 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-10-13 21:07
It looks like this was caused by the changes for Issue14321 to not run pgen for cross builds.
msg199824 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-10-13 23:40
BTW, this can be worked around (for non cross-builds at least) by running "make touch" on the source directory, e.g.:

    make -C python/src -f python/build/Makefile touch

But it should be fixed.  Doko?
msg270291 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-07-13 02:55
The same $(GRAMMAR_H) dependency and touch command still exists today, so I suspect this is still valid (though I didn’t try to reproduce it). I think we need to figure out if you can write a proper makefile rule that handles a single command that updates two targets at once.

FWIW I don’t think “make touch” will currently help on Python 2, because it only affects two files that are generated by pgen (see also my comment in Issue 19142).
msg400468 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-08-28 10:58
We no longer have GRAMMAR_H or _PyParser_Grammar in the code.
History
Date User Action Args
2022-04-11 14:57:51adminsetgithub: 63227
2021-08-28 10:58:53iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg400468

resolution: out of date
stage: needs patch -> resolved
2016-07-13 02:55:17martin.pantersetnosy: + martin.panter

messages: + msg270291
stage: needs patch
2013-10-13 23:40:50ned.deilysetmessages: + msg199824
2013-10-13 21:07:10ned.deilysetnosy: + doko
messages: + msg199803
2013-10-13 20:50:54ned.deilysetnosy: + ned.deily

components: + Build
versions: + Python 3.3, Python 3.4
2013-09-15 19:38:11Arfreversetnosy: + Arfrever
2013-09-15 17:20:48arigocreate