Bug 347176 - kcm_kwin4_genericscripted.so not found because it's in the wrong location
Summary: kcm_kwin4_genericscripted.so not found because it's in the wrong location
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (show other bugs)
Version: 5.3.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://github.com/faho/kwin-tiling/t...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-04 16:42 UTC by Fabian Homborg
Modified: 2016-07-11 18:47 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
image screen (43.27 KB, image/png)
2015-12-31 19:42 UTC, Marc Collin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Homborg 2015-05-04 16:42:11 UTC
Script configuration menus error out because kcm_kwin4_genericscripted.so is installed in /usr/lib/qt/plugins/kwin/effects/configs/kcm_kwin4_genericscripted.so and then not found.

The error message in the terminal is

>Error loading plugin "kcm_kwin4_genericscripted" "The shared library was not found."
>Plugin search paths are ("/usr/lib/qt/plugins", "/usr/bin")
>The environment variable QT_PLUGIN_PATH might be not correctly set
>Error loading plugin: "The shared library was not found."

Creating a symlink (and presumably copying) in /usr/lib/qt/plugins/ works.

Reproducible: Always

Steps to Reproduce:
1. Install a script with a configuration menu
2. Open it in the kcm

Actual Results:  
Show the error

Expected Results:  
Show the configuration menu

I don't quite like that it's still called kcm_kwin**4** - is this expected to change?
Comment 1 Martin Flöser 2015-05-04 18:11:33 UTC
not completely unlikely given that my system (default build) doesn't have any script with a config button, so quite likely this broke during porting without noticing.

Do you have an example of a script with config module?
Comment 2 Fabian Homborg 2015-05-04 18:22:15 UTC
Yes, check the URL - my tiling script thingy. :-)
Comment 3 Martin Flöser 2015-05-19 09:32:46 UTC
got it to work:
X-KDE-Library=kwin/effects/configs/kcm_kwin4_genericscripted

The genericscripted is changed to be used with KPluginTrader which looks in a specified directory (e.g. kwin/effects/configs). The KPluginSelector doesn't set this, thus it needs to be specified in the metadata file.
Comment 4 Marc Collin 2015-12-30 18:51:58 UTC
same problem if i set with this value.
Comment 5 Thomas Lübking 2015-12-30 19:19:36 UTC
Do you have /usr/lib/qt/plugins/kwin/effects/configs/kcm_kwin4_genericscripted.so or maybe "only" /usr/lib/plugins/kwin/effects/configs/kcm_kwin4_genericscripted.so and how does that correlate with the output of "kf5-config --path qtplugins"?
Comment 6 Marc Collin 2015-12-30 19:46:23 UTC
no mine is in lib64
/usr/lib64/qt5/plugins/kwin/effects/configs/kcm_kwin4_genericscripted.so

kf5-config --path qtplugins return 
/usr/lib64/plugins/:/usr/lib64/qt5/plugins/plugins/
Comment 7 Thomas Lübking 2015-12-30 20:01:03 UTC
See the doubled plugins/plugins ?

That's a distro bug (and I think it was already reported) - basically they added "plugins" to the plugins path when compiling KF5 (what's likely undesired), but use the proper path on installing kwin (or similar, but whatever happened, the lib does not end up in a plugins path and the default plugins path in KF5 is likely the wrong one)

Check whether you don't have accidentally set "echo $QT_PLUGIN_PATH" and try

   QT_PLUGIN_PATH=/usr/lib64/plugins/:/usr/lib64/qt5/plugins/plugins/:/usr/lib64/qt5/plugins/ kwin_x11 --replace &
Comment 8 Marc Collin 2015-12-30 20:51:22 UTC
In console, 

echo $QT_PLUGIN_PATH

