New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicating binary files #8028
Comments
Can you give an example? Depending on whatever this binary is and how it finds its dependencies, there's a pretty good chance that it wouldn't be able to find the dependencies in subdirectories. |
PyInstaller's binary dependency analysis has always collected dependencies into top-level application directory, since that's the only location that is always guaranteed to be in the library search path. Only in recent versions, we've begun changing that behavior for binaries that are located in python packages (since their code often depends on the exact location). But for binaries in an arbitrary location, the destination directory will be top-level directory, same as before. The difference before and after 5.10 is #7522, which puts binaries specified via That said, the binary parent path preservation could (and probably should) be extended a bit more; so that on Windows, if we find a dependency next to the analyzed binary, we reuse the analyzed binary's target location (since either its location was preserved, or was explicitly specified via |
Well I don't know what's really going on. Now I’ll try to describe it in as much detail as possible. My application has a tdlib module that contains a wrapper, as well as 4 binary files for its operation:
All this is located in the tdlib subdirectory and is loaded from there through the CDLL function of the ctypes module. --add-binary tdLib\tdjson.dll;tdLib --add-binary tdLib\libcrypto-3.dll;tdLib --add-binary tdLib\libssl-3.dll;tdLib --add-binary tdLib\zlib1.dll;tdLib As a result of the build, the tdlib subdirectory contains all 4 specified binaries, but the following binaries are copied to the application root directory, or the "_internal" folder:
And this happens with some other binaries in other submodules. |
Yeah, the described behavior matches what I would expect, as long as the With latest PyInstaller versions, adding just But to allow you to explicitly specify all binaries and avoid the duplication, the binary parent path preservation will need to be extended as I outlined earlier. |
Could you explain what this means? I don't quite understand what you mean. |
It means I need to fix that part of PyInstaller code. |
Understood thanks:) |
Description of the issue
Including binaries via "--add-binary" that are in subdirectories and require additional dependencies results in duplication of these dependencies in the application root directory, even though the dependencies are already added via "--add-binary".
This problem started in version 5.10.
Context information (for bug reports)
Version of Python: 3.8.10
Platform: Windows 10
How you installed Python: python.org/downloads
Did you also try this on another platform? Does it work there?
Haven't tried it
try the latest development version, using the following command:
(https://github.com/pyinstaller/pyinstaller/wiki/If-Things-Go-Wrong) and
Make sure everything is packaged correctly
--noupx
or setupx=False
in your .spec-file--debug
topyi-makespec
orpyinstaller
or useEXE(..., debug=1, ...)
in your .spec file.A minimal example program which shows the error
Stacktrace / full error message
Please also see https://github.com/pyinstaller/pyinstaller/wiki/How-to-Report-Bugs
for more about what would use to solve the issue.
The text was updated successfully, but these errors were encountered: