<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Mar 13, 2016 at 7:41 PM Martin Panter <<a href="mailto:vadmium%2Bpy@gmail.com">vadmium+py@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 13 March 2016 at 01:13, Russell Keith-Magee <<a href="mailto:russell@keith-magee.com" target="_blank">russell@keith-magee.com</a>> wrote:<br>
> The patches that I've uploaded to Issue23670 [1] show a full cross-platform<br>
> [1] <a href="http://bugs.python.org/issue23670" rel="noreferrer" target="_blank">http://bugs.python.org/issue23670</a><br>
> build process. After you apply that patch, the iOS directory contains a<br>
> meta-Makefile that manages the build process.<br>
<br>
Thanks very much for pointing that out. This has helped me understand<br>
a lot more things. Only now do I realize that the four files generated<br>
by pgen and _freeze_importlib are actually already committed into the<br>
Mercurial repository:<br>
<br>
Include/graminit.h<br>
Python/graminit.c<br>
Python/importlib.h<br>
Python/importlib_external.h<br>
<br>
A question for other Python developers: Why are these generated files<br>
stored in the repository? The graminit ones seem to have been there<br>
since forever (1990). It seems the importlib ones were there due to a<br>
bootstrapping problem, but now that is solved. Antoine<br>
<<a href="https://bugs.python.org/issue14928#msg163048" rel="noreferrer" target="_blank">https://bugs.python.org/issue14928#msg163048</a>> said he kept them in<br>
the repository on purpose, but I want to know why.<br>
<br>
If we ignore the cross compiling use case, would there be any other<br>
consequences of removing these generated files from the repository?<br>
E.g. would it affect the Windows build process?<br>
<br>
I have two possible solutions in mind: either remove the generated<br>
files from the repository and always build them, or keep them but do<br>
not automatically regenerate them every build. Since they are<br>
generated files, not source files, I would prefer to remove them, but<br>
I want to know the consequences first.<br></blockquote><div><br></div><div>They should not be regenerated every build, if they are, that seems like a bug in the makefile to me (or else the timestamp checks that make does vs how your code checkout happened).  Having them checked in is convenient for cross builds as it is one less thing that needs a build-host-arch build.</div><div><br></div><div>my 2 cents,</div><div>-gps</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> On Sat, Mar 12, 2016 at 8:48 AM, Martin Panter <<a href="mailto:vadmium%2Bpy@gmail.com" target="_blank">vadmium+py@gmail.com</a>> wrote:<br>
>> On 11 March 2016 at 23:16, Russell Keith-Magee <<a href="mailto:russell@keith-magee.com" target="_blank">russell@keith-magee.com</a>><br>
>> wrote:<br>
>> ><br>
>> > On Sat, Mar 12, 2016 at 6:38 AM, Martin Panter <<a href="mailto:vadmium%2Bpy@gmail.com" target="_blank">vadmium+py@gmail.com</a>><br>
>> > wrote:<br>
>> >> I don't understand. After I run Make, it looks like I get working<br>
>> >> executables leftover at Programs/_freeze_importlib and Parser/pgen. Do<br>
>> >> you mean to install these programs with "make install" or something?<br>
>> ><br>
>> ><br>
>> > Making them part of the installable artefacts would be one option, but<br>
>> > they<br>
>> > don't have to be installed, just preserved.<br>
>><br>
>> What commands are you running that cause them to not be preserved at<br>
>> the end of the build?<br>
><br>
><br>
> I don't know - this is where I hit the end of my understanding of the build<br>
> process. All I know for certain is that 3.4.2 doesn't have this problem;<br>
> 3.5.1 does, and Issue22359 (fixed in [3]) is the source of the problem. A<br>
> subsequent fix [4] introduced an additional problem with _freeze_importlib.<br>
><br>
> [3] <a href="https://hg.python.org/cpython/rev/565b96093ec8" rel="noreferrer" target="_blank">https://hg.python.org/cpython/rev/565b96093ec8</a><br>
> [4] <a href="https://hg.python.org/cpython/rev/02e3bf65b2f8" rel="noreferrer" target="_blank">https://hg.python.org/cpython/rev/02e3bf65b2f8</a><br>
<br>
After my realization about the generated files, I think I can solve<br>
this one. Before the changes you identified, the build process<br>
probably thought the generated files were up to date, so it didn't<br>
need to cross-compile pgen or _freeze_importlib. If the generated file<br>
timestamps were out of date (e.g. depending on the order they are<br>
checked out or extracted), the first native build stage would have<br>
fixed them up.<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/greg%40krypto.org" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/greg%40krypto.org</a><br>
</blockquote></div></div>