Page MenuHomeSolus

Qt for Python
Closed, ResolvedPublic

Description

Name: python-pyside2
Homepage: https://www.qt.io/qt-for-python
Why should this be included in the repository: It's required to deprecate some Python2/Qt4 packages or to update some packages (T7700)
Is it Open Source: Yes

  • BSD-3-clause # examples
  • GFDL-1.3-only # documentation
  • GPL-2.0-only WITH Qt-GPL-exception-1.0
  • LGPL-3.0-only

Who and how many users do you anticipate will use this software: 1+
Link to source tarball: https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.13.0-src/pyside-setup-everywhere-src-5.13.0.tar.xz

Revisions and Commits

Event Timeline

DataDrake triaged this task as Normal priority.
DataDrake moved this task from Backlog to Accepted For Inclusion on the Package Requests board.

I need this to go further with some packages deprecation but for some reason I couldn't get this to build.
I can share the package.yml with whoever claims this task though.

I could probably manage to maintain this, but I am unfamiliar with the setup. Are there any similar packages already packaged for Solus that can be used as a reference?

Sorry for sending multiple messages here!

I gave it a go but I am also having some issues. For what I can understand, qmake is required during build. I tried to put qt5-base under rundeps but perhaps this command is from qt5-base-devel?

Anyway, the build instructions for pyside2 suggests this for building.

python setup.py build --qmake=/opt/Qt/5.14.0/gcc_64/bin/qmake --build-tests --ignore-git --parallel=8

How would I be able to get the path for the qmake binary?

@vilhelm

Package qt5-base-devel has file /usr/bin/qmake

And it would have to be a builddep, not a rundep. Add pkgconfig(Qt5Core) to the build deps.

Since this was opened, 5.14.2.1 has been released

Qt for Python should be synced with Qt libraries that we ship, so for now you should build latest 5.13.x release. Mixing different versions of PySide and other Qt libs is not supported and can lead to compilation or runtime issues.

And it would have to be a builddep, not a rundep. Add pkgconfig(Qt5Core) to the build deps.

That is redundant since Qt for Python already depends on multiple Qt5 libraries, which in turn depend on qt5-base-devel. Thus /usr/bin/qmake should be present in any build environment where a least one Qt5 library is used.

The last time I tried building this I encountered issue where freshly built shiboken2 couldn't generate Python bindings for any Qt library, and thus the build failed. Unfortunately, I couldn't find the cause of the issue. I got warnings like:

qt.shiboken: (core) writeMinimalConstructorExpression: Couldn't find a minimal constructor for type 'QByteArray'. This will result in a compilation error.

And later it fails because compiler can't find specific C++ source file, which shiboken should have created (if I understand the issue correctly):

error: PySide2/QtCore/PySide2/QtCore/qabstractnativeeventfilter_wrapper.cpp: No such file or directory

Since this was opened, 5.14.2.1 has been released

Qt for Python should be synced with Qt libraries that we ship, so for now you should build latest 5.13.x release. Mixing different versions of PySide and other Qt libs is not supported and can lead to compilation or runtime issues.

