Skip to content
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 crash on Ubuntu while selecting File Chooser #7484

Merged
merged 3 commits into from
Jun 13, 2023

Conversation

xoriole
Copy link
Contributor

@xoriole xoriole commented Jun 12, 2023

Summary of the issue:

  1. The binary built on Ubuntu 20.04 works on 20.04 but not Ubuntu 22.04 (and higher likely, not tested)
  2. The binary built on Ubuntu 22.04 works on 22.04 but not lower.

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 add gi and gi.repository as hidden imports. These hidden imports make sure that GdkPixbuf 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/

Add hidden import of gi and GdkPixbuf
@xoriole xoriole marked this pull request as ready for review June 13, 2023 09:49
@xoriole xoriole requested review from a team and drew2a and removed request for a team June 13, 2023 09:49
Copy link
Contributor

@drew2a drew2a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@xoriole xoriole requested a review from drew2a June 13, 2023 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants