Repository: pyinstaller/pyinstaller

Issue:
base_library.zip is not reproducible
I'm currently trying to make [Electrum](https://github.com/spesmilo/electrum) builds reproducible. I've already set `PYTHON_HASHSEED` so that's not the issue. Apparently, `base_library.zip` differs when it's rebuilt:

<details>
  <summary>Console output (Click to expand)</summary>

```
 bauerj@bauerj-Ultra  ~/electrum/contrib/build-wine   master ●  wine "C:/python$PYTHON_VERSION/scripts/pyinstaller.exe" --noconfirm --ascii -D --name electrum.exe -w deterministic.spec

fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
117 INFO: PyInstaller: 3.4.dev0+133d18156
118 INFO: Python: 3.5.4
122 INFO: Platform: Windows-XP-5.1.2600
127 INFO: UPX is not available.
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
516 INFO: Extending PYTHONPATH with paths
['C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum']
516 INFO: checking Analysis
517 INFO: Building Analysis because out00-Analysis.toc is non existent
517 INFO: Initializing module dependency graph...
522 INFO: Initializing module graph hooks...
525 INFO: Analyzing base_library.zip ...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
5721 INFO: Analyzing hidden import 'trezorlib.transport_udp'
6911 INFO: Analyzing hidden import 'trezorlib.protobuf_json'
6918 INFO: Analyzing hidden import 'trezorlib.debuglink'
6925 INFO: Analyzing hidden import 'trezorlib.qt.pinmatrix'
7031 INFO: Analyzing hidden import 'trezorlib.tools'
7038 INFO: Analyzing hidden import 'trezorlib.transport_bridge'
7420 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
9874 INFO: Analyzing hidden import 'trezorlib.client'
10034 INFO: Analyzing hidden import 'trezorlib.transport_hid'
10044 INFO: Analyzing hidden import 'trezorlib.tx_api'
10280 INFO: Analyzing hidden import 'trezorlib.ckd_public'
10475 INFO: Analyzing hidden import 'trezorlib.transport_pipe'
10480 INFO: Analyzing hidden import 'btchip.btchipHelpers'
10534 INFO: Analyzing hidden import 'btchip.btchip'
10635 INFO: Analyzing hidden import 'btchip.btchipUtils'
10641 INFO: Analyzing hidden import 'btchip.ui.personalization03config'
10693 INFO: Analyzing hidden import 'btchip.ui.personalization00start'
10698 INFO: Analyzing hidden import 'btchip.msqr'
10701 INFO: Analyzing hidden import 'btchip.ui.personalization04finalize'
10707 INFO: Analyzing hidden import 'btchip.btchipPersoWizard'
10738 INFO: Analyzing hidden import 'btchip.ui.personalization01seed'
10745 INFO: Analyzing hidden import 'btchip.ui.personalizationseedbackup03'
10752 INFO: Analyzing hidden import 'btchip.btchipFirmwareWizard'
10754 INFO: Analyzing hidden import 'btchip.ui.personalizationseedbackup02'
10759 INFO: Analyzing hidden import 'btchip.ui.personalizationseedbackup01'
10765 INFO: Analyzing hidden import 'btchip.ui.personalizationseedbackup04'
10770 INFO: Analyzing hidden import 'btchip.ui.personalization02security'
10779 INFO: Analyzing hidden import 'keepkeylib.debuglink'
11079 INFO: Analyzing hidden import 'keepkeylib.ckd_public'
11097 INFO: Analyzing hidden import 'keepkeylib.transport_fake'
11099 INFO: Analyzing hidden import 'keepkeylib.tx_api'
11109 INFO: Analyzing hidden import 'keepkeylib.client'
11165 INFO: Analyzing hidden import 'keepkeylib.transport_serial'
11173 INFO: Analyzing hidden import 'keepkeylib.protobuf_json'
11182 INFO: Analyzing hidden import 'keepkeylib.transport_hid'
11189 INFO: Analyzing hidden import 'keepkeylib.qt'
11237 INFO: Analyzing hidden import 'keepkeylib.qt.pinmatrix'
11248 INFO: Analyzing hidden import 'keepkeylib.transport_pipe'
11254 INFO: Analyzing hidden import 'keepkeylib.transport_socket'
11263 INFO: running Analysis out00-Analysis.toc
11273 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\python3.5.4\python.exe
11601 INFO: Caching module hooks...
11610 INFO: Analyzing C:\electrum\electrum
11975 INFO: Processing pre-safe import module hook   six.moves
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
15007 INFO: Analyzing C:\electrum\gui\qt\main_window.py
15236 INFO: Analyzing C:\electrum\gui\text.py
15350 INFO: Analyzing C:\electrum\lib\util.py
15394 INFO: Analyzing C:\electrum\lib\wallet.py
15507 INFO: Analyzing C:\electrum\lib\simple_config.py
15524 INFO: Analyzing C:\electrum\lib\bitcoin.py
15597 INFO: Analyzing C:\electrum\lib\dnssec.py
15616 INFO: Analyzing C:\electrum\lib\commands.py
15668 INFO: Analyzing C:\electrum\plugins\cosigner_pool\qt.py
16445 INFO: Analyzing C:\electrum\plugins\email_requests\qt.py
16630 INFO: Analyzing C:\electrum\plugins\trezor\client.py
16633 INFO: Analyzing C:\electrum\plugins\trezor\qt.py
16634 INFO: Analyzing C:\electrum\plugins\keepkey\qt.py
16636 INFO: Analyzing C:\electrum\plugins\ledger\qt.py
16642 INFO: Loading module hooks...
16643 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
16878 INFO: Loading module hook "hook-certifi.py"...
16881 INFO: Loading module hook "hook-pydoc.py"...
16882 INFO: Loading module hook "hook-dns.rdata.py"...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
17222 INFO: Loading module hook "hook-PyQt5.py"...
17227 INFO: Loading module hook "hook-requests.py"...
17229 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
17230 INFO: Loading module hook "hook-encodings.py"...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
17394 INFO: Loading module hook "hook-Cryptodome.py"...
17418 INFO: Loading module hook "hook-PyQt5.Qt.py"...
17419 INFO: Loading module hook "hook-xml.py"...
17539 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
18904 INFO: Loading module hook "hook-PyQt5.QtPrintSupport.py"...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
19226 INFO: checking Tree
19227 INFO: Building Tree because out00-Tree.toc is non existent
19227 INFO: Building Tree out00-Tree.toc
19356 INFO: checking Tree
19356 INFO: Building Tree because out01-Tree.toc is non existent
19356 INFO: Building Tree out01-Tree.toc
19379 INFO: checking Tree
19380 INFO: Building Tree because out02-Tree.toc is non existent
19380 INFO: Building Tree out02-Tree.toc
19389 INFO: checking Tree
19389 INFO: Building Tree because out03-Tree.toc is non existent
19389 INFO: Building Tree out03-Tree.toc
19458 INFO: checking Tree
19458 INFO: Building Tree because out04-Tree.toc is non existent
19458 INFO: Building Tree out04-Tree.toc
19469 INFO: checking Tree
19470 INFO: Building Tree because out05-Tree.toc is non existent
19470 INFO: Building Tree out05-Tree.toc
19471 INFO: Looking for ctypes DLLs
19516 INFO: Analyzing run-time hooks ...
19530 INFO: Including run-time hook 'pyi_rth_qt5.py'
19562 INFO: Looking for dynamic libraries
21450 INFO: Looking for eggs
21450 INFO: Using Python library c:\python3.5.4\python35.dll
21451 INFO: Found binding redirects: 
[]
21460 INFO: Warnings written to Z:\home\bauerj\electrum\contrib\build-wine\build\deterministic\warndeterministic.txt
21723 INFO: Graph cross-reference written to Z:\home\bauerj\electrum\contrib\build-wine\build\deterministic\xref-deterministic.html
21762 INFO: Appending 'datas' from .spec
21797 INFO: checking PYZ
21798 INFO: Building PYZ because out00-PYZ.toc is non existent
21798 INFO: Building PYZ (ZlibArchive) Z:\home\bauerj\electrum\contrib\build-wine\build\deterministic\out00-PYZ.pyz
25585 INFO: Building PYZ (ZlibArchive) Z:\home\bauerj\electrum\contrib\build-wine\build\deterministic\out00-PYZ.pyz completed successfully.
25631 INFO: checking PKG
25631 INFO: Building PKG because out00-PKG.toc is non existent
25631 INFO: Building PKG (CArchive) out00-PKG.pkg
32151 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
32164 INFO: Bootloader c:\python3.5.4\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
32164 INFO: checking EXE
32164 INFO: Building EXE because out00-EXE.toc is non existent
32165 INFO: Building EXE from out00-EXE.toc
32167 INFO: SRCPATH [('C:\\electrum\\icons/electrum.ico', None)]
32167 INFO: Updating icons from ['C:\\electrum\\icons/electrum.ico'] to C:\users\bauerj\Temp\tmpavohvg5w
32168 INFO: Writing RT_GROUP_ICON 0 resource with 146 bytes
32168 INFO: Writing RT_ICON 1 resource with 296 bytes
32168 INFO: Writing RT_ICON 2 resource with 1384 bytes
32168 INFO: Writing RT_ICON 3 resource with 1128 bytes
32168 INFO: Writing RT_ICON 4 resource with 744 bytes
32168 INFO: Writing RT_ICON 5 resource with 2216 bytes
32168 INFO: Writing RT_ICON 6 resource with 4264 bytes
32168 INFO: Writing RT_ICON 7 resource with 1640 bytes
32169 INFO: Writing RT_ICON 8 resource with 3752 bytes
32169 INFO: Writing RT_ICON 9 resource with 9640 bytes
32169 INFO: Writing RT_ICON 10 resource with 26401 bytes
32171 INFO: Appending archive to EXE Z:\home\bauerj\electrum\contrib\build-wine\dist\electrum.exe
32202 INFO: Building EXE from out00-EXE.toc completed successfully.
32224 INFO: checking COLLECT
32225 INFO: Building COLLECT because out00-COLLECT.toc is non existent
32226 INFO: Building COLLECT out00-COLLECT.toc
32995 INFO: Building COLLECT out00-COLLECT.toc completed successfully.
fixme:msvcrt:__clean_type_info_names_internal (0xcd3668) stub
fixme:msvcrt:__clean_type_info_names_internal (0x1e3b308c) stub
fixme:msvcrt:__clean_type_info_names_internal (0x1e8d70c0) stub
fixme:msvcrt:__clean_type_info_names_internal (0x1e7b97fc) stub
 bauerj@bauerj-Ultra  ~/electrum/contrib/build-wine   master ●  md5sum dist/electrum/base_library.zip 
82fe031a4ba731f8e276505cdd79024d  dist/electrum/base_library.zip
 bauerj@bauerj-Ultra  ~/electrum/contrib/build-wine   master ●  rm build/* dist/* -rf
zsh: sure you want to delete the only file in /home/bauerj/electrum/contrib/build-wine/build [yn]? y
zsh: sure you want to delete all 2 files in /home/bauerj/electrum/contrib/build-wine/dist [yn]? y
 bauerj@bauerj-Ultra  ~/electrum/contrib/build-wine   master ●  wine "C:/python$PYTHON_VERSION/scripts/pyinstaller.exe" --noconfirm --ascii -D --name electrum.exe -w deterministic.spec


fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
143 INFO: PyInstaller: 3.4.dev0+133d18156
143 INFO: Python: 3.5.4
147 INFO: Platform: Windows-XP-5.1.2600
152 INFO: UPX is not available.
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
546 INFO: Extending PYTHONPATH with paths
['C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum',
 'C:\\electrum']
546 INFO: checking Analysis
546 INFO: Building Analysis because out00-Analysis.toc is non existent
547 INFO: Initializing module dependency graph...
553 INFO: Initializing module graph hooks...
556 INFO: Analyzing base_library.zip ...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
6210 INFO: Analyzing hidden import 'trezorlib.transport_udp'
7437 INFO: Analyzing hidden import 'trezorlib.protobuf_json'
7444 INFO: Analyzing hidden import 'trezorlib.debuglink'
7451 INFO: Analyzing hidden import 'trezorlib.qt.pinmatrix'
7561 INFO: Analyzing hidden import 'trezorlib.tools'
7568 INFO: Analyzing hidden import 'trezorlib.transport_bridge'
7947 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
10394 INFO: Analyzing hidden import 'trezorlib.client'
10550 INFO: Analyzing hidden import 'trezorlib.transport_hid'
10560 INFO: Analyzing hidden import 'trezorlib.tx_api'
10786 INFO: Analyzing hidden import 'trezorlib.ckd_public'
10980 INFO: Analyzing hidden import 'trezorlib.transport_pipe'
10985 INFO: Analyzing hidden import 'btchip.btchipHelpers'
11040 INFO: Analyzing hidden import 'btchip.btchip'
11139 INFO: Analyzing hidden import 'btchip.btchipUtils'
11145 INFO: Analyzing hidden import 'btchip.ui.personalization03config'
11197 INFO: Analyzing hidden import 'btchip.ui.personalization00start'
11202 INFO: Analyzing hidden import 'btchip.msqr'
11205 INFO: Analyzing hidden import 'btchip.ui.personalization04finalize'
11212 INFO: Analyzing hidden import 'btchip.btchipPersoWizard'
11241 INFO: Analyzing hidden import 'btchip.ui.personalization01seed'
11248 INFO: Analyzing hidden import 'btchip.ui.personalizationseedbackup03'
11255 INFO: Analyzing hidden import 'btchip.btchipFirmwareWizard'
11256 INFO: Analyzing hidden import 'btchip.ui.personalizationseedbackup02'
11261 INFO: Analyzing hidden import 'btchip.ui.personalizationseedbackup01'
11267 INFO: Analyzing hidden import 'btchip.ui.personalizationseedbackup04'
11272 INFO: Analyzing hidden import 'btchip.ui.personalization02security'
11281 INFO: Analyzing hidden import 'keepkeylib.debuglink'
11568 INFO: Analyzing hidden import 'keepkeylib.ckd_public'
11585 INFO: Analyzing hidden import 'keepkeylib.transport_fake'
11587 INFO: Analyzing hidden import 'keepkeylib.tx_api'
11597 INFO: Analyzing hidden import 'keepkeylib.client'
11651 INFO: Analyzing hidden import 'keepkeylib.transport_serial'
11658 INFO: Analyzing hidden import 'keepkeylib.protobuf_json'
11668 INFO: Analyzing hidden import 'keepkeylib.transport_hid'
11674 INFO: Analyzing hidden import 'keepkeylib.qt'
11719 INFO: Analyzing hidden import 'keepkeylib.qt.pinmatrix'
11728 INFO: Analyzing hidden import 'keepkeylib.transport_pipe'
11732 INFO: Analyzing hidden import 'keepkeylib.transport_socket'
11740 INFO: running Analysis out00-Analysis.toc
11751 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\python3.5.4\python.exe
12063 INFO: Caching module hooks...
12072 INFO: Analyzing C:\electrum\electrum
12440 INFO: Processing pre-safe import module hook   six.moves
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
15483 INFO: Analyzing C:\electrum\gui\qt\main_window.py
15728 INFO: Analyzing C:\electrum\gui\text.py
15828 INFO: Analyzing C:\electrum\lib\util.py
15870 INFO: Analyzing C:\electrum\lib\wallet.py
15982 INFO: Analyzing C:\electrum\lib\simple_config.py
15998 INFO: Analyzing C:\electrum\lib\bitcoin.py
16073 INFO: Analyzing C:\electrum\lib\dnssec.py
16092 INFO: Analyzing C:\electrum\lib\commands.py
16146 INFO: Analyzing C:\electrum\plugins\cosigner_pool\qt.py
16895 INFO: Analyzing C:\electrum\plugins\email_requests\qt.py
17071 INFO: Analyzing C:\electrum\plugins\trezor\client.py
17073 INFO: Analyzing C:\electrum\plugins\trezor\qt.py
17075 INFO: Analyzing C:\electrum\plugins\keepkey\qt.py
17077 INFO: Analyzing C:\electrum\plugins\ledger\qt.py
17082 INFO: Loading module hooks...
17083 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
17319 INFO: Loading module hook "hook-certifi.py"...
17322 INFO: Loading module hook "hook-pydoc.py"...
17322 INFO: Loading module hook "hook-dns.rdata.py"...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
17655 INFO: Loading module hook "hook-PyQt5.py"...
17660 INFO: Loading module hook "hook-requests.py"...
17662 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
17663 INFO: Loading module hook "hook-encodings.py"...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
17823 INFO: Loading module hook "hook-Cryptodome.py"...
17846 INFO: Loading module hook "hook-PyQt5.Qt.py"...
17848 INFO: Loading module hook "hook-xml.py"...
17965 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
19391 INFO: Loading module hook "hook-PyQt5.QtPrintSupport.py"...
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
19714 INFO: checking Tree
19714 INFO: Building Tree because out00-Tree.toc is non existent
19714 INFO: Building Tree out00-Tree.toc
19839 INFO: checking Tree
19839 INFO: Building Tree because out01-Tree.toc is non existent
19839 INFO: Building Tree out01-Tree.toc
19864 INFO: checking Tree
19864 INFO: Building Tree because out02-Tree.toc is non existent
19864 INFO: Building Tree out02-Tree.toc
19872 INFO: checking Tree
19872 INFO: Building Tree because out03-Tree.toc is non existent
19872 INFO: Building Tree out03-Tree.toc
19938 INFO: checking Tree
19939 INFO: Building Tree because out04-Tree.toc is non existent
19939 INFO: Building Tree out04-Tree.toc
19953 INFO: checking Tree
19953 INFO: Building Tree because out05-Tree.toc is non existent
19953 INFO: Building Tree out05-Tree.toc
19956 INFO: Looking for ctypes DLLs
20016 INFO: Analyzing run-time hooks ...
20031 INFO: Including run-time hook 'pyi_rth_qt5.py'
20067 INFO: Looking for dynamic libraries
22071 INFO: Looking for eggs
22071 INFO: Using Python library c:\python3.5.4\python35.dll
22071 INFO: Found binding redirects: 
[]
22083 INFO: Warnings written to Z:\home\bauerj\electrum\contrib\build-wine\build\deterministic\warndeterministic.txt
22321 INFO: Graph cross-reference written to Z:\home\bauerj\electrum\contrib\build-wine\build\deterministic\xref-deterministic.html
22357 INFO: Appending 'datas' from .spec
22392 INFO: checking PYZ
22392 INFO: Building PYZ because out00-PYZ.toc is non existent
22393 INFO: Building PYZ (ZlibArchive) Z:\home\bauerj\electrum\contrib\build-wine\build\deterministic\out00-PYZ.pyz
26199 INFO: Building PYZ (ZlibArchive) Z:\home\bauerj\electrum\contrib\build-wine\build\deterministic\out00-PYZ.pyz completed successfully.
26231 INFO: checking PKG
26232 INFO: Building PKG because out00-PKG.toc is non existent
26232 INFO: Building PKG (CArchive) out00-PKG.pkg
32638 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
32650 INFO: Bootloader c:\python3.5.4\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
32650 INFO: checking EXE
32651 INFO: Building EXE because out00-EXE.toc is non existent
32651 INFO: Building EXE from out00-EXE.toc
32653 INFO: SRCPATH [('C:\\electrum\\icons/electrum.ico', None)]
32653 INFO: Updating icons from ['C:\\electrum\\icons/electrum.ico'] to C:\users\bauerj\Temp\tmpc0xjc_9n
32654 INFO: Writing RT_GROUP_ICON 0 resource with 146 bytes
32654 INFO: Writing RT_ICON 1 resource with 296 bytes
32654 INFO: Writing RT_ICON 2 resource with 1384 bytes
32654 INFO: Writing RT_ICON 3 resource with 1128 bytes
32654 INFO: Writing RT_ICON 4 resource with 744 bytes
32655 INFO: Writing RT_ICON 5 resource with 2216 bytes
32655 INFO: Writing RT_ICON 6 resource with 4264 bytes
32655 INFO: Writing RT_ICON 7 resource with 1640 bytes
32655 INFO: Writing RT_ICON 8 resource with 3752 bytes
32655 INFO: Writing RT_ICON 9 resource with 9640 bytes
32655 INFO: Writing RT_ICON 10 resource with 26401 bytes
32657 INFO: Appending archive to EXE Z:\home\bauerj\electrum\contrib\build-wine\dist\electrum.exe
32681 INFO: Building EXE from out00-EXE.toc completed successfully.
32704 INFO: checking COLLECT
32705 INFO: Building COLLECT because out00-COLLECT.toc is non existent
32705 INFO: Building COLLECT out00-COLLECT.toc
33419 INFO: Building COLLECT out00-COLLECT.toc completed successfully.
fixme:msvcrt:__clean_type_info_names_internal (0xcd3668) stub
fixme:msvcrt:__clean_type_info_names_internal (0x1e3b308c) stub
fixme:msvcrt:__clean_type_info_names_internal (0x1e8d70c0) stub
fixme:msvcrt:__clean_type_info_names_internal (0x1e7b97fc) stub
 bauerj@bauerj-Ultra  ~/electrum/contrib/build-wine   master ●  md5sum dist/electrum/base_library.zip
06d7f7cc2661d5a9e2362101ca348f0e  dist/electrum/base_library.zip
```
</details>