return nothing.
Comment 9 Thomas Lübking 2015-12-30 20:56:54 UTC
Then it the path set at compile time.
As mentioned, I think we had this (fedora? I'm really not sure) but you may still want to report to your distro.
Comment 10 Hrvoje Senjan 2015-12-31 09:27:31 UTC
...
      -DKDE_INSTALL_QTPLUGINDIR=%{_lib}/qt5/plugins \\\
      -DKDE_INSTALL_PLUGINDIR=%{_lib}/qt5/plugins \\\
...

https://projects.kde.org/projects/kdesupport/extra-cmake-modules/repository/revisions/master/entry/kde-modules/KDEInstallDirs.cmake#L37

doesn't show we're doing anything wrong here.
Comment 12 Thomas Lübking 2015-12-31 09:59:54 UTC
I won't claim any expertise here - all I know that I get:

% kf5-config --path qtplugins
/usr/lib/plugins/:/usr/lib/qt/plugins/plugins/

% kde4-config --path qtplugins
$HOME/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/:/usr/lib/plugins/

And those are the paths all my plugins end up *shrug*

The kcm only asks for KServiceTypeTrader offers, KPluginInfo::fromServices(offers) and adds them to a KPluginSelector. So I assume this would affect pretty much everything (at least we should not build specific paths here)

@Marc, do you have (other) plugins installed in /usr/lib64/qt5/plugins/plugins/ and/or in /usr/lib64/qt5/plugins/ ?
Comment 13 Hrvoje Senjan 2015-12-31 13:46:46 UTC
Well, this works for me here.
Did
git clone https://github.com/faho/kwin-tiling.git
cd kwin-tiling/
plasmapkg2 --type kwinscript -i .

and enabled script succesfully...
Comment 14 Thomas Lübking 2015-12-31 14:00:29 UTC
Marcs problem is for sure that the plugin lib doesn't end up in a plugin path - we don't know the cause yet.

Assuming he's on SuSE:
Hrvoje, what do the kf5 default paths ("kf5-config --path qtplugins") report on your side? And where is the lib installed (well, ok - likely in one of those paths ;-)
Comment 15 Hrvoje Senjan 2015-12-31 14:21:42 UTC
It's installed to /usr/lib64/qt5/plugins/kwin/effects/configs/kcm_kwin4_genericscripted.so

kf5-config --path qtplugins                            
/usr/lib64/plugins/:/usr/lib64/qt5/plugins/plugins/

qtpaths --plugin-dir
/usr/lib64/qt5/plugins
Comment 16 Thomas Lübking 2015-12-31 19:03:55 UTC
sounds as if the doubled plugins output would indeed be just a bug (just noticed that I have it as well ;-) in kf5-config, but then i'm really out of ideas.

@Marc, run

  strace kcmshell5 kwinscripts 2>&1 | grep kcm_kwin4_genericscripted.so

and try to open a config dialog for a script.
=> That will tell us which paths are considered (and whether or not they succeed)
Comment 17 Marc Collin 2015-12-31 19:42:53 UTC
Created attachment 96388 [details]
image screen

if i run you command

strace kcmshell5 kwinscripts 2>&1 | grep kcm_kwin4_genericscripted.so

stat(".//kcm_kwin4_genericscripted.so", {st_mode=S_IFREG|0755, st_size=547544, ...}) = 0
open(".//kcm_kwin4_genericscripted.so", O_RDONLY|O_CLOEXEC) = 12
open(".//kcm_kwin4_genericscripted.so", O_RDONLY|O_CLOEXEC) = 12
stat(".//kcm_kwin4_genericscripted.so", {st_mode=S_IFREG|0755, st_size=547544, ...}) = 0
stat(".//kcm_kwin4_genericscripted.so", {st_mode=S_IFREG|0755, st_size=547544, ...}) = 0
stat(".//kcm_kwin4_genericscripted.so", {st_mode=S_IFREG|0755, st_size=547544, ...}) = 0

when i click on the tiling extension to setup it i get this screen...

but if i pass by  KDE Systemsettings, windows management,. kwin script i click on the same button, i get a message specifiing sharing library is not found....

In the file: /home/collinm/.local/share/kwin/scripts/kwin-script-tiling/metadata.desktop, for key
X-KDE-Library i tried to put: kwin/effects/configs/kcm_kwin4_genericscripted
same result

tried also

/usr/lib64/qt5/plugins/kwin/effects/configs/kcm_kwin4_genericscripted

same result
Comment 18 Thomas Lübking 2015-12-31 19:58:49 UTC
This finds the library in the working directory?
Is that a regular distro installation or some self-compiled setup? And why is kcm_kwin4_genericscripted.so in $PWD? Did you try to run the command from /usr/lib64/qt5/plugins/kwin/effects/configs/ ? In case, please don't. Try again from eg. your $HOME dir.
Comment 19 Marc Collin 2015-12-31 20:37:26 UTC
I use suse.

Ok I tried from my home dir and get

collinm@linux-ja2a:~> strace kcmshell5 kwinscripts 2>&1 | grep kcm_kwin4_genericscripted.so                                                                                                                                      
stat(".//kcm_kwin4_genericscripted.so", 0x7ffca69507e0) = -1 ENOENT (No such file or directory)
stat(".//libkcm_kwin4_genericscripted.so", 0x7ffca69507e0) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/qt5/plugins/kcm_kwin4_genericscripted.so", 0x7ffca69507e0) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/qt5/plugins/libkcm_kwin4_genericscripted.so", 0x7ffca69507e0) = -1 ENOENT (No such file or directory)
stat("/usr/bin/kcm_kwin4_genericscripted.so", 0x7ffca69507e0) = -1 ENOENT (No such file or directory)
stat("/usr/bin/libkcm_kwin4_genericscripted.so", 0x7ffca69507e0) = -1 ENOENT (No such file or directory)
stat(".//kcms/kcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat(".//kcms/libkcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/qt5/plugins/kcms/kcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/qt5/plugins/kcms/libkcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat("/usr/bin/kcms/kcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat("/usr/bin/kcms/libkcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat(".//kcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat(".//libkcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/qt5/plugins/kcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/qt5/plugins/libkcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat("/usr/bin/kcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat("/usr/bin/libkcm_kwin4_genericscripted.so", 0x7ffca6950870) = -1 ENOENT (No such file or directory)
stat(".//kcm_kwin4_genericscripted.so", 0x7ffca6950af0) = -1 ENOENT (No such file or directory)
stat(".//libkcm_kwin4_genericscripted.so", 0x7ffca6950af0) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/qt5/plugins/kcm_kwin4_genericscripted.so", 0x7ffca6950af0) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/qt5/plugins/libkcm_kwin4_genericscripted.so", 0x7ffca6950af0) = -1 ENOENT (No such file or directory)
stat("/usr/bin/kcm_kwin4_genericscripted.so", 0x7ffca6950af0) = -1 ENOENT (No such file or directory)
stat("/usr/bin/libkcm_kwin4_genericscripted.so", 0x7ffca6950af0) = -1 ENOENT (No such file or directory)

