-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
fix: restore environment before launching external programs #707
fix: restore environment before launching external programs #707
Conversation
e7b8790
to
5965872
Compare
5965872
to
bff3b07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't really have a way to test this, but it seems to follow the documentation well and I see no other issues.
PyInstaller builds tested and working on Windows 10 22H2 (Normal + Portable) and macOS 15 👍 |
PyInstaller build tested and working on Ubuntu 24.04.1 👍 |
Thank you so much for this fix! And thank you to everyone who helped test! 🎉 |
Issue
By default, any subprocesses will inherit environment variables from its parent. Pyinstaller will specify a custom
LD_LIBRARY_PATH
, which causes issues when the subprocess attempts to load its own dynamically linked libraries.https://web.archive.org/web/20240824170055/https://github.com/TagStudioDev/TagStudio/issues/210
Solution
Implemented suggested solutions for linux and windows from https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html#launching-external-programs-from-the-frozen-application. Doesn't really seem like a solution for MacOS is necessary based on the docs.
Renamed and slightly reworked promptless_Popen into silent_Popen (better name, and congruent with the actual file name) so future features can take advantage of the same solution.
Tested on linux and briefly on windows (but could not figure out a way of getting hold of an outdated dll). At least it shouldn't be worse.