---

I've checked the file and all the differences are in the ZIP header's modification time field. It shouldn't be necessary to preserve the modification time in the ZIP file and it's certainly counter-productive for reproducible builds.

The same behaviour appears on commit 133d1815643cda8efc99118e0ccb28a5ff4cf8c2

--- 

[⬇️ First `base_library.zip`](https://github.com/pyinstaller/pyinstaller/files/1432119/1.zip)
[⬇️ Second `base_library.zip`](https://github.com/pyinstaller/pyinstaller/files/1432120/2.zip)


Discussion:
I found a way to write the timestamp.
I wrote the following patch:

```
diff --git a/PyInstaller/depend/utils.py b/PyInstaller/depend/utils.py
index 22027c68..c961d187 100644
--- a/PyInstaller/depend/utils.py
+++ b/PyInstaller/depend/utils.py
@@ -91,7 +91,8 @@ def create_py3_base_library(libzip_filename, graph):
                             _write_long(fc, timestamp)
                             _write_long(fc, size)
                             marshal.dump(mod.code, fc)
-                            zf.writestr(new_name, fc.getvalue())
+                            info = zipfile.ZipInfo(new_name, date_time=(1980, 1, 1, 0, 0, 0) )
+                            zf.writestr(info, fc.getvalue())
 
     except Exception as e:
         logger.error('base_library.zip could not be created!')

```
Thanks for tracking this down to the required change. Please provide a pull-request for this.

~~I propose adding~~
1) ~~Change time only `if 'SOURCE_DATE_EPOCH' in os.environ`~~
2) ~~Take the time-stamp from SOURCE_DATE_EPOCH.~~