so it don't search in /usr/lib64/qt5/plugins/kwin/effects/configs/
Comment 20 Thomas Lübking 2015-12-31 20:57:37 UTC
That would be the original bug.
Sure the altered service file is considered? (grep the strace for "metadata")
Comment 21 andydecleyre 2016-06-21 16:04:07 UTC
I'm having trouble reading a solution if it's here. I'm still experiencing this on Arch Linux.

$ locate kcm_kwin4_genericscripted.so

>> /usr/lib/qt/plugins/kwin/effects/configs/kcm_kwin4_genericscripted.so

$ kf5-config --path qtplugins

>> /usr/lib/plugins/:/usr/lib/qt/plugins/plugins/

$ qtpaths --plugin-dir

>> /usr/lib/qt/plugins

$ strace kcmshell5 kwinscripts 2>&1 | egrep "kcm_kwin4_genericscripted.so|metadata"

>> stat("./kcm_kwin4_genericscripted.so", 0x7ffc8f5f33b0) = -1 ENOENT (No such file or directory)
>> stat("./libkcm_kwin4_genericscripted.so", 0x7ffc8f5f33b0) = -1 ENOENT (No such file or directory)
>> stat("/usr/lib/qt/plugins/kcm_kwin4_genericscripted.so", 0x7ffc8f5f33b0) = -1 ENOENT (No such file or directory)
>> stat("/usr/lib/qt/plugins/libkcm_kwin4_genericscripted.so", 0x7ffc8f5f33b0) = -1 ENOENT (No such file or directory)
>> stat("/usr/bin/kcm_kwin4_genericscripted.so", 0x7ffc8f5f33b0) = -1 ENOENT (No such file or directory)
>> stat("/usr/bin/libkcm_kwin4_genericscripted.so", 0x7ffc8f5f33b0) = -1 ENOENT (No such file or directory)
>> stat("./kcms/kcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
>> stat("./kcms/libkcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
>> stat("/usr/lib/qt/plugins/kcms/kcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
>> stat("/usr/lib/qt/plugins/kcms/libkcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
>> stat("/usr/bin/kcms/kcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
>> stat("/usr/bin/kcms/libkcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
>> stat("./kcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
>> stat("./libkcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
>> stat("/usr/lib/qt/plugins/kcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
>> stat("/usr/lib/qt/plugins/libkcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
>> stat("/usr/bin/kcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
>> stat("/usr/bin/libkcm_kwin4_genericscripted.so", 0x7ffc8f5f3440) = -1 ENOENT (No such file or directory)
Comment 22 Bob Farmer 2016-06-29 07:18:55 UTC
If you're trying to fix this in an already-installed script, what I discovered is that there was a second .desktop file corresponding to the installed KWin script, inside: ~/.local/share/kservices5/

In Marc's comment #17 he implied that he was only editing the path for kcm_kwin4_genericscripted in his metadata.desktop file inside ~/.local/share/kwin/scripts/XXX/

After updating the path to "kwin/effects/configs/kcm_kwin4_genericscripted" in both locations, things work fine for me.