Ah, so it should be 5.13.2 then (http://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.13.2-src/pyside-setup-opensource-src-5.13.2.tar.xz).

Okay, so I have made som adjustments and my builddeps now look like this.

builddeps:
    - python3-devel
    - pkgconfig(Qt5Core)

As @aleksvor mentioned, the pkgconfig(Qt5Core) should be able to be any Qt5 library but I am unsure which to choose (this doesn't seem to be the problem). First I had some issues where it couldn't find CLANG so I just enabled clang with clang : yes.

I am now getting this error.

[ 94%] Linking CXX executable shiboken2
ld.lld: error: undefined symbol: DocParser::skipForQuery(AbstractMetaFunction const*)
>>> referenced by qtdocgenerator.cpp:70 (/home/build/YPKG/root/python-pyside2/build/py3build/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp:70)
>>>               CMakeFiles/shiboken2.dir/qtdoc/qtdocgenerator.cpp.o:(shouldSkip(AbstractMetaFunction const*))

ld.lld: error: undefined symbol: DocParser::DocParser()
>>> referenced by qtdocparser.h:37 (/home/build/YPKG/root/python-pyside2/build/py3build/sources/shiboken2/ApiExtractor/qtdocparser.h:37)
>>>               CMakeFiles/shiboken2.dir/qtdoc/qtdocgenerator.cpp.o:(QtDocGenerator::doSetup())
>>> referenced by doxygenparser.h:37 (/home/build/YPKG/root/python-pyside2/build/py3build/sources/shiboken2/ApiExtractor/doxygenparser.h:37)
>>>               CMakeFiles/shiboken2.dir/qtdoc/qtdocgenerator.cpp.o:(QtDocGenerator::handleOption(QString const&, QString const&))

ld.lld: error: undefined symbol: vtable for QtDocParser
>>> referenced by qtdocparser.h:37 (/home/build/YPKG/root/python-pyside2/build/py3build/sources/shiboken2/ApiExtractor/qtdocparser.h:37)
>>>               CMakeFiles/shiboken2.dir/qtdoc/qtdocgenerator.cpp.o:(QtDocGenerator::doSetup())
the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)

ld.lld: error: undefined symbol: vtable for DoxygenParser
>>> referenced by doxygenparser.h:37 (/home/build/YPKG/root/python-pyside2/build/py3build/sources/shiboken2/ApiExtractor/doxygenparser.h:37)
>>>               CMakeFiles/shiboken2.dir/qtdoc/qtdocgenerator.cpp.o:(QtDocGenerator::handleOption(QString const&, QString const&))
the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [generator/CMakeFiles/shiboken2.dir/build.make:197: generator/shiboken2] Error 1
make[1]: *** [CMakeFiles/Makefile2:330: generator/CMakeFiles/shiboken2.dir/all] Error 2
make: *** [Makefile:150: all] Error 2
error: Error compiling shiboken2
Traceback (most recent call last):
  File "setup.py", line 296, in <module>
    setup_runner.run_setup()
  File "/home/build/YPKG/root/python-pyside2/build/py3build/build_scripts/setup_runner.py", line 157, in run_setup
    raise RuntimeError(msg)
RuntimeError: 
setup.py invocation failed with exit code: 1.


setup.py invocation was: /usr/bin/python3 setup.py build --internal-build-type=shiboken2

+ exit
Command '['/bin/bash', '--norc', '--noprofile', '/tmp/ypkg-setuppEeWqz']' returned non-zero exit status 1
[Build] setup failed
ERRO[13:36:07] Failed to build package                       error="exit status 1"
ERRO[13:36:10] Failed to build packages                     
make[1]: Leaving directory '/home/vilhelm/code/python-pyside2'
make abireport
make[1]: Entering directory '/home/vilhelm/code/python-pyside2'
abireport -p abi_ -D `dirname package.yml` scan-packages `dirname package.yml`
error locating packages: No packages in directory .
make[1]: *** [../Makefile.common:15: abireport] Error 1
make[1]: Leaving directory '/home/vilhelm/code/python-pyside2'
make: *** [../Makefile.common:12: complete] Error 2

Am I missing something obvious?

Have you added doxygen as a builddep?

@jwinnie I added it and now I am getting this error.

ld.lld: error: undefined symbol: DocParser::skipForQuery(AbstractMetaFunction const*)
>>> referenced by qtdocgenerator.cpp:70 (/home/build/YPKG/root/python-pyside2/build/py3build/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp:70)
>>>               CMakeFiles/shiboken2.dir/qtdoc/qtdocgenerator.cpp.o:(shouldSkip(AbstractMetaFunction const*))

ld.lld: error: undefined symbol: DocParser::DocParser()
>>> referenced by qtdocparser.h:37 (/home/build/YPKG/root/python-pyside2/build/py3build/sources/shiboken2/ApiExtractor/qtdocparser.h:37)
>>>               CMakeFiles/shiboken2.dir/qtdoc/qtdocgenerator.cpp.o:(QtDocGenerator::doSetup())
>>> referenced by doxygenparser.h:37 (/home/build/YPKG/root/python-pyside2/build/py3build/sources/shiboken2/ApiExtractor/doxygenparser.h:37)
>>>               CMakeFiles/shiboken2.dir/qtdoc/qtdocgenerator.cpp.o:(QtDocGenerator::handleOption(QString const&, QString const&))

ld.lld: error: undefined symbol: vtable for QtDocParser
>>> referenced by qtdocparser.h:37 (/home/build/YPKG/root/python-pyside2/build/py3build/sources/shiboken2/ApiExtractor/qtdocparser.h:37)
>>>               CMakeFiles/shiboken2.dir/qtdoc/qtdocgenerator.cpp.o:(QtDocGenerator::doSetup())
the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)

