<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">On Mon, Jul 23, 2018, 08:22 Eric Le Lay <<a href="mailto:contact@elelay.fr">contact@elelay.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello list,<br>
<br>
I encountered a problem with the Windows packaging of gPodder[1]<br>
using msys2:<br>
<br>
basic libraries (zlib, openssl) depended upon by python<br>
platform-specific modules are loaded preferably :<br>
1. from lib-dynload (where they are not)<br>
2. from the Windows directory (can be any version)<br>
3. from the binary directory, next to gpodder.exe (where they are)<br>
<br>
So an old zlib1.dll installed by another application in c:\Windows was<br>
loaded, incompatible with libpng and gPodder couldn't start.<br>
<br>
I don't know what's the best approach to solve it:<br>
- copy those libraries to lib\pythonxx\lib-dynload (works)<br>
- preload them in my main script before they are loaded by the module<br>
(works)<br>
- patch something in python (dynload_win.c ?) to search first in the<br>
executable directory (not tried)<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">The way we avoid these kinds of issues on Linux is to rename included libraries to unique names (e.g. zlib1-aef3742bc3e.dll), and patch the extension modules to look for the new names. There's a script (auditwheel) that does the heavy lifting. On MacOS there's a similar script people use, called "delocate".</div><div dir="auto"><br></div><div dir="auto">Unfortunately no one has written a script like this for Windows yet. I think it'd be neat if eventually we could consolidate all this into auditwheel, but there aren't that many people interested in working on it. If you wanted to help, the hardest part is already done: <a href="https://github.com/njsmith/machomachomangler/blob/master/README.rst#pe-features">https://github.com/njsmith/machomachomangler/blob/master/README.rst#pe-features</a></div><div dir="auto"><br></div><div dir="auto">Alternatively if you just want a hack that works quick, I'd do the preload thing. In general you need to do this anyway, if you don't have all your extension modules in the same directory. (Unfortunately Windows doesn't have the equivalent of RPATH.)</div><div dir="auto"><br></div><div dir="auto">-n</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>