fix: restore environment before launching external programs#707
Merged
CyanVoxel merged 5 commits intoTagStudioDev:mainfrom Jan 24, 2025
Merged
fix: restore environment before launching external programs#707CyanVoxel merged 5 commits intoTagStudioDev:mainfrom
CyanVoxel merged 5 commits intoTagStudioDev:mainfrom
Conversation
e7b8790 to
5965872
Compare
5965872 to
bff3b07
Compare
Computerdores
approved these changes
Jan 19, 2025
Collaborator
Computerdores
left a comment
There was a problem hiding this comment.
Don't really have a way to test this, but it seems to follow the documentation well and I see no other issues.
Member
|
PyInstaller builds tested and working on Windows 10 22H2 (Normal + Portable) and macOS 15 👍 |
|
PyInstaller build tested and working on Ubuntu 24.04.1 👍 |
Member
|
Thank you so much for this fix! And thank you to everyone who helped test! 🎉 |
This was referenced Aug 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.