Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue27641

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Do not build Programs/_freeze_importlib when cross-compiling
Type:behaviorStage:resolved
Components:Cross-BuildVersions:Python 3.6, Python 3.5, Python 2.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Alex.Willmer, martin.panter, python-dev, thomas.perl, xdegaye
Priority:normalKeywords:patch

Created on2016-07-28 11:04 bythomas.perl, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
python-freeze-importlib-cross-compiling.patchthomas.perl,2016-07-28 11:04Only build Programs/_freeze_importlib when it is going to be usedreview
comment-out-regen.patchmartin.panter,2016-07-29 05:54review
Messages (8)
msg271519 -(view)Author: Thomas Perl (thomas.perl)*Date: 2016-07-28 11:04
Based onhttp://bugs.python.org/issue27490 andhttp://bugs.python.org/msg271495, here is a patch that makes surePrograms/_freeze_importlib is only built when not cross-compiling.
msg271606 -(view)Author: Martin Panter (martin.panter)*(Python committer)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 likePython/importlib.h: # $(srcdir)/Lib/importlib/_bootstrap.pyPrograms/_freeze_importlib./Programs/_freeze_importlib \    $(srcdir)/Lib/importlib/_bootstrap.pyPython/importlib.hSince thePython/importlib.h should already exist, the rule in this form (dependencies commented out) won’t be run, and Make won’t need to buildPrograms/_freeze_importlib either.
msg271647 -(view)Author: Xavier de Gaye (xdegaye)*(Python triager)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.pyPrograms/_freeze_importlib> ./Programs/_freeze_importlib \>     $(srcdir)/Lib/importlib/_bootstrap.pyPython/importlib.hThey 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)*(Python committer)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.pyPrograms/_freeze_importlib
msg271936 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-08-04 01:56
New changesetbc677cb34889 by Martin Panter in branch '3.5':Issue#27641: Comment out regeneration rules when cross compilinghttps://hg.python.org/cpython/rev/bc677cb34889New changesetfc034d3607a8 by Martin Panter in branch 'default':Issue#27641: Merge cross-compiling improvement from 3.5https://hg.python.org/cpython/rev/fc034d3607a8
msg271942 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-08-04 03:03
New changesete3757f3e1848 by Martin Panter in branch '2.7':Issue#27641: Comment out regeneration rules when cross compilinghttps://hg.python.org/cpython/rev/e3757f3e1848
msg271947 -(view)Author: Martin Panter (martin.panter)*(Python committer)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
DateUserActionArgs
2022-04-11 14:58:34adminsetgithub: 71828
2016-08-04 04:12:12martin.pantersetstatus: open -> closed
resolution: fixed
messages: +msg271947

stage: patch review -> resolved
2016-08-04 03:03:46python-devsetmessages: +msg271942
2016-08-04 01:56:08python-devsetnosy: +python-dev
messages: +msg271936
2016-08-01 01:32:33martin.pantersetmessages: +msg271760
2016-07-31 13:54:45thomas.perlsetmessages: +msg271737
2016-07-29 20:41:46xdegayesetmessages: +msg271647
2016-07-29 16:36:34xdegayesetnosy: +xdegaye
2016-07-29 05:54:55martin.pantersetfiles: +comment-out-regen.patch

stage: patch review
messages: +msg271606
versions: + Python 3.5
2016-07-28 11:04:44thomas.perlcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp