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

Bug 530764

Summary: dev-python/pyside-1.2.2 + >=qtgui-4.8.6: error: '::QGtkStyle' has not been declared
Product: Gentoo Linux Reporter: Megas of Vecanti <emegas>
Component: Current packagesAssignee: Qt Bug Alias <qt>
Status: RESOLVED CANTFIX    
Severity: normal CC: ab4bd, anarchy, arfrever.fta, Casey, cnehren+gentoo-bugzilla, disp.reg.bugs.gentoo, gentoo-bugs, harold, hendrik, jarausch, kalin, luke-jr+gentoobugs, Mathias.Laurin+gentoo, optimusgd, pacho, rose, rossi.f
Priority: Low Keywords: NeedPatch
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard: [workaround in pyside-1.2.2-r1]
Package list:
Runtime testing required: ---
Attachments: output of emerge --info '=dev-python/pyside-1.2.2::gentoo'
Complete build.log
environment (for completeness's sake)
Patch to remove GtkStyle problems.
Ebuild using the patch I just submitted.

Description Megas of Vecanti 2014-11-26 13:41:38 UTC
Created attachment 390328 [details]
output of emerge --info '=dev-python/pyside-1.2.2::gentoo'

With qtgui 4.8.6-r1 installed, pyside 1.2.2 fails to build at the 24% mark with:

In file included from /var/tmp/portage/dev-python/pyside-1.2.2/work/pyside-qt4.8+1.2.2-python3_4/PySide/QtGui/PySide/QtGui/qabstractbutton_wrapper.cpp:39:0:
/var/tmp/portage/dev-python/pyside-1.2.2/work/pyside-qt4.8+1.2.2-python3_4/PySide/QtGui/PySide/QtGui/pyside_qtgui_python.h:1756:42: error: '::QGtkStyle' has not been declared
/var/tmp/portage/dev-python/pyside-1.2.2/work/pyside-qt4.8+1.2.2-python3_4/PySide/QtGui/PySide/QtGui/pyside_qtgui_python.h:1756:42: error: '::QGtkStyle' has not been declared
/var/tmp/portage/dev-python/pyside-1.2.2/work/pyside-qt4.8+1.2.2-python3_4/PySide/QtGui/PySide/QtGui/pyside_qtgui_python.h:1756:33: error: template-id 'SbkType<<expression error> >' for 'PyTypeObject* Shiboken::SbkType()' does not match any template declaration
PySide/QtGui/CMakeFiles/QtGui.dir/build.make:796: recipe for target 'PySide/QtGui/CMakeFiles/QtGui.dir/PySide/QtGui/qabstractbutton_wrapper.cpp.o' failed
make[2]: *** [PySide/QtGui/CMakeFiles/QtGui.dir/PySide/QtGui/qabstractbutton_wrapper.cpp.o] Error 1

Strangely enough, this error seems to occur _regardless of whether qtgui is built with the qgtkstyle USE flag set._ Very odd.

Output of emerge -pqv '=dev-python/pyside-1.2.2::gentoo':
[ebuild  N    ] dev-python/pyside-1.2.2  USE="X opengl svg -declarative -designer -help -multimedia -phonon -script -scripttools -sql {-test} -webkit -xmlpatterns" PYTHON_TARGETS="python2_7 python3_4 -python3_3"

emerge --info output attached, build.log to follow.
Comment 1 Megas of Vecanti 2014-11-26 13:43:39 UTC
Created attachment 390330 [details]
Complete build.log
Comment 2 Megas of Vecanti 2014-11-26 13:44:32 UTC
Created attachment 390332 [details]
environment (for completeness's sake)
Comment 3 Kevin Meagher 2014-11-26 14:41:55 UTC
Same Issue with me

Portage 2.2.14 (python 2.7.8-final-0, default/linux/amd64/13.0/desktop, gcc-4.8.3, glibc-2.20, 3.17.4-gentoo x86_64)
=================================================================
System uname: Linux-3.17.4-gentoo-x86_64-Intel-R-_Core-TM-_i5_CPU_750_@_2.67GHz-with-gentoo-2.2
KiB Mem:     4046844 total,    397096 free
KiB Swap:    4000180 total,   3972432 free
Timestamp of tree: Wed, 26 Nov 2014 13:15:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.3_p30-r1
dev-lang/perl:            5.20.1-r2
dev-lang/python:          2.7.8, 3.3.5-r1, 3.4.2
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.6
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6-r1, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.3-r2
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.17-r1 (virtual/os-headers)
sys-libs/glibc:           2.20
Repositories: gentoo steam-overlay science
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core2 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://gentoo.mirrors.pair.com/ http://gentoo.netnitco.net http://gentoo.mirrors.tds.net/gentoo http://gentoo.mirrors.pair.com/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/steam-overlay /var/lib/layman/science"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi alsa amd64 berkdb bluray branding bzip2 cairo cdda cdr cli consolekit corefonts cracklib crypt cups cxx dbus djvu dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fontconfig fontforge fortran gdbm gif glamor gpm gstreamer gtk hddtemp iconv icu id3tag ipod ipv6 jpeg lapack lcms ldap libcaca libnotify lm_sensors mad mmx mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio python qt3support qt4 readline rtc sdl semantic-desktop session spell sse sse2 ssl startup-notification svg systemd tcpd threads tiff truetype udev udisks unicode upower usb vdpau vorbis webkit wxwidgets x264 xcb xetex xml xv xvid zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_US en" LIRC_DEVICES="serial" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="nvidia nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.3 3.4"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 4 Davide Pesavento (RETIRED) gentoo-dev 2014-11-26 15:06:38 UTC
*** Bug 530770 has been marked as a duplicate of this bug. ***
Comment 5 Sebastian Köln 2014-11-27 20:39:34 UTC
Same problem here.
The following patch to

/var/tmp/portage/dev-python/pyside-1.2.2/work/pyside-qt4.8+1.2.2-python3_4/PySide/QtGui/PySide/QtGui/pyside_qtgui_python.h

fixes it for me.

*** /tmp/pyside_qtgui_python.h.orig     2014-11-27 21:31:50.987048506 +0100
--- /tmp/pyside_qtgui_python.h  2014-11-27 21:30:47.960813778 +0100
*************** template<> inline PyTypeObject* SbkType<
*** 1755,1757 ****
--- 1755,1759 ----
  template<> inline PyTypeObject* SbkType< ::QCleanlooksStyle >() { return reinterpret_cast<PyTypeObject*>(SbkPySide_QtGuiTypes[SBK_QCLEANLOOKSSTYLE_IDX]); }
+ #if !defined(QT_NO_STYLE_GTK)
  template<> inline PyTypeObject* SbkType< ::QGtkStyle >() { return reinterpret_cast<PyTypeObject*>(SbkPySide_QtGuiTypes[SBK_QGTKSTYLE_IDX]); }
+ #endif
  template<> inline PyTypeObject* SbkType< ::QMotifStyle >() { return reinterpret_cast<PyTypeObject*>(SbkPySide_QtGuiTypes[SBK_QMOTIFSTYLE_IDX]); }
Comment 6 Harold Anderson 2014-11-28 06:02:11 UTC
Upstream seems to have dealt with this problem with useful warnings in 1.3.0dev:

% git clone https://github.com/PySide/pyside-setup.git pyside-setup
% cd pyside-setup
% python2.7 setup.py build --version=1.3.0dev
Comment 7 Helmut Jarausch 2014-11-28 13:24:48 UTC
(In reply to Sebastian Köln from comment #5)
> Same problem here.
> The following patch to
> 
> /var/tmp/portage/dev-python/pyside-1.2.2/work/pyside-qt4.8+1.2.2-python3_4/
> PySide/QtGui/PySide/QtGui/pyside_qtgui_python.h
> 
> fixes it for me.
> 
> *** /tmp/pyside_qtgui_python.h.orig     2014-11-27 21:31:50.987048506 +0100
> --- /tmp/pyside_qtgui_python.h  2014-11-27 21:30:47.960813778 +0100
> *************** template<> inline PyTypeObject* SbkType<
> *** 1755,1757 ****
> --- 1755,1759 ----
>   template<> inline PyTypeObject* SbkType< ::QCleanlooksStyle >() { return
> reinterpret_cast<PyTypeObject*>(SbkPySide_QtGuiTypes[SBK_QCLEANLOOKSSTYLE_IDX
> ]); }
> + #if !defined(QT_NO_STYLE_GTK)
>   template<> inline PyTypeObject* SbkType< ::QGtkStyle >() { return
> reinterpret_cast<PyTypeObject*>(SbkPySide_QtGuiTypes[SBK_QGTKSTYLE_IDX]); }
> + #endif
>   template<> inline PyTypeObject* SbkType< ::QMotifStyle >() { return
> reinterpret_cast<PyTypeObject*>(SbkPySide_QtGuiTypes[SBK_QMOTIFSTYLE_IDX]); }

This works here, too.
But how can this patch be applied from within an ebuild?
The problem is that this file is only created during compile.

Many thanks for a hint,
Helmut
Comment 8 Harold Anderson 2014-11-29 21:50:12 UTC
As a stopgap measure, try this:

% layman -a qt
% layman -a hnaparst
% emerge =pyside-9999::hnaparst
Comment 9 Harold Anderson 2014-11-30 08:55:08 UTC
Created attachment 390634 [details, diff]
Patch to remove GtkStyle problems.
Comment 10 Harold Anderson 2014-11-30 08:56:00 UTC
Created attachment 390636 [details]
Ebuild using the patch I just submitted.
Comment 11 Helmut Jarausch 2014-11-30 12:48:53 UTC
(In reply to Harold Naparst from comment #10)
> Created attachment 390636 [details]
> Ebuild using the patch I just submitted.

Many thanks, it works just fine here,
Helmut
Comment 12 Harold Anderson 2014-11-30 13:07:21 UTC
Or you can use it from my overlay.  Glad it works.
Comment 13 Davide Pesavento (RETIRED) gentoo-dev 2014-11-30 22:46:46 UTC
It used to build fine with qtgui-4.8.5, therefore I suppose it's a regression in qtgui packaging, pyside itself has nothing to do with it.
Comment 14 Juergen Rose 2014-12-04 15:33:56 UTC
(In reply to Harold Naparst from comment #10)
> Created attachment 390636 [details]
> Ebuild using the patch I just submitted.

Thanks, the patch works for me.
Comment 15 Harold Anderson 2014-12-04 16:07:04 UTC
I would just recommend using it from my overlay, so you can keep up with changes if necessary.
Comment 16 Juergen Rose 2014-12-04 16:10:58 UTC
(In reply to Harold Naparst from comment #15)
> I would just recommend using it from my overlay, so you can keep up with
> changes if necessary.

I prefer to limit the number of used overlays. I hope that the patch will come into the main tree.
Comment 17 Davide Pesavento (RETIRED) gentoo-dev 2014-12-06 04:22:26 UTC
(In reply to Harold Naparst from comment #9)
> Created attachment 390634 [details, diff] [details, diff]
> Patch to remove GtkStyle problems.

This patch is not 100% correct because it just removes QGtkStyle support completely. It should be conditional.
Comment 18 Davide Pesavento (RETIRED) gentoo-dev 2014-12-06 04:24:46 UTC
I've found a proper solution, but it seems to trigger a bug in shiboken's typesystem handling. Investigating...
Comment 19 Ian Stakenvicius (RETIRED) gentoo-dev 2015-01-05 02:31:17 UTC
Please note that this hits pyside-1.2.1-r1 also.  Yeah, the qtgui-4.8.5->4.8.6 change makes sense here as the trigger.
Comment 20 Ian Stakenvicius (RETIRED) gentoo-dev 2015-01-05 02:36:36 UTC
(In reply to Ian Stakenvicius from comment #19)
> Please note that this hits pyside-1.2.1-r1 also.  Yeah, the
> qtgui-4.8.5->4.8.6 change makes sense here as the trigger.

Err, that's pyside-1.1.2-r1, sorry
Comment 21 Pacho Ramos gentoo-dev 2015-01-27 10:35:09 UTC
(In reply to Davide Pesavento from comment #17)
> (In reply to Harold Naparst from comment #9)
> > Created attachment 390634 [details, diff] [details, diff] [details, diff]
> > Patch to remove GtkStyle problems.
> 
> This patch is not 100% correct because it just removes QGtkStyle support
> completely. It should be conditional.

The patch from comment #5 should achieve that no? :/
Comment 22 Luke-Jr 2015-01-27 10:39:08 UTC
I wonder, is this related to bug 530074? More trying to force Qt users to have glib/GTK against their wishes?
Comment 23 Davide Pesavento (RETIRED) gentoo-dev 2015-01-27 14:29:17 UTC
(In reply to Pacho Ramos from comment #21)
> (In reply to Davide Pesavento from comment #17)
> > (In reply to Harold Naparst from comment #9)
> > > Created attachment 390634 [details, diff] [details, diff] [details, diff] [details, diff]
> > > Patch to remove GtkStyle problems.
> > 
> > This patch is not 100% correct because it just removes QGtkStyle support
> > completely. It should be conditional.
> 
> The patch from comment #5 should achieve that no? :/

That patch modifies a file that is generated during the build.

(In reply to Luke-Jr from comment #22)
> I wonder, is this related to bug 530074? More trying to force Qt users to
> have glib/GTK against their wishes?

No it's not related. USE=gtkstyle will be preserved.
Comment 24 Pacho Ramos gentoo-dev 2015-01-28 09:36:38 UTC
Looks like they are dropping the gtkstyle references too :/
https://qt.gitorious.org/pyside/hnaparst-pyside/commit/f46e086d388255f6ae8d45f780b1838077f5be70
Comment 25 Pacho Ramos gentoo-dev 2015-02-02 22:24:49 UTC
(In reply to Pacho Ramos from comment #24)
> Looks like they are dropping the gtkstyle references too :/
> https://qt.gitorious.org/pyside/hnaparst-pyside/commit/
> f46e086d388255f6ae8d45f780b1838077f5be70

Would this be the way to go? (please take care this is blocking a lot of stabilizations :( )
Comment 26 Davide Pesavento (RETIRED) gentoo-dev 2015-02-02 23:22:08 UTC
(In reply to Pacho Ramos from comment #25)
> (In reply to Pacho Ramos from comment #24)
> > Looks like they are dropping the gtkstyle references too :/
> > https://qt.gitorious.org/pyside/hnaparst-pyside/commit/
> > f46e086d388255f6ae8d45f780b1838077f5be70
> 
> Would this be the way to go?

No.

> (please take care this is blocking a lot of
> stabilizations :( )

Such as?
Actually, this shouldn't block bug 530760 since it's not a regression compared to pyside-1.1.2-r1 (current stable), and it happens only with qt-4.8.6 which is not stable.
Comment 27 Pacho Ramos gentoo-dev 2015-02-03 10:43:27 UTC
OK, thanks. 

Well, we need newer ipython for some gnome stuff (due to new python eclasses migration if I don't misremember), that needs matplotlib stabilization that needs... ;)

Not sure if you could also review bug 509766 blocking the stabilization now :) 

Thanks a lot for taking care
Comment 28 Ben de Groot (RETIRED) gentoo-dev 2015-03-22 01:27:16 UTC
(In reply to Davide Pesavento from comment #17)
> (In reply to Harold Naparst from comment #9)
> > Created attachment 390634 [details, diff] [details, diff] [details, diff]
> > Patch to remove GtkStyle problems.
> 
> This patch is not 100% correct because it just removes QGtkStyle support
> completely. It should be conditional.

It is now three months later, and we are still stuck with complete build failure. The patch may not be 100% correct, but it's 100% better than what we have now. 

In absence of a better solution, I will apply this. We need to move forward with Qt 4.8.6 stabilization.
Comment 29 Davide Pesavento (RETIRED) gentoo-dev 2015-03-22 01:48:53 UTC
(In reply to Ben de Groot from comment #28)

Well... No one provided a complete patch that addresses the build failure without removing previously working functionality. Some users won't be happy if you just remove qgtkstyle support altogether.

Also, no one has determined if this is really a pyside bug, or if it's in fact a regression in qtgui-4.8.6-r1 (we already had several tricky bugs related to qconfig handling in the past), so you might actually be fixing the wrong package.
Comment 30 Ben de Groot (RETIRED) gentoo-dev 2015-03-22 02:19:10 UTC
(In reply to Davide Pesavento from comment #29)
> (In reply to Ben de Groot from comment #28)
> 
> Well... No one provided a complete patch that addresses the build failure
> without removing previously working functionality. Some users won't be happy
> if you just remove qgtkstyle support altogether.

Then they can stay with the old ebuild and Qt 4.8.5. But for those of us on Qt 4.8.6, an ebuild that does not fail but drops one non-essential feature is much preferred over one that does not build at all.

> Also, no one has determined if this is really a pyside bug, or if it's in
> fact a regression in qtgui-4.8.6-r1 (we already had several tricky bugs
> related to qconfig handling in the past), so you might actually be fixing
> the wrong package.

I understand it is most likely a regression in qtgui, but that is beyond me to fix atm. A non-perfect solution is preferable over a perfect one that never materializes. When someone does come with a proper fix, we can always upgrade to the better solution.

Or do you have another suggestion?
Comment 31 Ben de Groot (RETIRED) gentoo-dev 2015-03-22 04:22:59 UTC
+*pyside-1.2.2-r1 (22 Mar 2015)
+
+  22 Mar 2015; Ben de Groot <yngwin@gentoo.org> +files/qgtkstyle-1.2.2.patch,
+  +pyside-1.2.2-r1.ebuild:
+  Patch out QGtkStyle support to make pyside compile with Qt 4.8.6. Users who
+  need QGtkStyle support should stay with Qt 4.8.5 and mask this ebuild, until
+  bug #530764 has a proper fix.
Comment 32 Ben de Groot (RETIRED) gentoo-dev 2015-04-05 04:50:45 UTC
Since we have a workable solution, let's not have this block the stabilization of Qt 4.8.6 any longer.
Comment 33 Kalin KOZHUHAROV 2015-11-26 07:50:03 UTC
It took me some time to figure out, but it looks like PySide development has moved to github. There is 1.2.4 release already https://github.com/PySide/PySide
Comment 34 Davide Pesavento (RETIRED) gentoo-dev 2015-11-26 13:43:18 UTC
(In reply to Kalin KOZHUHAROV from comment #33)
> It took me some time to figure out, but it looks like PySide development has
> moved to github. There is 1.2.4 release already
> https://github.com/PySide/PySide

Off-topic. I've opened bug 566912.