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

Bump Python dependencies #482

Closed
apyrgio opened this issue Jul 24, 2023 · 4 comments · Fixed by #483
Closed

Bump Python dependencies #482

apyrgio opened this issue Jul 24, 2023 · 4 comments · Fixed by #483
Labels
development Development-focused changes enhancement New feature or request
Milestone

Comments

@apyrgio
Copy link
Contributor

apyrgio commented Jul 24, 2023

Prior to releasing 0.4.2, we need to bump our Python dependencies with poetry lock.

@apyrgio apyrgio added enhancement New feature or request development Development-focused changes labels Jul 24, 2023
@apyrgio apyrgio added this to the 0.4.2 milestone Jul 24, 2023
@apyrgio
Copy link
Contributor Author

apyrgio commented Jul 24, 2023

Running the Dangerzone GUI with the new dependencies returns the following error:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: minimal, vkkhrdisplay, linuxfb, offscreen, xcb, eglfs, wayland-egl, minimalegl, wayland, vnc.

Aborted (core dumped)

With QT_DEBUG_PLUGINS=1, we see:

qt.core.library: "/home/user/.cache/pypoetry/virtualenvs/dangerzone-c6p5PSyD-py3.11/lib64/python3.11/site-packages/PySide6/Qt/plugins/platforms/libqxcb.so" cannot load: Cannot load library /home/user/.cache/pypoetry/virtualenvs/dangerzone-c6p5PSyD-py3.11/lib64/python3.11/site-packages/PySide6/Qt/plugins/platforms/libqxcb.so: (libxcb-cursor.so.0: cannot open shared object file: No such file or directory)                                                                      
qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "/home/user/.cache/pypoetry/virtualenvs/dangerzone-c6p5PSyD-py3.11/lib64/python3.11/site-packages/PySide6/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/user/.cache/pypoetry/virtualenvs/dangerzone-c6p5PSyD-py3.11/lib64/python3.11/site-packages/PySide6/Qt/plugins/platforms/libqxcb.so: (libxcb-cursor.so.0: cannot open shared object file: No such file or directory)" 

It seems that the xcb-util-cursor package is required by PySide6, and is missing. Looking more into who are the dependents on this package we find that in Fedora systems, it's qt6-qtbase-gui.

Turns out that in our development machines and CI runners, we have qt5-qtbase-gui installed. This is an artifact from when we predominantly had PySide2 support. Now, the only place where we have PySide2 support is in Fedora/Debian packages. Even our development machines use PySide6.

This requirement by PySide6 and the omission of this package from Qt5 possibly means that from now on, PySide6 is no longer compatible with Qt5, unless the Qt devs consider this bug report as a regression.

@apyrgio
Copy link
Contributor Author

apyrgio commented Jul 24, 2023

Our solution to this issue is to migrate our CI runners and development environments to Qt6. This means that we will replace:

  • libqt5gui5 with libqt6gui6 in Debian-based platforms, and
  • qt5-qtbase-gui with qt6-qtbase-gui in Fedora platforms.

