Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 913096 - dev-python/pyside2-5.15.10 fails to build with clang-16 - qdragmoveevent_wrapper.cpp
Summary: dev-python/pyside2-5.15.10 fails to build with clang-16 - qdragmoveevent_wrap...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Nowa Ammerlaan
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-27 07:55 UTC by Scott Furry
Modified: 2023-09-04 08:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build_pyside2-5.15.10:20230827-072207.log,432.69 KB, text/x-log)
2023-08-27 07:56 UTC, Scott Furry
Details
output emerge --info (emerge_info.txt,8.32 KB, text/plain)
2023-08-27 07:56 UTC, Scott Furry
Details
output emerge -pqv (emerge_pqv.txt,354 bytes, text/plain)
2023-08-27 07:57 UTC, Scott Furry
Details
portage environment (portage_env.txt,139.97 KB, text/plain)
2023-08-27 07:57 UTC, Scott Furry
Details
build_log - no CC/CXX (pyside2-5.15.10:20230902-020518.log,197.18 KB, text/x-log)
2023-09-02 02:41 UTC, Scott Furry
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Furry 2023-08-27 07:55:22 UTC
After update to python-3.11.5, I performed a rebuild of packages dependent on python. Package dev-python/pyside2-5.15.10, built successfully on previous occassions, now consistently fails to build citing a failure in building `${S}/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.cpp`

Unable to downgrade python to confirm isolation of problem.

Python - 3.11.5
Clang/LLVM - 16.0.6
CMake - 3.26.5-r2
Ninja - 1.11.1-r2



Reproducible: Always




A search of Qt Bugs system did not reveal any relevant information.