After rethinking, I don't propose this anymore :-) If we are not setting `date_time` for the entry, it'll become the current date and time – which is of absolutely no use, but leaks the build-time. So please submit a pull-request based on your change.
And please add a comment that this is done for reproducible build.

Oh, and I just discovered that [`ZipInfo()` defaults to `date_time=(1980,1,1,0,0,0)`](https://docs.python.org/3/library/zipfile.html#zipfile.ZipInfo) (undocumented for python 2.7, but it's in the code), so you do not even need to pass this argument.
the default parameter of Zipinfo() might change in future versions. I would leave it explicit for safety
> the default parameter of Zipinfo() might change in future versions

Maybe (chances are low IMHO), but since this is documented new, any change would be done only with a new Python release. And for reproducibility you need the exact Python release anyway :-)
ok

Resolving patch:
diff --git a/PyInstaller/depend/utils.py b/PyInstaller/depend/utils.py
--- a/PyInstaller/depend/utils.py
+++ b/PyInstaller/depend/utils.py
@@ -91,7 +91,9 @@ def _write_long(f, x):
                             _write_long(fc, timestamp)
                             _write_long(fc, size)
                             marshal.dump(mod.code, fc)
-                            zf.writestr(new_name, fc.getvalue())
+                            # Use a ZipInfo to set timestamp for deterministic build 
+                            info = zipfile.ZipInfo(new_name)
+                            zf.writestr(info, fc.getvalue())
 
     except Exception as e:
         logger.error('base_library.zip could not be created!')


Test patch: