-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
'make touch' does not work with git clones of the source repository #67593
Comments
Is there a minimum Python requirement to build Python? Python 3.5 does not build with Python 2.6. Python 3.4, Python 3.3, and Python 2.7 build with Python 2.6 so this is recent change in build requirements. For example, this build failure occurs on CentOS 6. python ./Parser/asdl_c.py -h Include ./Parser/Python.asdl
Traceback (most recent call last):
File "./Parser/asdl_c.py", line 6, in <module>
import asdl
File "Parser/asdl.py", line 36
builtin_types = {'identifier', 'string', 'bytes', 'int', 'object', 'singleton'}
^
SyntaxError: invalid syntax |
Looks like this revision, part of bpo-22823, changed it: https://hg.python.org/cpython/rev/4480506137ed |
To answer your question: Since asdl uses set literals (introduced in 2.7 and 3.0), that appears to put an effective minimum version requirement of 2.7 to build 3.5. Whether that was the intent is unclear (they were changing a lot of places from set([a, b, c]) to {a, b, c}; causing problems building Python was probably not the intent, but 2.6 is well out of support at this point). |
Try using "make touch" before "make". Because hg does not preserve precise time stamps when creating working directories, some build steps are run unnecessarily after an initial checkout. 'make touch' updates the file time stamps so that these steps are skipped and a "bootstrap" Python is not needed. |
I am building from a git copy of the source repository. "make touch" before "make" does not work for me. $ make touch
cd .; \
hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
abort: There is no Mercurial repository here (.hg not found)! I've attached a patch that addresses the Python 3.5 build issue for me. The patch contains two syntax construct changes to Parser/asdl.py. Please consider applying this patch upstream. |
Unfortunately, those syntax differences aren't the only problems you could run into so making these syntax changes isn't really a general solution, IMO. 'make touch' is the documented and supported way to ensure that the unnecessary build steps are not run. But, as you discovered, 'make touch' only works with an hg copy of the repo; it was not designed for git clones. To fully support git clones, there would need to be a git equivalent of the hg scripts called by 'make touch'. This would be a worthwhile project for someone interested in git support to work on and would be considered for inclusion in the repo. |
With the supplied patch on CentOS 6 , "make" passes and "make test" passes with the exception of test_readline that is bpo-19884. 372 tests OK. |
I tried a hg copy of the repository. "make touch" worked for me. ./configure |
New changeset ffbb19026599 by Berker Peksag in branch 'default': |
Patch LGTM. Thanks Carol. I will left this issue open in case someone wants to work on a git equivalent of "make touch" as described by Ned in msg235514. |
Perhaps you can use “make -t <file>” instead of “make touch”. If you know the filename you want to avoid regenerating, that would not need any extra tools, no Mercurial or Git or any other version control. E.g.: make -t Include/Python-ast.h |
Okay so my “make -t” trick has various flaws. You still have to know the filenames to specify, it requires Makefile to be generated by configure in the source tree, and it creates empty files if you use it in a separate build directory. Another idea: instead of the “make touch” recipe, we add a simple shell script. Call it say “touch-bootstrap.sh”. Like what “make touch” already does in Python 2, but without embedding it as a makefile rule. Or add a flag variable so you can do a build without running any of the regeneration rules or worrying about timestamps: make BOOT="#". |
Just tried boot-flag.patch with 16e0788. Doesn't work out-of-box: #./Programs/_freeze_importlib \ My fix is: merge the two lines into a single one. See my attached patch. By the way, the BOOT hack is quite similar to GENERATED_COMMENT in introduced in bpo-27641. Maybe they can merge? My environment:
|
I've disabled the Touch step on the buildbots until this is fixed. |
I had mainly been using my boot-flag.patch with BSD Make (bmake) rather than Gnu Make. It seems I was relying on a bug in BSD Make that merges escaped newlines in command lines, despite Posix and Gnu Make. Anyway, Chi’s fix seems appropriate. I am posting the patches I used for 3.5 and 2.7, in case others are interested. The 3.5 one would also need Chi’s fix merging the “_freeze_importlib” line. It may be possible to have the configure script adjust the default for the BOOT flag rather than setting GENERATED_COMMENT. But the side effect would be disabling regeneration of additional things (e.g. that aren’t specifically broken with cross compilation. Anyway my preference was to stop automatically regenerating files, and to keep the build system as simple as practical without hacks like the BOOT="#" flag. |
FYI 3 FreeBSD buildbots are currently broken because of this issue. |
Oh, I just noticed that there is already a "make autoconf" target, I didn't know. |
I just created the issue bpo-30259: Test somehow that generated files are up to date: run make regen-all. |
I started a thread on python-dev to ask if it's ok to backport the change to 2.7, 3.5 and 3.6. I started to backport the change to 3.6: |
As noted on python-dev, it would be helpful if this change was mentioned in the 2.7, 3.5, and 3.6 What's New documents under a "Notable changes in maintenance releases" section. For 2.7, that would be a retitling of the existing section "New features added to Python 2.7 maintenance releases": https://docs.python.org/dev/whatsnew/2.7.html#new-features-added-to-python-2-7-maintenance-releases For 3.5 and 3.6, this would be a new entry at the end of the document, with "Change to handling of pre-generated files" as the sole subsection. (As another example of an existing section along these lines, see https://docs.python.org/dev/whatsnew/3.4.html#changed-in-3-4-3) |
As Nick noted, this change needs to be properly documented for 3.6.2 and other maintenance releases. |
I wrote #2127 to document "make regen-all". I'm not sure that it's the correct way to document such build change in minor 3.6 releases. Can someone please take a look? |
Thanks for that Victor. I started to review the PR, and then realised my suggestions were going to be extensive enough that it made more sense to post an alternate PR for you to review: #2128 |
Moving to deferred blocker and taking 3.6 off the affected versions list, since the 3.6 What's New has now been updated appropriately. Items still to be done:
|
There still might be time to get this into 3.5.4 final, if Larry agrees. |
Nick, were you planning to do the work for the other (non-3.6) branches? If not, can someone else pick this up please? |
No, I'm not currently working on this (to be completely honest, I entirely forgot we hadn't backported the What's New updates to the various branches). They'll need to be independent updates, since they affect a different file for each release (although they can then be cherry-picked forward into the development branch) |
I've updated and synced the What's New files across master, 3.7, 3.6, 3.5 (PR pending RM merge), and 2.7. So I think we are finally done here. |
make regen-all
What's New entry #2128Note: 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: