Fix crash on Ubuntu while selecting File Chooser #7484
Merged
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.
Summary of the issue:
The issue was related to
GdkPixbuf
internally required by PyQt5 File chooser on Linux. Turns out PyInstaller did not import required internal gtk libs within the build bundle. For the binaries built on the same distribution, the executable was able to find the required libs from the system but not on different distros.A solution is presented on this PR. Here I add
PyGObject
as a build dependency for Linux which provides GTK libs for python, then addgi
andgi.repository
as hidden imports. These hidden imports make sure thatGdkPixbuf
is accessible and that PyQt Filechooser can work without a crash.I have tested the build with these fixes on Ubuntu 20.04 and 22.04 and can confirm to work.
Here is a build to test.
https://jenkins-ci.tribler.org/job/Build-Tribler_release/job/Build-Ubuntu64/653/