building: extend DLL search paths when searching for binary deps#6925
building: extend DLL search paths when searching for binary deps#6925rokm merged 1 commit intopyinstaller:developfrom
Conversation
|
Any chance we can get this merged? I've been using it the last month or so and it's working really well. |
This change works well for the For other packages (for example
I've been meaning to revise the dependency analysis to preserve the DLL sub-directory structure where possible, but for that to work on all OSes, I need to add support for symlinks on linux and macOS first... Although , we could try implementing the DLL directory structure preservation for Windows in advance, as we won't have symlinks there anyway. And any regressions stemming from DLLs not being collected into top-level directory will have to be discovered and addressed sooner or later... |
|
Ah, I see. I appreciate the complexity! |
|
In addition to solving the PySide6 6.3 problem, this will likely silence the slew of missing DLL warnings that people tend to get on Windows when using Furthermore, it should also solve the problem with Anaconda-installed |
51c8819 to
ae45b29
Compare
As part of depdendency analysis, we search for binary dependencies (shared libraries) of the collected binaries, which is done by running the `find_binary_dependencies` helper function in an isolated sub-process. In that helper, we already import all collected top-level packages; the aim was to ensure that library search paths, which may be modified during packages' initialization, are up to date. In practice, however, just importing the packages has little effect on search paths - at least on Windows, where we still consider only the binary's parent directory. Therefore, we now try to explicitly extend the search paths on Windows, obtaining extra DLL search directories: - from the PATH environment variable once all packages are imported - by tracking calls to `os.add_dll_directory` calls during package imports by monkey-patching that call
ae45b29 to
a25d66a
Compare
As part of depdendency analysis, we search for binary dependencies (shared libraries) of the collected binaries, which is done by
running the
find_binary_dependencieshelper function in an isolated sub-process.In that helper, we already import all collected top-level packages; the aim was to ensure that library search paths, which may be
modified during packages' initialization, are up to date. In practice, however, just importing the packages has little effect on search paths - at least on Windows, where we still consider only the binary's parent directory.
Therefore, we now try to explicitly extend the search paths on Windows, obtaining extra DLL search directories:
os.add_dll_directorycalls during package imports by monkey-patching that callFixes #6924.
Fixes pyinstaller/pyinstaller-hooks-contrib#317.
Fixes #6482.
Fixes #6960.