Bug 332223

Summary: PyKDE4 fails to build with SIP 4.15.5 / PyQt4 4.10.4
Product: [Unmaintained] bindings Reporter: Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA>
Component: pykdeAssignee: kde-bindings
Status: RESOLVED FIXED    
Severity: normal CC: arthur, demm, felixonmars, kde-bugs, panfaust, rakuco, rdieter, scarpino, stupor_scurvy343
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In: 4.14.0
Sentry Crash Report:
Attachments: fix build when using sip-4.15.5
Fix build with pyqt 4.11

Description Arfrever Frehtes Taifersar Arahesis 2014-03-16 17:46:55 UTC
PyKDE4 fails to build with SIP 4.15.5 / PyQt4 4.15.5, which were released yesterday.
I use PyKDE4 4.12.3.

Linking CXX shared library lib/phonon.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/python_module_PyKDE4_phonon.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-g++  -fPIC -march=core2 -O2 -fno-ident -frecord-gcc-switches -pipe -Wall  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -fvisibility-inlines-hidden -Wl,--enable-new-dtags -Wl,--no-undefined -lc  -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--hash-style=gnu -Wl,--sort-common -shared -Wl,-soname,phonon.so -o lib/phonon.so CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart0.cpp.o CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart1.cpp.o CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart2.cpp.o CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart3.cpp.o CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart4.cpp.o CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart5.cpp.o CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart6.cpp.o CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart7.cpp.o -lpython2.6 -lphonon /usr/lib64/qt4/libQtDBus.so /usr/lib64/qt4/libQtCore.so -lpthread /usr/lib64/qt4/libQtGui.so -Wl,-rpath,/usr/lib64/qt4: 
CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart5.cpp.o:(.data.rel+0x168): undefined reference to `Phonon::BackendCapabilities::Notifier::staticMetaObject'
collect2: error: ld returned 1 exit status
CMakeFiles/python_module_PyKDE4_phonon.dir/build.make:332: recipe for target 'lib/phonon.so' failed
make[2]: *** [lib/phonon.so] Error 1
Comment 1 Rex Dieter 2014-03-16 21:28:09 UTC
I can confirm build fails on fedora too, see also,
https://koji.fedoraproject.org/koji/taskinfo?taskID=6638643
Comment 2 Arfrever Frehtes Taifersar Arahesis 2014-03-16 21:30:00 UTC
(I mispasted version of PyQt4. Obviously it is 4.10.4.)
Comment 3 Rex Dieter 2014-03-17 02:04:07 UTC
Created attachment 85608 [details]
fix build when using sip-4.15.5

Patch adapted from similar changes made to phonon sip files included in PyQt-4.10.4
Comment 4 Dmitry Shachnev 2014-06-07 15:39:16 UTC
Created attachment 87063 [details]
Fix build with pyqt 4.11

With sip 4.16 and pyqt 4.11, it fails to build with a different error:

  sip: GLuint already defined
  CMakeFiles/python_module_PyKDE4_plasma.dir/build.make:141: recipe for target 'sip/plasma/sipplasmapart0.cpp' failed
  make[5]: *** [sip/plasma/sipplasmapart0.cpp] Error 1

I am attaching a patch from Fedora that fixes the build.
Comment 5 Rex Dieter 2014-06-07 15:42:05 UTC
That latest one is a sip-4.16 bug (fix to be included in the next sip release)
Comment 6 José Manuel Santamaría Lema 2014-06-09 22:19:42 UTC
(In reply to comment #5)
> That latest one is a sip-4.16 bug (fix to be included in the next sip
> release)

If it's a sip bug, would you mind to link the sip bug report/patch?
Comment 7 Rex Dieter 2014-06-10 00:39:07 UTC
sip-4.16.1 was released today, which includes the fix
Comment 8 Rex Dieter 2014-06-10 00:43:25 UTC
Oh sorry, I did indeed misread.  that issue is indeed another pykde issue.

(this latest sip/PyQt was fairly problematic, with several different issues which I successfully mixed up here, sorry)
Comment 9 stupor_scurvy343 2014-07-16 12:41:25 UTC
With PyQt4-4.11.1, sip-4.16.2 and Rex's patch, build passes.
Comment 10 Raphael Kubo da Costa 2014-07-29 17:13:47 UTC
The PyKDE error was fixed in http://quickgit.kde.org/?p=pykde4.git&a=commit&h=1e9817f99b405a66199fe9f62de31d3870e3ad12
Comment 11 Arfrever Frehtes Taifersar Arahesis 2014-07-30 11:03:12 UTC
(In reply to Raphael Kubo da Costa from comment #10)
> The PyKDE error was fixed in
> http://quickgit.kde.org/?p=pykde4.
> git&a=commit&h=1e9817f99b405a66199fe9f62de31d3870e3ad12

No. That commit fixed another problem occurring with PyQt4 >=4.11.

Problem originally reported in this bug still occurs with any version of PyQt4 >=4.10.4. Fix for sip/phonon/backendcapabilities.sip is still needed. You might need to have Phonon support enabled in PyQt4 and PyKDE4 to reproduce this bug.
Comment 12 Raphael Kubo da Costa 2014-07-30 12:17:32 UTC
Sorry about the confusion. The problem with Phonon comes from http://riverbankcomputing.co.uk/hg/sip/rev/b96a5e69adb6

As it can be seen from PyQt's own Phonon bindings, the PyQt4NoQMetaObject annotation is now called PyQtNoQMetaObject. Besides sip/phonon/backendcapabilities.sip, there's also sip/solid/networking.sip that needs to be updated.

We can't just do what PyQt did and rename the annotation, though, because that would break older versions of SIP. I haven't really checked if this is the case, but if we really want to maintain compatibility we'd have to check for SIP's API level.
Comment 13 Arfrever Frehtes Taifersar Arahesis 2014-07-30 13:10:49 UTC
I think that now it would be acceptable to start requiring SIP >=4.16 / PyQt4 >=4.11.
Comment 14 Raphael Kubo da Costa 2014-08-03 11:27:07 UTC
https://git.reviewboard.kde.org/r/119582/
Comment 15 Raphael Kubo da Costa 2014-08-03 17:02:40 UTC
Git commit daeb714512e480d68b73121d258883da2342a26a by Raphael Kubo da Costa.
Committed on 03/08/2014 at 11:24.
Pushed by rkcosta into branch 'KDE/4.14'.

Update the PyQt4NoQMetaObject annotation for SIP >= 4.16.

SIP 4.16 has introduced a backwards-incompatible change by renaming the
PyQt4NoQMetaObject annotation to PyQtNoQMetaObject.

We now have to duplicate the definition of the affected classes in our
SIP files so that the right version with the right annotations are
chosen based on the SIP version being used.

REVIEW:   119582
FIXED-IN: 4.14.0

M  +15   -2    sip/phonon/backendcapabilities.sip
M  +15   -0    sip/solid/networking.sip

http://commits.kde.org/pykde4/daeb714512e480d68b73121d258883da2342a26a