Bug 342897

Summary: solidextensionplugin should be built as a bundle plugin and not a shared library
Product: [Frameworks and Libraries] frameworks-solid Reporter: Hanspeter Niederstrasser <niederstrasser>
Component: generalAssignee: Lukáš Tinkl <lukas>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Fink Packages   
OS: macOS   
URL: https://developer.apple.com/library/mac/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html#//apple_ref/doc/uid/TP40002850-TPXREF103
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Hanspeter Niederstrasser 2015-01-16 04:31:26 UTC
solidextensionplugin is being built as a SHARED library (src/imports/CMakeLists.txt), but it should be MODULE instead.

https://developer.apple.com/library/mac/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html#//apple_ref/doc/uid/TP40002850-TPXREF103


Reproducible: Always


Actual Results:  
When built as SHARED as in the current code, libsolidextensionplugin.dylib gets installed to $PREFIX/share/qt5/qml/org/kde/solid/, but is given an install_name of $PREFIX/lib/libsolidextensionplugin.dylib.  This mismatch can cause problems. It is also given a compatibility_version of 0.0.0.

Expected Results:  
Since the plugin is not supposed to be a linkable library, it should be built as MODULE in CMakeLists.txt. This corrects the install_name/install location mismatch. The change should not have any effect on non-OS X systems.

This patch fixes it:

--- solid-5.6.0-orig/src/imports/CMakeLists.txt	2014-11-02 06:26:53.000000000 -0600
+++ solid-5.6.0/src/imports/CMakeLists.txt	2014-11-20 05:32:30.000000000 -0600
@@ -18,7 +18,7 @@
     devices.cpp
     )
 
-add_library(solidextensionplugin SHARED ${solidextensionplugin_SRCS})
+add_library(solidextensionplugin MODULE ${solidextensionplugin_SRCS})
 
 target_link_libraries(
     solidextensionplugin
Comment 1 Justin Zobel 2021-03-09 05:54:14 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 2 Hanspeter Niederstrasser 2021-03-23 01:53:25 UTC
Current code still calls the plugin as a shared library

https://github.com/KDE/solid/blob/master/src/imports/CMakeLists.txt#L21

So the problem probably still exists (I can't build solid now).
But there's data elsewhere that changing these plugins to be shared libraries on macOS is problematic: https://bugs.kde.org/show_bug.cgi?id=342962