kivy / kivy

Open source UI framework written in Python, running on Windows, Linux, macOS, Android and iOS
https://kivy.org
MIT License
17k stars 3.04k forks source link

Pyinstaller package required `LD_PRELOAD` to start on Linux #8707

Open ikus060 opened 3 weeks ago

ikus060 commented 3 weeks ago

Software Versions

Describe the bug

After packaging the application using Pyinstaller, the application required the following environment variable to get started: export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6. Otherwise, the application fail to start with this error.

Window: Provider: sdl2
MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: iris
MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: iris
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  135
  Current serial number in output stream:  136

I'm building the binary on Debian Buster and I'm trying to run it on Ubuntu Jammy.

Expected behavior When packaging kivy application with pyinstaller, I'm expecting the application to run without any explicit environment variable.

To Reproduce The source code and the binaries are all available: Source: https://gitlab.com/ikus-soft/minarca

Deb Binary: https://nexus.ikus-soft.com/service/rest/v1/search/assets/download?name=minarca-client&repository=apt-dev-bullseye&sort=version&direction=desc&version=*.?b?

Code and Logs and screenshots N/A

Additional context This problem seams to have been reported in the past and it kinda help me to find a workarround, but I would like to get more details about the actual issue and possibly a way to get is fixed properly, either in Kivy source code or my packaging code.

Take note, the source code is running without error or problem on Ubuntu Jammy. It's seams likely a problem with binaries dependencies or something similar.

Thanks for helping !

ikus060 commented 2 weeks ago

It seams possible to fix the issue by simply not distributing the libstdc++.so.6. Is it something common to do ?