Qt (python) snap crashes on load or save with apparmor denials

Okay. It looks like using the binary PySide2 wheel from pypi will not work with the Qt 5 libraries from the kde-neon extension. I’m kind of surprised that PySide would be expecting Qt to provide that particular symbol:

$ echo _ZdlPvm | c++filt
operator delete(void*, unsigned long)

On modern Linux systems (at least as far back as Ubuntu 16.04), that symbol is provided by libstdc++ so a Qt built in that environment won’t include it. As the Qt included with PySide2 exports it with the “Qt_5” symbol version though, the Python extension won’t use the version provided by libstdc++.

Realistically, there are two options here:

  1. Stop using the kde-neon extension and depend entirely on the Qt distributed with the PyPI version of PySide2. This would mean redoing all the integration work the extension handles for you.

  2. Use a version of PySide2 compiled against Ubuntu 18.04’s Qt binaries.

For (2), that probably means building PySide2 from source as a second part in your Snapcraft recipe, since there are no deb packages of PySide2 in the 18.04 repository that you could reference via stage-packages. It is in the 20.04 repository, but the kde-neon extension does not yet support core20 snaps :frowning:

There are packages of PyQt5 in 18.04 though (as python3-pyqt5), which is mostly compatible with PySide2. Note that it comes under a different license though, so might not be appropriate on those grounds.

1 Like