A FreeBSD bug report (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270715) gave a similar problem output. However, suggested fix (patching qtgui/qtwidget header files - https://github.com/OpenMandrivaAssociation/qt5-qtbase/blob/master/qtbase-5.15.9-work-around-pyside2-brokenness.patch) did not correct situation.

Similar reporting was also found at LinuxQuestions thread (https://www.linuxquestions.org/questions/slackware-14/freecad-headaches-broken-pyside2-and-qt-needs-to-be-upgraded-to-qt6-4175727965/#post6447665). No viable workaround was given or had not been tried.

A search of https://repology.org/ for other distributions using pyside 5.15.10 and that might have patches to workaround issue found were unsuccessful.
Comment 1 Scott Furry 2023-08-27 07:56:14 UTC
Created attachment 868793 [details]
build log
Comment 2 Scott Furry 2023-08-27 07:56:42 UTC
Created attachment 868794 [details]
output emerge --info
Comment 3 Scott Furry 2023-08-27 07:57:08 UTC
Created attachment 868795 [details]
output emerge -pqv
Comment 4 Scott Furry 2023-08-27 07:57:27 UTC
Created attachment 868796 [details]
portage environment
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-27 09:45:32 UTC
FAILED: PySide2/QtGui/CMakeFiles/QtGui.dir/PySide2/QtGui/qdragmoveevent_wrapper.cpp.o 
/usr/bin/g++ -DPYSIDE_QML_SUPPORT=1 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQtGui_EXPORTS -I/var/tmp/portage/dev-python/pyside2-5.15.10/work/pyside-setup-opensource-src-5.15.10/sources/pyside2/PySide2/QtGui/QtGui -I/var/tmp/portage/dev-python/pyside2-5.15.10/work/pyside-setup-opensource-src-5.15.10/sources/pyside2/PySide2/QtGui -I/var/tmp/portage/dev-python/pyside2-5.15.10/work/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11/PySide2/QtGui -I/var/tmp/portage/dev-python/pyside2-5.15.10/work/pyside-setup-opensource-src-5.15.10/sources/pyside2/PySide2 -I/var/tmp/portage/dev-python/pyside2-5.15.10/work/pyside-setup-opensource-src-5.15.10/sources/pyside2/libpyside -I/var/tmp/portage/dev-python/pyside2-5.15.10/work/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11/PySide2/QtCore/PySide2/QtCore -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtGui -isystem /usr/include/shiboken2 -isystem /usr/include/python3.11  -march=bdver1 -O2 -pipe -Wall -fvisibility=hidden -Wno-strict-aliasing -std=gnu++11 -fPIC   -fPIC -fPIC -MD -MT PySide2/QtGui/CMakeFiles/QtGui.dir/PySide2/QtGui/qdragmoveevent_wrapper.cpp.o -MF PySide2/QtGui/CMakeFiles/QtGui.dir/PySide2/QtGui/qdragmoveevent_wrapper.cpp.o.d -o PySide2/QtGui/CMakeFiles/QtGui.dir/PySide2/QtGui/qdragmoveevent_wrapper.cpp.o -c /var/tmp/portage/dev-python/pyside2-5.15.10/work/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.cpp
In file included from /var/tmp/portage/dev-python/pyside2-5.15.10/work/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.cpp:63:
/var/tmp/portage/dev-python/pyside2-5.15.10/work/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.h:55:235: error: ‘DragMove’ is not a member of ‘QOpenGLShader’
   55 |     QDragMoveEventWrapper(const QPoint & pos, QFlags<Qt::DropAction> actions, const QMimeData * data, QFlags<Qt::MouseButton> buttons, QFlags<Qt::KeyboardModifier> modifiers, QFlags<QOpenGLShader::ShaderTypeBit> type = QOpenGLShader::DragMove);
      |                                                                                                                                                                                                                                           ^~~~~~~~
/var/tmp/portage/dev-python/pyside2-5.15.10/work/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.cpp: In constructor ‘QDragMoveEventWrapper::QDragMoveEventWrapper(const QPoint&, QFlags<Qt::DropAction>, const QMimeData*, QFlags<Qt::MouseButton>, QFlags<Qt::KeyboardModifier>, QFlags<QOpenGLShader::ShaderTypeBit>)’:
/var/tmp/portage/dev-python/pyside2-5.15.10/work/pyside-setup-opensource-src-5.15.10/sources/pyside2_build-python3_11/PySide2/QtGui/PySide2/QtGui/qdragmoveevent_wrapper.cpp:103:295: error: invalid user-defined conversion from ‘QFlags<QOpenGLShader::ShaderTypeBit>’ to ‘QEvent::Type’ [-fpermissive]
  103 |
Comment 6 Scott Furry 2023-08-27 10:27:08 UTC
Failed to notice package was being built using gcc, not clang.

GCC - 12.3.1_p20230526
Comment 7 Scott Furry 2023-08-27 13:04:13 UTC
Confirmed failure is persistent with both llvm/clang and g++.
Comment 8 Scott Furry 2023-08-31 10:27:40 UTC
Build error is referencing QOpenGLShader. Class is apart of dev-qt/qt3d.

Enabling pyside2 USE flag "3d", installing dev-qt/qt3d, and rebuilding did not change situation from original observations.
Comment 9 Nowa Ammerlaan gentoo-dev 2023-08-31 10:43:52 UTC
Could you try to rebuild shiboken2? This is always a good first step when pyside2 is not working as it should.

Also, pyside2 gets very upset when you try to build it with a different toolchain then shiboken2 was built with. Can you double check that the same toolchain is used for both packages?
Comment 10 Scott Furry 2023-08-31 11:00:42 UTC
(In reply to Andrew Ammerlaan from comment #9)
> Could you try to rebuild shiboken2? This is always a good first step when
> pyside2 is not working as it should.
> 
> Also, pyside2 gets very upset when you try to build it with a different
> toolchain then shiboken2 was built with. Can you double check that the same
> toolchain is used for both packages?

Effort to rebuild all qt with a single toolchain currently in progress.
News to follow...
Comment 11 Scott Furry 2023-09-01 05:53:28 UTC
After toolchain rebuild with llvm/clang 16, problem as originally reported persists.
Comment 12 Nowa Ammerlaan gentoo-dev 2023-09-01 07:45:19 UTC
(In reply to Scott Furry from comment #7)
> Confirmed failure is persistent with both llvm/clang and g++.

When you tried with clang, did you also recompile shiboken2 with clang? Can you also try without specifying the toolchain tools at all (i.e. unset CC, CXX, etc), this is the configuration that works for me. 

Pyside is extremely fragile and pyside2 is no longer maintained upstream, all development has moved to pyside6. So it is very difficult to get these issues fixed. If you have the option I recommend using PyQt5 instead, many (but not all) applications allow using either Qt4Python implementation.
Comment 13 Scott Furry 2023-09-01 07:50:34 UTC
(In reply to Andrew Ammerlaan from comment #12)
> (In reply to Scott Furry from comment #7)
> > Confirmed failure is persistent with both llvm/clang and g++.
> 
> When you tried with clang, did you also recompile shiboken2 with clang? Can
> you also try without specifying the toolchain tools at all (i.e. unset CC,
> CXX, etc), this is the configuration that works for me.

I have rebuilt all with both clang and gcc. There was no change to the output error reported.

> 
> Pyside is extremely fragile and pyside2 is no longer maintained upstream,
> all development has moved to pyside6. So it is very difficult to get these
> issues fixed. If you have the option I recommend using PyQt5 instead, many
> (but not all) applications allow using either Qt4Python implementation.

This is the first time I have had any issues in building pyside2. I thought the issue might be related to clang because of different build failure. Unable to confirm.

Qt6 - Everybody rushing to next latest thing. No surprise.

PyQt5 already installed.
Comment 14 Scott Furry 2023-09-02 02:41:47 UTC
Created attachment 869174 [details]
build_log - no CC/CXX
Comment 15 Scott Furry 2023-09-02 02:42:42 UTC
Not specifying CC/CXX leads to other issues.
Shiboken will use whatever compiler is first available (normally GCC). However, pyside will attempt to use Clang. End result is aborted build due to...

---
/usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/cstddef:50:10: fatal: 'stddef.h' file not found
---
(see latest "build_log" attachment)

Setting shiboken to use Clang (via /etc/package.env) and rebuilding both results in the original problem as reported.

This issue didn't exist prior to an upgrade of python-3.11.4 to 3.11.5. Something is broken here. Other distributions have encountered similar situations but in previous versions of pyside2 (5.15.9 or earlier). No clear understanding of problems have been found. A workaround to unclear problems is not possible. My suspicion is that this issue will not be fixed because it relates to Qt 5.15 branch.
Comment 16 Scott Furry 2023-09-02 04:35:38 UTC
Escalating situation.
https://bugreports.qt.io/browse/PYSIDE-2451
Comment 17 Scott Furry 2023-09-04 07:28:04 UTC
Answer from Qt:
----
This is an issue caused by clang 16. Also, 5.15.10 only supports Python 3.10.

5.15 standard LTS has expired, though; it will not be adapted to newer versions any more (see https://lists.qt-project.org/pipermail/announce/2023-May/000416.html ).
----

In short, Pyside2 is nearing death. Bereft of updates.("...beautiful plumage the Norwegian Blue...").

Gentoo is reporting that Qt6/Pyside6 has not yet reached normalization. The Qt announcement regarding Qt5 may encourage matters.
Comment 18 Nowa Ammerlaan gentoo-dev 2023-09-04 07:56:50 UTC
(In reply to Scott Furry from comment #17)
> Answer from Qt:
> ----
> This is an issue caused by clang 16. Also, 5.15.10 only supports Python 3.10.
> 
> 5.15 standard LTS has expired, though; it will not be adapted to newer
> versions any more (see
> https://lists.qt-project.org/pipermail/announce/2023-May/000416.html ).
> ----

Shiboken2 should already be pulling in clang-15. We have a patch for python3.11 compatibility.

> In short, Pyside2 is nearing death. Bereft of updates.("...beautiful plumage
> the Norwegian Blue...").
> 
> Gentoo is reporting that Qt6/Pyside6 has not yet reached normalization. The
> Qt announcement regarding Qt5 may encourage matters.

What exactly is it on your system that is pulling in pyside2? Maybe it is more worthwhile to look into switching this application to pyside6.
Comment 19 Scott Furry 2023-09-04 08:20:51 UTC
And having shiboken2 using python-3.11 is wonderful. However, it is clang-16 that is also a problem for me. Downgrading toolset is not advantageous.

Given the software version limits encountered, I will have to reconsider approaches in a piece of software I am maintaining that uses Pyside2.

FWIW, I'm having an informative conversation with the folks at Qt in the bug thread above regarding python/llvm/Qt. Seems the migration to latest/greatest is not going exactly "smoothly".

A link to a rather handy "compatibility-matrix" for Pyside was provided (https://wiki.qt.io/Qt_for_Python#Python_compatibility_matrix).

I'm hopeful they'll shake the bugs out, preferably in an environmentally friendly manner(sans chemicals with minimal carbon-footprint).