This brings us even more closer to full Qt6 / PySide6 support in all platforms (see #211).

Note that there are some caveats:

  • On Ubuntu Focal, there is no Qt6. We still need to use Qt5.
  • On Debian Bullseye, the Qt6 library misses a dependency to libgl1.

apyrgio added a commit that referenced this issue Jul 24, 2023
Upgrade from Qt5 to Qt6 in our CI runners and dev environments, since
the latest PySide6 versions do not support Qt5. This leaves only our
Debian / Fedora packages relying on Qt5, since there's no PySide6
package for them yet.

There are two caveats to the Qt6 upgrade:

1. Debian Bullseye has a missing dependency to `libgl1`, so we need to
   install it separately.
2. Ubuntu Focal does not have Qt6, but surprisingly PySide6 works with
   Qt5.

As a side effect, we have to make our `env.py` a bit more complicated,
to cater to these exceptions.

Refs #482
apyrgio added a commit that referenced this issue Jul 24, 2023
Run `poetry lock` and update the existing dependencies.

Closes #482
Refs #480
apyrgio added a commit that referenced this issue Jul 24, 2023
Upgrade from Qt5 to Qt6 in our CI runners and dev environments, since
the latest PySide6 versions do not support Qt5. This leaves only our
Debian / Fedora packages relying on Qt5, since there's no PySide6
package for them yet.

There are two caveats to the Qt6 upgrade:

1. Debian Bullseye has a missing dependency to `libgl1`, so we need to
   install it separately.
2. Ubuntu Focal does not have Qt6, but surprisingly PySide6 works with
   Qt5.

As a side effect, we have to make our `env.py` a bit more complicated,
to cater to these exceptions.

Refs #482
apyrgio added a commit that referenced this issue Jul 24, 2023
Run `poetry lock` and update the existing dependencies.

Closes #482
Refs #480
@apyrgio
Copy link
Contributor Author

apyrgio commented Jul 25, 2023

Note that in Debian-based systems, libxcb-cursor0 is not installed via any Qt library:

$ apt-cache rdepends libxcb-cursor0
libxcb-cursor0
Reverse Depends:
  libxcb-cursor-dev
  yambar
  rofi
  polybar
  awesome
  kwin-common
  kde-spectacle
  i3-wm

This means that we need to install it explicitly in our development environments.

@apyrgio
Copy link
Contributor Author

apyrgio commented Jul 25, 2023

On Ubuntu Jammy, PySide6 requires libxkbcommon-x11.so.0:

qt.core.library: "/home/user/.cache/pypoetry/virtualenvs/dangerzone-hQU0mwlP-py3.10/lib/python3.10/site-packages/PySide6/Qt/plugins/platforms/libqxcb.so" cannot load: Cannot load library /home/user/.cache/pypoetry/virtualenvs/dangerzone-h
QU0mwlP-py3.10/lib/python3.10/site-packages/PySide6/Qt/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)
qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "/home/user/.cache/pypoetry/virtualenvs/dangerzone-hQU0mwlP-py3.10/lib/python3.10/site-packages/PySide6/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/user/.cache
/pypoetry/virtualenvs/dangerzone-hQU0mwlP-py3.10/lib/python3.10/site-packages/PySide6/Qt/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)"

We can install it directly via the libxkbcommon-x11-0 package, but it's also available indirectly via the following packages:

$ apt-cache rdepends libxkbcommon-x11-0
libxkbcommon-x11-0
Reverse Depends:
  libxkbcommon-x11-dev
  qt6-qpa-plugins
  libqt5gui5
  kitty
  libmutter-10-0
  nsight-systems
  nsight-compute
  rofi
  qt6-qpa-plugins
  mir-platform-graphics-x19
  lxqt-panel
  libxkbcommon-tools
  libukwm-1-0
  libqt5gui5-gles
  libqt5gui5
  libevas1-engines-wayland
  kitty
  imv
  i3lock
  i3-wm
  fcitx5-module-xorg
  awesome
  libmutter-10-0

It's probably best to install it via qt6-qpa-plugins.

apyrgio added a commit that referenced this issue Jul 25, 2023
Upgrade from Qt5 to Qt6 in our CI runners and dev environments, since
the latest PySide6 versions do not support Qt5. This leaves only our
Debian / Fedora packages relying on Qt5, since there's no PySide6
package for them yet.

There are some caveats to the Qt6 upgrade:

1. Debian Bullseye has a missing dependency to `libgl1`, so we need to
   install it separately.
2. Ubuntu Jammy has a missing dependency to `libxkbcommon-x11-0`, which
   we have to install separately.
3. Ubuntu Focal does not have Qt6, but surprisingly PySide6 works with
   Qt5.
4. All Debian-based distros require `libxcb-cursor0`.

As a side effect, we have to make our `env.py` a bit more complicated,
to cater to these exceptions.

Refs #482
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Development-focused changes enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant