Bug 436155

Summary: extra-cmake-modules commits 7f47f20ba / 834efa708 break kio's thumbcreator.h for multiple revdeps including kio-extras
Product: [Frameworks and Libraries] extra-cmake-modules Reporter: Duncan <1i5t5.duncan>
Component: generalAssignee: ecm-bugs-null <ecm-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kossebau, shenlebantongying
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Duncan 2021-04-25 08:17:15 UTC
Arguably this could be filed as either a kio bug or an extra-cmake-modules bug.  I chose the latter.  Using live-git (via the gentoo/kde overlay packages) for kde-frameworks/plasma/apps all three.  That's not in the version selector so I left it unspecified.

With ecm commits  7f47f20ba and its followup 934efa708 (on April 24), rebuilding kio succeeds but leaves it broken for further building of multiple reverse-deps using thumbcreators.h.  I took me quite some time to figure out the double-dependency since the errors hint at a kio problem but rebuilding earlier versions of either ecm or kio alone did nothing. I had to revert the two commits on ecm, rebuild it, then kio on top of the fixed ecm, then the actually failing builds on top of the fixed kio, in ordered to get the actually failing builds to build again.

Rebuilding only packages that had new commits (not many since it was only a day and a half since my previous update) there were four packages that failed to build with the bad kio: kio-extras, palapeli, dolphin and plasma-workspace.  All the errors are very similar pairs, with both of the pair pointing at kio/thumbcreator.h.  The pair of errors quoted below are the first pair from kio-extras.

FAILED: thumbnail/CMakeFiles/windowsexethumbnail.dir/windowsexecreator.cpp.o 
[snip the commandline]
In file included from /include/KF5/KIOWidgets/kio/thumbcreator.h:11,
from ../kio-extras-9999/thumbnail/windowsexecreator.h:20,
from ../kio-extras-9999/thumbnail/windowsexecreator.cpp:16:
/include/KF5/KIOWidgets/kio/thumbcreator.h:167:63: error: expected identifier before '__attribute__'
167 | class KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use ThumbCreator") KIOWIDGETS_EXPORT ThumbCreatorV2 : public ThumbCreator
|                                                               ^~~~~~~~~~~~~~~~~
In file included from ../kio-extras-9999/thumbnail/windowsexecreator.h:20,
from ../kio-extras-9999/thumbnail/windowsexecreator.cpp:16:
/include/KF5/KIOWidgets/kio/thumbcreator.h:167:96: error: expected initializer before ':' token
167 | class KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use ThumbCreator") KIOWIDGETS_EXPORT ThumbCreatorV2 : public ThumbCreator
|                                                                                                ^
Comment 1 Friedrich W. H. Kossebau 2021-04-25 16:41:47 UTC
Already on it, plan is to undo the usage of standard C++ attributes [[]] in ECMGenerateExportHeader, as they seem to not mix with compiler-specific __attribute___, which though is enforced by the current usage of CMake's GenerateExportHeader. Which opened the eyes about this being fragile from the start and needing some thoughts later as well once the next elephant enters the room.
Comment 2 Friedrich W. H. Kossebau 2021-04-25 17:01:14 UTC
Git commit dd91c16cbd6d73e065e7d42923c8cc23fa3ef01a by Friedrich W. H. Kossebau.
Committed on 25/04/2021 at 17:01.
Pushed by kossebau into branch 'master'.

ECMGenerateExportHeader: unbreak builds by not mixing std & legacy attributes

NO_CHANGELOG

M  +20   -36   modules/ECMGenerateExportHeader.cmake
M  +6    -1    tests/ECMGenerateExportHeaderTest/consumer/CMakeLists.txt

https://invent.kde.org/frameworks/extra-cmake-modules/commit/dd91c16cbd6d73e065e7d42923c8cc23fa3ef01a