Issue27641
Created on 2016-07-28 11:04 by thomas.perl, last changed 2016-08-04 04:12 by martin.panter. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| python-freeze-importlib-cross-compiling.patch | thomas.perl, 2016-07-28 11:04 | Only build Programs/_freeze_importlib when it is going to be used | review | |
| comment-out-regen.patch | martin.panter, 2016-07-29 05:54 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg271519 - (view) | Author: Thomas Perl (thomas.perl) * | Date: 2016-07-28 11:04 | |
Based on http://bugs.python.org/issue27490 and http://bugs.python.org/msg271495, here is a patch that makes sure Programs/_freeze_importlib is only built when not cross-compiling. |
|||
| msg271606 - (view) | Author: Martin Panter (martin.panter) * | Date: 2016-07-29 05:54 | |
Here is another possible option. It is still a bit of a hack, because the configure script inserts comments into the makefile, but this is already done e.g. with @EXPORT_MACOSX_DEPLOYMENT_TARGET@. The advantage is we get to keep the filenames of the dependencies in the makefile, so it should be easier to read and maintain. And we get to eliminate the $(cross_compiling) check as well. In native compiling mode, everything should be as normal. When cross-compiling, the rules for regenerating files should read like Python/importlib.h: # $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib ./Programs/_freeze_importlib \ $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h Since the Python/importlib.h should already exist, the rule in this form (dependencies commented out) won’t be run, and Make won’t need to build Programs/_freeze_importlib either. |
|||
| msg271647 - (view) | Author: Xavier de Gaye (xdegaye) * | Date: 2016-07-29 20:41 | |
Nice. FWIW cross-compilation for Android works fine with comment-out-regen.patch. > In native compiling mode, everything should be as normal. When cross-compiling, the rules for regenerating files should read like > > Python/importlib.h: # $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib > ./Programs/_freeze_importlib \ > $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h They do read like this. |
|||
| msg271737 - (view) | Author: Thomas Perl (thomas.perl) * | Date: 2016-07-31 13:54 | |
+1 on comment-out-regen.patch, makes things much cleaner and removes the shell "if" in the rule body.
Just a small bikeshed issue: Instead of COMMENT_REGEN, maybe call it "CROSS_COMPILE_COMMENT" or "GENERATED_COMMENT" or "COMMENT_IF_CROSS" or somesuch? This way, might be easier to read/understand the makefile rules ("COMMENT_IF_CROSS" -> "a comment character will be inserted here if cross-compiling")?
|
|||
| msg271760 - (view) | Author: Martin Panter (martin.panter) * | Date: 2016-08-01 01:32 | |
Thanks for the feedback. I did wonder about the name. Perhaps I will go with GENERATED_COMMENT: GENERATED_COMMENT='#' Python/importlib_external.h: @GENERATED_COMMENT@ $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib |
|||
| msg271936 - (view) | Author: Roundup Robot (python-dev) | Date: 2016-08-04 01:56 | |
New changeset bc677cb34889 by Martin Panter in branch '3.5': Issue #27641: Comment out regeneration rules when cross compiling https://hg.python.org/cpython/rev/bc677cb34889 New changeset fc034d3607a8 by Martin Panter in branch 'default': Issue #27641: Merge cross-compiling improvement from 3.5 https://hg.python.org/cpython/rev/fc034d3607a8 |
|||
| msg271942 - (view) | Author: Roundup Robot (python-dev) | Date: 2016-08-04 03:03 | |
New changeset e3757f3e1848 by Martin Panter in branch '2.7': Issue #27641: Comment out regeneration rules when cross compiling https://hg.python.org/cpython/rev/e3757f3e1848 |
|||
| msg271947 - (view) | Author: Martin Panter (martin.panter) * | Date: 2016-08-04 04:12 | |
_freeze_import is only in Python 3, but I backported my final change because it is more general and also affects pgen. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2016-08-04 04:12:12 | martin.panter | set | status: open -> closed resolution: fixed messages: + msg271947 stage: patch review -> resolved |
| 2016-08-04 03:03:46 | python-dev | set | messages: + msg271942 |
| 2016-08-04 01:56:08 | python-dev | set | nosy:
+ python-dev messages: + msg271936 |
| 2016-08-01 01:32:33 | martin.panter | set | messages: + msg271760 |
| 2016-07-31 13:54:45 | thomas.perl | set | messages: + msg271737 |
| 2016-07-29 20:41:46 | xdegaye | set | messages: + msg271647 |
| 2016-07-29 16:36:34 | xdegaye | set | nosy:
+ xdegaye |
| 2016-07-29 05:54:55 | martin.panter | set | files:
+ comment-out-regen.patch stage: patch review |
| 2016-07-28 11:04:44 | thomas.perl | create | |