ld.lld: error: undefined symbol: vtable for DoxygenParser
>>> referenced by doxygenparser.h:37 (/home/build/YPKG/root/python-pyside2/build/py3build/sources/shiboken2/ApiExtractor/doxygenparser.h:37)
>>>               CMakeFiles/shiboken2.dir/qtdoc/qtdocgenerator.cpp.o:(QtDocGenerator::handleOption(QString const&, QString const&))
the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [generator/CMakeFiles/shiboken2.dir/build.make:197: generator/shiboken2] Error 1
make[1]: *** [CMakeFiles/Makefile2:330: generator/CMakeFiles/shiboken2.dir/all] Error 2
make: *** [Makefile:150: all] Error 2
error: Error compiling shiboken2
Traceback (most recent call last):
  File "setup.py", line 296, in <module>
    setup_runner.run_setup()
  File "/home/build/YPKG/root/python-pyside2/build/py3build/build_scripts/setup_runner.py", line 157, in run_setup
    raise RuntimeError(msg)
RuntimeError: 
setup.py invocation failed with exit code: 1.


setup.py invocation was: /usr/bin/python3 setup.py build --internal-build-type=shiboken2

+ exit
Command '['/bin/bash', '--norc', '--noprofile', '/tmp/ypkg-setupuWF0d0']' returned non-zero exit status 1
[Build] setup failed
ERRO[13:34:05] Failed to build package                       error="exit status 1"
ERRO[13:34:07] Failed to build packages                     
make[1]: Leaving directory '/home/vilhelm/code/python-pyside2'
make abireport
make[1]: Entering directory '/home/vilhelm/code/python-pyside2'
abireport -p abi_ -D `dirname package.yml` scan-packages `dirname package.yml`
error locating packages: No packages in directory .
make[1]: *** [../Makefile.common:15: abireport] Error 1
make[1]: Leaving directory '/home/vilhelm/code/python-pyside2'
make: *** [../Makefile.common:12: complete] Error 2

@vilhelm can you share your current package.yml file?

@algent This is my package.yml so far.

name       : python-pyside2
version    : 5.13.2
release    : 1
clang      : yes
source     :
    - http://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.13.2-src/pyside-setup-opensource-src-5.13.2.tar.xz : 3e255d64df08880d0281ebe86009d5ea45f24332b308954d967c33995f75e543
license    :
    - LGPL-3.0-only
    - GPL-2.0-only
component  : programming.python
summary    : Python bindings for the Qt cross-platform application and UI framework
description: |
    Python bindings for the Qt cross-platform application and UI framework
builddeps:
    - python3-devel
    - pkgconfig(Qt5Core)
    - doxygen
setup      : |
    %python3_setup
install    : |
    %python3_install

You could probably move from python3-devel to pkgconfig(python3). But yeah, as @algent mentioned above, it looks like your issues are from missing shiboken2. We seem to have a shiboken package in the repository but I don't think that it is the correct one.

EDIT: Looks like the tarballs for shiboken2 can be found here with the other PySide2 downloads.

@Jacalz So shiboken2 package needs to be in the Solus repository before this package can be implemented?

I thought that it was a separate package but I see now that python-pyside2 and shiboken2 have same source. If the build succeed they should be split in patterns.

they should be split in patterns.

Why? If it's just for discoverability that can be resolved with the package description. Let's not split packages for the sake of splitting packages please.

I tried to package this. There are needed two new dependencies:

qt5-datavis3d with this package.yml
qt5-remoteobjects with this package.yml

So far edited python-pyside2 to this package.yml

The build still fails. This is the the output on my terminal. Don't have any idea what to do next.

EDIT: qt5-datavis3d was just added by Girtablulu.

These dependencies aren't necessary - basically, we need only those Qt libs for which we want to have Python bindings. So we need only those libraries that are used by PySide2 revdeps.

As I see, for now we only need PySide2 for Syncplay update and Natron (for future releases with full Qt5 support), also I plan to use it in Cutter. We should derermine what Qt bindings we need for them and don't bloat the package unnecessarily.

@algent, and it seems that it's the same issue I'm facing now. Still have no idea why these warnings are occurring.

Just want to add that PySide2 would also be required to build FreeCAD T208

@palto42 And? It's accepted, somebody just needs to put the work in.

I hate that this works as much as it does, but it looks like I got us a lot closer to a working build.