Bug 1291073 - trojita currently fails to build, against Qt-5.6.0
trojita currently fails to build, against Qt-5.6.0
Product: Fedora
Classification: Fedora
Component: trojita (Show other bugs)
All Linux
unspecified Severity high
: ---
: ---
Assigned To: Raphael Groner
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks: qt-5.6
  Show dependency treegraph
Reported: 2015-12-13 08:11 EST by Raphael Groner
Modified: 2015-12-24 19:26 EST (History)
3 users (show)

See Also:
Fixed In Version: trojita-0.5a-2.20151216gitefa30f3.fc23
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-12-24 19:26:20 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Raphael Groner 2015-12-13 08:11:20 EST
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:

Steps to Reproduce:
1. fedpkg build

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-15 23:31:03 EST
"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 04:15:30 EST
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
/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 04:45:17 EST
Finally it just works!
Comment 4 Fedora Update System 2015-12-17 05:27:45 EST
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-24 19:25:53 EST
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.

Note You need to log in before you can comment on or make changes to this bug.