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: make regen-all doesn't work in subfolder: No module named Parser.pgen
Type: Stage: resolved
Components: Build Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: hroncok, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2019-04-26 10:17 by hroncok, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 12969 merged vstinner, 2019-04-26 10:27
Messages (5)
msg340902 - (view) Author: Miro Hrončok (hroncok) * Date: 2019-04-26 10:17
When I attempt to build CPython from a subfolder (as we do in Fedora) make regen-all dies with:

  python3.8 -m Parser.pgen ../../Grammar/Grammar \
  	../../Grammar/Tokens \
  	../../Include/graminit.h.new \
  	../../Python/graminit.c.new
  /usr/bin/python3.8: No module named Parser.pgen

To reproduce, run:

  $ rm -rf build && mkdir -p build/mybuild && (cd build/mybuild && ../../configure && make regen-all)

This is probably a regression, as it works in the 3.7 branch.

Setting PYTHON_FOR_REGEN="python3" (python3.7 on my system) doesn't make a difference:

  python3 -m Parser.pgen ../../Grammar/Grammar \
  	../../Grammar/Tokens \
  	../../Include/graminit.h.new \
  	../../Python/graminit.c.new
  /usr/bin/python3: No module named Parser.pgen


build/mybuild/Parser exists but it is empty directory.

Setting PYTHON_FOR_REGEN="PYTHOINPATH=<path_to_sources> python3" workarounds the issue.

On branch 3.7 (3076a3e0d1), build/mybuild/Parser is also empty, but the make-regen populates it.

I'll bisect.
msg340903 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-26 10:28
regen-keyword is recent: bpo-36143.

regen-grammar has been modified to use Parser.pgen in bpo-35808.
msg340904 - (view) Author: Miro Hrončok (hroncok) * Date: 2019-04-26 10:31
1f24a719e7be5e49b876a5dc7daf21d01ee69faa
msg340909 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-26 11:09
New changeset 06d04e77ca36133e82bf6c363c09ba82e07a9c75 by Victor Stinner in branch 'master':
bpo-36733: Fix PYTHONPATH for make regen-add (GH-12969)
https://github.com/python/cpython/commit/06d04e77ca36133e82bf6c363c09ba82e07a9c75
msg340910 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-04-26 11:10
Thanks for your bug report Miro Hrončok. The fix will be part of the next Python 3.8 alpha release:

"3.8.0 alpha 4: Monday, 2019-04-29"
https://www.python.org/dev/peps/pep-0569/
History
Date User Action Args
2022-04-11 14:59:14adminsetgithub: 80914
2019-04-26 11:10:58vstinnersetmessages: + msg340910
2019-04-26 11:10:06vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-04-26 11:09:49vstinnersetmessages: + msg340909
2019-04-26 10:31:01hroncoksetmessages: + msg340904
2019-04-26 10:28:45vstinnersetmessages: + msg340903
2019-04-26 10:27:26vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request12896
2019-04-26 10:21:13vstinnersetnosy: + pablogsal
2019-04-26 10:17:42hroncokcreate