Support static plugins in KCoreAddons plugin infrastructure
Open, Needs TriagePublic

Description

Currently apps that want to use static plugins have to implement their own code paths for it. Integrating this in the KCoreAddons classes that handle plugins would make this process much easier. I already played around with writing the plugin namespace in the moc metadata, which one could read in the findPlugins and findPluginById method.

Some questions that might need discussion:

  • Do we want this to be switchable? So that the project can set a default to build the plugins statically in release builds, but developers can build them dynamically. This way one would not need to recompile the app in case changes to plugins are made. @vkrause Mentioned that this would be useful for Android deployments.
  • Should the existing static plugins be migrated to KPluginFactory? In kwin the static plugins don't use this, otherwise making them compatible with dynamic plugins will be a bit tricky/hacky. @zzag
alex created this task.Jul 19 2021, 2:45 PM
alex added a comment.Sep 1 2021, 6:26 AM

There is also the usecase for using static plugins when building appimages. In that cases we only load the plugins that are shipped along with the app. Using the filesystem to dynamically load plugins would only slow down the app and not bring any benefits.

alex moved this task from Backlog to In Progress on the KF6 board.Oct 20 2021, 5:58 AM
alex edited projects, added Frameworks; removed KF6.Nov 16 2021, 3:38 PM