Skip to content

WIP: Less dlls

Vasily Galkin requested to merge galkinvv/meld:less-dlls into main

This patach tries to move nearly all dlls in lib subfolder. Actually this is "replacing one set of a hacks with another set of a hacks" However this leads to followinf improvements:

  • smaller installation size
  • 10% smaller installer size
  • less confusion during debugging where dll is loading
  • a hope (is not achieved yet) for a more clean fix for #267 (closed)
  • after 497bc047 meld's directory is added to PATH. And Path on windows is sometimes used for DLLs to. Having many dlls in meld folder gives a greater chance to break some other (maybe actually written wrong, but...) applications
  • think that such layout actually more compliant to cx_Freeze design
  • easier to spot exes in a installation root (would be useful for publishing zips)

However it is still in WIP state - with MSYSTEM var set to any value - it fails with similar to #267 (closed) at the python init stage:

Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'S:\meld-windows\ICONS-AND-DLLS-Meld-3.21.1.mingw\Meld.exe'
  isolated = 0
  environment = 0
  user site = 1
  import site = 0
  sys._base_executable = 'S:\\meld-windows\\ICONS-AND-DLLS-Meld-3.21.1.mingw\\Meld.exe'
  sys.base_prefix = ''
  sys.base_exec_prefix = ''
  sys.executable = 'S:\\meld-windows\\ICONS-AND-DLLS-Meld-3.21.1.mingw\\Meld.exe'
  sys.prefix = ''
  sys.exec_prefix = ''
  sys.path = [
    'S:\\meld-windows\\ICONS-AND-DLLS-Meld-3.21.1.mingw\\lib\\library.zip',
    'S:\\meld-windows\\ICONS-AND-DLLS-Meld-3.21.1.mingw\\lib',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
Traceback (most recent call last):
  File "<frozen zipimport>", line 520, in _get_decompress_func
ImportError: DLL load failed while importing zlib: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen zipimport>", line 568, in _get_data
  File "<frozen zipimport>", line 523, in _get_decompress_func
zipimport.ZipImportError: can't decompress data; zlib not available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen zipimport>", line 241, in load_module
  File "<frozen zipimport>", line 709, in _get_module_code
  File "<frozen zipimport>", line 570, in _get_data
zipimport.ZipImportError: can't decompress data; zlib not available

Also this may break windows7 without update KB2533623 (AddDllDirectiry improvements, released in 2011). Without MSYSTEM var - tested on updated win7 and on win10.

I'm publishing mostly to share some progress in this area (and to save overall time if somebody else would investigating the same area)

Edited by Kai Willadsen

Merge request reports

Loading