Showing content from http://mail.python.org/pipermail/python-dev/attachments/20170210/0ac355c3/attachment.html below:
<div dir="ltr"><span style="font-size:12.8px">That should have been </span><span style="font-size:12.8px">`PYTHONHASHSEED=0 $out/bin/python -m compileall -f $out`.</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 10, 2017 at 11:58 AM, Freddy Rietdijk <span dir="ltr"><<a href="mailto:freddyrietdijk@fridh.nl" target="_blank">freddyrietdijk@fridh.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">For Python 3.5 PYTHONHASHSEED doesn't seem to be sufficient, these items still seem indeterministic.<div>To be sure, I ran `PYTHONHASHSEED=1 $out/bin/python -m compileall -f $out` where $out is the path where I installed Python.</div><div><br></div><div>Do you have an idea why in [3], this is Python 2.7, the timestamps are still incorrect? I think they're all required for `compileall` and somehow it doesn't seem capable of taking into account DETERMINISTIC_BUILD. Explicitly removing those pyc and pyo files and recompiling them to bytecode still results in timestamp issues for these 4 files.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 9, 2017 at 6:51 PM, INADA Naoki <span dir="ltr"><<a href="mailto:songofacandy@gmail.com" target="_blank">songofacandy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Fri, Feb 10, 2017 at 2:45 AM, Freddy Rietdijk<br>
<<a href="mailto:freddyrietdijk@fridh.nl" target="_blank">freddyrietdijk@fridh.nl</a>> wrote:<br>
> Correct, that was an older version from before I patched<br>
> `_bootstrap_external.py`. A more recent diff can be found at<br>
><br>
> <a href="https://gist.github.com/anonymous/d40f24fd6b636ba40d345ff3f12a0aaa" rel="noreferrer" target="_blank">https://gist.github.com/anonym<wbr>ous/d40f24fd6b636ba40d345ff3f1<wbr>2a0aaa</a><br>
><br>
> These all seem to be sets.<br>
<br>
</span>Maybe, PYTHONHASHSEED help you.<br>
<a href="https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHASHSEED" rel="noreferrer" target="_blank">https://docs.python.org/3/usin<wbr>g/cmdline.html#envvar-PYTHONHA<wbr>SHSEED</a><br>
<div class="m_6842482523322844641HOEnZb"><div class="m_6842482523322844641h5"><br>
><br>
> On Thu, Feb 9, 2017 at 6:04 PM, INADA Naoki <<a href="mailto:songofacandy@gmail.com" target="_blank">songofacandy@gmail.com</a>> wrote:<br>
>><br>
>> As reading [4], mtime is not 0.<br>
>><br>
>>Â Â Â data = bytearray(MAGIC_NUMBER)<br>
>>Â Â Â data.extend(_w_long(mtime))<br>
>>Â Â Â data.extend(_w_long(source_si<wbr>ze))<br>
>>Â Â Â data.extend(marshal.dumps(cod<wbr>e))<br>
>><br>
>> First 4 bytes are magic.<br>
>> Next 4 bytes are mtime.<br>
>><br>
>> â â â â -00000000: 160d 0d0a 6b2e 9c58 6c21 0000 e300 0000<br>
>> ....k..Xl!......<br>
>> â â â â +00000000: 160d 0d0a e631 9c58 6c21 0000 e300 0000<br>
>> .....1.Xl!......<br>
>><br>
>> mtime is 6b2e9c58 vs e6319c53 (little endian)<br>
>><br>
>> maybe, you failed to use customized py_compile when building?<br>
>><br>
>><br>
>> On Thu, Feb 9, 2017 at 6:27 PM, Freddy Rietdijk <<a href="mailto:freddyrietdijk@fridh.nl" target="_blank">freddyrietdijk@fridh.nl</a>><br>
>> wrote:<br>
>> > Hi,<br>
>> ><br>
>> > I'm attempting to make the builds of the Python interpreters for Nixpkgs<br>
>> > [1]<br>
>> > deterministic.<br>
>> ><br>
>> > In the case of Python 2.7 we have a patch [2] that fixes the timestamp<br>
>> > used<br>
>> > in .pyc files in case the env var `DETERMINISTIC_BUILD` is set. We also<br>
>> > remove `wininst*.exe`. This works fine, although there are 4 small<br>
>> > issues<br>
>> > left [3]. Do you have any idea what is going on in these files that<br>
>> > could<br>
>> > make them indeterministic?<br>
>> ><br>
>> > For Python 3.x I disabled ensurepip, removed `wininst*.exe`, and<br>
>> > modified<br>
>> > `py_compile` to use `0` instead of `source_stats['mtime']`. The builds<br>
>> > are<br>
>> > not yet deterministic [4]. Any suggestions what could be fixed here?<br>
>> ><br>
>> > Kind regards,<br>
>> ><br>
>> > Freddy<br>
>> ><br>
>> ><br>
>> > [1] <a href="https://github.com/NixOS/nixpkgs" rel="noreferrer" target="_blank">https://github.com/NixOS/nixpk<wbr>gs</a><br>
>> > [2]<br>
>> ><br>
>> > <a href="https://github.com/NixOS/nixpkgs/blob/1da6775/pkgs/development/interpreters/python/cpython/2.7/deterministic-build.patch" rel="noreferrer" target="_blank">https://github.com/NixOS/nixpk<wbr>gs/blob/1da6775/pkgs/developme<wbr>nt/interpreters/python/<wbr>cpython/2.7/deterministic-<wbr>build.patch</a><br>
>> > [3] <a href="https://github.com/NixOS/nixpkgs/issues/22570#issuecomment-278474082" rel="noreferrer" target="_blank">https://github.com/NixOS/nixpk<wbr>gs/issues/22570#issuecomment-<wbr>278474082</a><br>
>> > [4] <a href="https://gist.github.com/anonymous/7cc147af6511dee2dc5a5b8d110f0e6b" rel="noreferrer" target="_blank">https://gist.github.com/anonym<wbr>ous/7cc147af6511dee2dc5a5b8d11<wbr>0f0e6b</a><br>
>> ><br>
>> > ______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/python-dev</a><br>
>> > Unsubscribe:<br>
>> ><br>
>> > <a href="https://mail.python.org/mailman/options/python-dev/songofacandy%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/options/python-dev/songofaca<wbr>ndy%40gmail.com</a><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4