Bug 1291073

Summary: trojita currently fails to build, against Qt-5.6.0
Product: [Fedora] Fedora Reporter: Raphael Groner <projects.rg>
Component: trojitaAssignee: Raphael Groner <projects.rg>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: kde-sig, projects.rg, rdieter
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: trojita-0.5a-2.20151216gitefa30f3.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-25 00:26:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1291040    

Description Raphael Groner 2015-12-13 13:11:20 UTC
Description of problem:
trojita currently fails to build, against Qt-5.6.0

Version-Release number of selected component (if applicable):
0.5-9, see commit bd1d4f614105e2304e35de55449fe21720389f3

How reproducible:
yes

Steps to Reproduce:
1. fedpkg build
2.
3.

Actual results:
CMakeFiles/trojita.dir/src/Gui/main.cpp.o: In function `Statictrojita_plugin_ClearTextPasswordPluginPluginInstance::Statictrojita_plugin_ClearTextPasswordPluginPluginInstance()':
/builddir/build/BUILD/trojita-0.5/build/static_plugins.h:2: undefined reference to `qt_static_plugin_trojita_plugin_ClearTextPasswordPlugin()'

Expected results:
no error

Additional info:

Comment 1 Raphael Groner 2015-12-16 04:31:03 UTC
"The moc tool is now responsible for generating plugin metadata, so rather than a preprocessor macro in a C++ file (Q_EXPORT_PLUGIN2), as in Qt 4, in Qt 5 a new macro must be used in the header file, where moc can see it. The process is described by Lars, and is relatively straightforward. Where it becomes difficult though is in cases where the Q_EXPORT_PLUGIN2 macro is wrapped with another macro, as done in KDE in K_EXPORT_PLUGIN."
See https://www.kdab.com/porting-from-qt-4-to-qt-5/

I do not see those suggestions from upstream for proper Qt5 compatibility in the trojita source. It's not clear to me how that crap could work since before with any Qt5 version.
In short:
* add Q_PLUGIN_METADATA macro to your plugin object
* Add a myplugindescription.json file next to myplugin.h containing
* remove the Q_EXPORT_PLUGIN macro (!!)

(!!) we see a disabled usage (because b0rken?) of Q_EXPORT_PLUGIN2 macro in src/Plugins/ClearTextPassword/ClearTextPassword.cpp

See http://thread.gmane.org/gmane.comp.lib.qt.devel/4450/focus=4456

An obvious relation to an internal failure in moc is not given here.

Comment 2 Raphael Groner 2015-12-16 09:15:30 UTC
Holy crap! Tried now with latest trojita git, see yourself:

[ 25%] Linking CXX executable be.contacts
/usr/bin/cmake -E cmake_link_script CMakeFiles/be.contacts.dir/link.txt --verbose=1
/usr/lib64/ccache/c++   -Wall -Wsign-compare -O2 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_F
ORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switche
s -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -std=c++11 -fvisibility=hidden
 -fvisibility-inlines-hidden -O2 -g -DNDEBUG   -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-harden
ed-ld CMakeFiles/be.contacts.dir/src/Plugins/AbookAddressbook/main.cpp.o CMakeFiles/be.contacts.dir/
be.contacts_automoc.cpp.o  -o be.contacts -rdynamic trojita_plugin_AbookAddressbookPlugin.a /usr/lib
64/libQt5Widgets.so.5.6.0 libtrojita_plugins.so /usr/lib64/libQt5Gui.so.5.6.0 /usr/lib64/libQt5Core.
so.5.6.0 -Wl,-rpath,/builddir/build/BUILD/trojita-efa30f3: 
CMakeFiles/be.contacts.dir/src/Plugins/AbookAddressbook/main.cpp.o: In function `Statictrojita_plugi
n_AbookAddressbookPluginPluginInstance::Statictrojita_plugin_AbookAddressbookPluginPluginInstance()'
:
/builddir/build/BUILD/trojita-efa30f3/src/Plugins/AbookAddressbook/main.cpp:36: undefined reference 
to `qt_static_plugin_trojita_plugin_AbookAddressbookPlugin()'
collect2: error: ld returned 1 exit status

Comment 3 Raphael Groner 2015-12-16 09:45:17 UTC
Finally it just works!

Comment 4 Fedora Update System 2015-12-17 10:27:45 UTC
trojita-0.5a-2.20151216gitefa30f3.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update trojita'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-afb9844b79

Comment 5 Fedora Update System 2015-12-25 00:25:53 UTC
trojita-0.5a-2.20151216gitefa30f3.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.