Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 646504

Summary: dev-qt/qtcore-5.9.4: breakage from change in QT_NO_WIDGETS after update
Product: Gentoo Linux Reporter: Holger Hoffstätte <holger>
Component: Current packagesAssignee: Qt Bug Alias <qt>
Status: RESOLVED FIXED    
Severity: normal CC: ale, arthur, asturm, esigra, extraconan1, jouni.kosonen, mgmadden, nickAristocrates, orzel, phantom4, public+gentoo, rauchwolke, rion4ik, rnddim, soprwa, toralf, venerix, zeekec
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: A tiny change to the QtCore and QtWidgets ebuilds to correct the QT_NO_WIDGETS-related problems

Description Holger Hoffstätte 2018-02-03 19:01:06 UTC
Apologies in advance for the longwinded description, but this is a mess so I wanted to be as detailed as possible.

I updated my ~amd64 system from qt-5.9.3 to 5.9.4 and noticed that psi (a Jabber client) no longer starts with:

psi: relocation error: psi: symbol _ZTV16QGraphicsSvgItem, version Qt_5 not defined in file libQt5Svg.so.5 with link time reference

So I decided to rebuild psi (with +whiteboarding, which uses QtSvg) and got build failures related to undefined classes that are clearly part of QtSvg, properly included etc. After slogging through an endless morass of cmake, headers and defines I traced this to include guards in QtSvg which prevented definition of required classes due to a changed value of QT_NO_WIDGETS (from false to true after the update).

In the end I managed to rebuld psi with -whiteboarding and verfied that is doesn't pull in QtSvg, but nevertheless this should have worked. I suspect the change in default value breaks other things as well down the line.


Reproducible: Always

Steps to Reproduce:
1. update to qt-5.9.4
2. build psi with +whiteboarding
3. fail
Actual Results:  
Build failure in psi due to lack of defined QtSvg classes

Expected Results:  
Should have built successfully.

I realize this is a bit convoluted and at first wanted to post it as "psi build failure", but it's clearly a Qt problem. I *think* the changed value for QT_NO_WIDGETS stems from the recent changes in qt5-build.eclass (probably 	74d8dc2351) but have NO idea what's supposed to happen there.
Comment 1 Sergey Ilinykh 2018-02-04 06:26:17 UTC
Just tried to compile QtCreator-4.5.0. Same error.

# grep QT_NO_WIDGETS -r /usr/include/qt5
/usr/include/qt5/QtCore/qconfig.h:#define QT_NO_WIDGETS true
/usr/include/qt5/QtSvg/qgraphicssvgitem.h:#if !defined(QT_NO_GRAPHICSVIEW) && !defined(QT_NO_WIDGETS)


imageviewerfile.cpp:109:54: error: invalid use of incomplete type ‘class QGraphicsSvgItem’
Comment 2 Sergey Ilinykh 2018-02-04 07:50:10 UTC
after commenting out "#define QT_NO_WIDGETS true" (and just in case rebuilding some qt gui libs) I was able to build net-im/psi and QtCreator-4.5.0.
Comment 3 Andreas Sturmlechner gentoo-dev 2018-02-04 12:16:00 UTC
*** Bug 646574 has been marked as a duplicate of this bug. ***
Comment 4 Herbert Wantesh 2018-02-04 19:26:46 UTC
(In reply to Rion from comment #2)
> after commenting out "#define QT_NO_WIDGETS true" (and just in case
> rebuilding some qt gui libs) I was able to build net-im/psi and
> QtCreator-4.5.0.

same for me, it worked after rebuilding all qt related libs
Comment 5 Dave 2018-02-04 22:20:25 UTC
Workaround of commenting out the #define and rebuilding effected libraries works for me as well... My problem was with kde-frameworks/kjsembed-5.42.0 not finding QSvgWidget
Comment 6 Andreas Sturmlechner gentoo-dev 2018-02-04 22:31:25 UTC
*** Bug 646612 has been marked as a duplicate of this bug. ***
Comment 7 Jouni Kosonen 2018-02-05 05:51:38 UTC
This also breaks building PyQt5-5.9.2[svg] as none of the QSvgWidget classes end up being defined.

> /var/tmp/portage/dev-python/PyQt5-5.9.2/work/PyQt5_gpl-5.9.2-python2_7/QtSvg/sipQtSvgQSvgWidget.cpp:237:1: error: expected class-name before ‘{’ token
>  {
>  ^
> /var/tmp/portage/dev-python/PyQt5-5.9.2/work/PyQt5_gpl-5.9.2-python2_7/QtSvg/sipQtSvgQSvgWidget.cpp: In constructor ‘sipQSvgWidget::sipQSvgWidget(QWidget*)’:
Comment 8 Uladzimir Bely 2018-02-05 13:03:50 UTC
I can confirm the issue. In my case net-wireless/gqrx didn't compile until I removed #define QT_NO_WIDGETS true from the qconfig.h.
Comment 9 Arfrever Frehtes Taifersar Arahesis 2018-02-05 18:59:41 UTC
*** Bug 646700 has been marked as a duplicate of this bug. ***
Comment 10 Thomas Mori 2018-02-05 21:20:56 UTC
After commenting "#define QT_NO_WIDGETS true" in the file qconfig.h , I find that kde-frameworks/kjsembed doesn't compile. It errors out with the following:

CMakeFiles/KF5JsEmbed.dir/svg_binding.cpp.o: In function `KJSEmbed::SvgWidget::bindMethod(KJS::ExecState*, KJSEmbed::PointerBase&)':
svg_binding.cpp:(.text+0xef): undefined reference to `QSvgWidget::staticMetaObject'
CMakeFiles/KF5JsEmbed.dir/svg_binding.cpp.o: In function `SvgWidgetNS::renderer(KJS::ExecState*, KJS::JSObject*, KJS::List const&)':
svg_binding.cpp:(.text+0x432): undefined reference to `QSvgWidget::staticMetaObject'
svg_binding.cpp:(.text+0x444): undefined reference to `QSvgWidget::renderer() const'
CMakeFiles/KF5JsEmbed.dir/svg_binding.cpp.o: In function `KJSEmbed::SvgWidget::ctorMethod(KJS::ExecState*, KJS::List const&)':
svg_binding.cpp:(.text+0x1083): undefined reference to `QSvgWidget::QSvgWidget(QWidget*)'
svg_binding.cpp:(.text+0x10ed): undefined reference to `QSvgWidget::QSvgWidget(QWidget*)'
svg_binding.cpp:(.text+0x1172): undefined reference to `QSvgWidget::QSvgWidget(QString const&, QWidget*)'
collect2: error: ld returned 1 exit status
Comment 11 Psi 2018-02-06 02:28:18 UTC
(In reply to Thomas Mori from comment #10)
> After commenting "#define QT_NO_WIDGETS true" in the file qconfig.h , I find
> that kde-frameworks/kjsembed doesn't compile. It errors out with the
> following:

Thomas, if you manually comment that out, you need to rebuild dev-qt/qtsvg to make it work.  Just do as the others have done.


Another dirty workaround is to comment out the line which caused this in qt5-build.eclass:

$([[ ${QT5_MINOR_VERSION} -ge 9 ]] && echo -no-gui -no-widgets)

Then rebuild (minimum) dev-qt/qtcore and dev-qt/qtsvg.  I usually prefer to rebuild all dev-qt/* packages when messing about in QtCore.
Comment 12 Psi 2018-02-06 03:34:23 UTC
Created attachment 518042 [details, diff]
A tiny change to the QtCore and QtWidgets ebuilds to correct the QT_NO_WIDGETS-related problems

This patch to qtcore-5.9.4.ebuild and qtwidgets-5.9.4.ebuild adds a single item to each that makes the QT_NO_WIDGETS problem go away.  It does this *while preserving* the original intent of the Qt base splitting in qt5-build.eclass.  The ebuild changes in the patch simply add one more macro when QtWidgets registers itself on installation.  This should be all that's needed for a -r release to fix this bug without having to revisit the eclass.

If anyone decides to try out these little updates to the ebuilds, remember to rebuild (at *minimum*) dev-qt/qtcore, dev-qt/qtwidgets, and dev-qt/qtsvg.  Doing that resolved the problem for me (and now I get to rebuild the rest of Qt, yay).  Note that you *will* still see a QT_NO_WIDGETS line in qconfig.h, but there will be an "#undef QT_NO_WIDGETS" further down in the file due to the logic in QtCore's ebuild.
Comment 13 Andreas Sturmlechner gentoo-dev 2018-02-06 09:08:19 UTC
*** Bug 646732 has been marked as a duplicate of this bug. ***
Comment 14 PrSo 2018-02-06 09:45:23 UTC
I am not sure if it is related, but I am unable to compile kde-apps/gwenview because of error:

"/var/tmp/portage/kde-apps/gwenview-17.12.1/work/gwenview-17.12.1/lib/documentview/svgviewadapter.cpp: In constructor ‘Gwenview::SvgImageView::SvgImageView(QGraphicsItem*)’:
/var/tmp/portage/kde-apps/gwenview-17.12.1/work/gwenview-17.12.1/lib/documentview/svgviewadapter.cpp:45:37: error: invalid use of incomplete type ‘class QGraphicsSvgItem’
 , mSvgItem(new QGraphicsSvgItem(this)) [...]"
Comment 15 Larry the Git Cow gentoo-dev 2018-02-06 12:28:50 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e134cfc5ca0b1ef24116749340c4a5d08d1bf66

commit 2e134cfc5ca0b1ef24116749340c4a5d08d1bf66
Author:     Michael Palimaka <kensington@gentoo.org>
AuthorDate: 2018-02-06 12:27:28 +0000
Commit:     Michael Palimaka <kensington@gentoo.org>
CommitDate: 2018-02-06 12:28:38 +0000

    dev-qt/qtsvg: revision bump fixes missing widgets support
    
    Bug: https://bugs.gentoo.org/646504
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 dev-qt/qtsvg/{qtsvg-5.9.4.ebuild => qtsvg-5.9.4-r1.ebuild} | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8b4f8629732b2f10945fd03e6918e8d69c25805

commit f8b4f8629732b2f10945fd03e6918e8d69c25805
Author:     Psi <public+gentoo@psionix.net>
AuthorDate: 2018-02-06 12:25:25 +0000
Commit:     Michael Palimaka <kensington@gentoo.org>
CommitDate: 2018-02-06 12:28:37 +0000

    dev-qt/qtwidgets: revision bump adds widgets to QT5_GENTOO_CONFIG
    
    Bug: https://bugs.gentoo.org/646504
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 dev-qt/qtwidgets/{qtwidgets-5.9.4.ebuild => qtwidgets-5.9.4-r1.ebuild} | 1 +
 1 file changed, 1 insertion(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48ab23f11742e4c6585470d96c350b0a939cf1d4

commit 48ab23f11742e4c6585470d96c350b0a939cf1d4
Author:     Psi <public+gentoo@psionix.net>
AuthorDate: 2018-02-06 12:24:11 +0000
Commit:     Michael Palimaka <kensington@gentoo.org>
CommitDate: 2018-02-06 12:28:37 +0000

    dev-qt/qtcore: revision bump adds support for mangling QT_NO_WIDGETS
    
    Bug: https://bugs.gentoo.org/646504
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 dev-qt/qtcore/{qtcore-5.9.4.ebuild => qtcore-5.9.4-r1.ebuild} | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)}
Comment 16 Larry the Git Cow gentoo-dev 2018-02-06 12:32:39 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/qt.git/commit/?id=dfc5f67f13306a3bf15fbbbc58fcac15546bc093

commit dfc5f67f13306a3bf15fbbbc58fcac15546bc093
Author:     Psi <public+gentoo@psionix.net>
AuthorDate: 2018-02-06 12:31:50 +0000
Commit:     Michael Palimaka <kensington@gentoo.org>
CommitDate: 2018-02-06 12:32:30 +0000

    dev-qt/qtwidgets: add widgets to widgets to QT5_GENTOO_CONFIG
    
    Bug: https://bugs.gentoo.org/646504
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 dev-qt/qtwidgets/qtwidgets-5.10.0.ebuild    | 1 +
 dev-qt/qtwidgets/qtwidgets-5.10.9999.ebuild | 1 +
 dev-qt/qtwidgets/qtwidgets-5.11.9999.ebuild | 1 +
 dev-qt/qtwidgets/qtwidgets-5.9.9999.ebuild  | 1 +
 dev-qt/qtwidgets/qtwidgets-5.9999.ebuild    | 1 +
 5 files changed, 5 insertions(+)

https://gitweb.gentoo.org/proj/qt.git/commit/?id=6d5b33f7c7c9cd0aaaab791313a3946caedc7dd9

commit 6d5b33f7c7c9cd0aaaab791313a3946caedc7dd9
Author:     Psi <public+gentoo@psionix.net>
AuthorDate: 2018-02-06 12:30:29 +0000
Commit:     Michael Palimaka <kensington@gentoo.org>
CommitDate: 2018-02-06 12:32:30 +0000

    dev-qt/qtcore: add support for mangling QT_NO_WIDGETS
    
    Bug: https://bugs.gentoo.org/646504
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 dev-qt/qtcore/qtcore-5.10.0.ebuild    | 8 ++++----
 dev-qt/qtcore/qtcore-5.10.9999.ebuild | 8 ++++----
 dev-qt/qtcore/qtcore-5.11.9999.ebuild | 8 ++++----
 dev-qt/qtcore/qtcore-5.9.9999.ebuild  | 4 ++--
 dev-qt/qtcore/qtcore-5.9999.ebuild    | 4 ++--
 5 files changed, 16 insertions(+), 16 deletions(-)}
Comment 17 Michael Palimaka (kensington) gentoo-dev 2018-02-06 12:37:08 UTC
Apologies for the delay in attending to this, I was away.

Thank-you Psi for the patch, it saved a lot of time in getting this landed.
Comment 18 Holger Hoffstätte 2018-02-06 14:08:11 UTC
(In reply to Michael Palimaka (kensington) from comment #17)
> Apologies for the delay in attending to this, I was away.
> 
> Thank-you Psi for the patch, it saved a lot of time in getting this landed.

Did the revbump, rebuilt psi just as before, all working. \o/
Thanks!
Comment 19 PrSo 2018-02-06 15:43:53 UTC
Yes, that was the reason of gwenview compilig error.
Thank you very much.
Comment 20 Andreas Sturmlechner gentoo-dev 2018-02-07 00:28:55 UTC
*** Bug 646848 has been marked as a duplicate of this bug. ***
Comment 21 Andreas Sturmlechner gentoo-dev 2018-02-10 14:06:28 UTC
*** Bug 647224 has been marked as a duplicate of this bug. ***
Comment 22 vltg0903 2018-02-12 01:50:19 UTC
Hi,

I've had a build failure of kde-frameworks/kjsembed-5.43.0 against dev-qt/qtsvg-5.10.0. 

In file included from /var/tmp/portage/kde-frameworks/kjsembed-5.43.0/work/kjsembed-5.43.0/src/kjsembed/kjsembed.cpp:23:0:
/var/tmp/portage/kde-frameworks/kjsembed-5.43.0/work/kjsembed-5.43.0/src/kjsembed/svg_binding.h:34:25: error: ‘QSvgWidget’ has not been declared
 KJSO_BINDING(SvgWidget, QSvgWidget, QWidgetBinding)

Same deal as before, got it to build by patching '#undef QT_NO_WIDGETS' into kjsembed. However, a revbump for qtsvg-5.10.0 seems in order...
Comment 23 vltg0903 2018-02-12 12:26:18 UTC
Never mind, the fix is already in place, rebuilding qtcore+qtwidgets did the trick.
Comment 24 Chris Reffett (RETIRED) gentoo-dev Security 2018-02-13 22:50:13 UTC
*** Bug 646666 has been marked as a duplicate of this bug. ***
Comment 25 Davide Pesavento (RETIRED) gentoo-dev 2018-03-10 23:16:57 UTC
*** Bug 649898 has been marked as a duplicate of this bug. ***