Bug 382874

Summary: Environment setting in Launch Configuration does not work properly for `kcmshell5 about-distro`
Product: [Applications] kdevelop Reporter: Gregor Mi <codestruct>
Component: generalAssignee: kdevelop-bugs-null
Status: RESOLVED WAITINGFORINFO    
Severity: minor CC: mail
Priority: NOR    
Version First Reported In: 5.1.1   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Gregor Mi 2017-07-28 22:40:34 UTC
1) I modified ~/kde/src/kde/workspace/kinfocenter/Modules/about-distro with KDevelop and installed it into ~/kde/usr (the original code was build with kdesrc-build).
2) When I call `kcmshell5 about-distro` from the Konsole outside KDevelop with proper environment variables set, then the modified About Distro is loaded.
3) When I do the same from KDevelop with the same environment variables set in the Launch Configuration -> Environment setting, then the system version of the About Distro dialog is loaded instead of the modified one.

I verified that indeed ~/kde/usr/kcmshell5 is used and made sure the environment variables are correct by using the output of `env` for the Environment setting.

Should this be working like this or am I missing something when I deal with kcmshell5 from within KDevelop?
Comment 1 Kevin Funk 2017-07-31 07:07:10 UTC
I don't see why that should not work if the environment variables are the same.

You'll need to provide more information and/or investigate yourself.
Comment 2 Gregor Mi 2017-08-03 10:25:11 UTC
I suspect that the problem has something to do with the dynamic loading mechanism of the System settings KCMs. Maybe someone who is familiar with this mechanism and uses KDevelop for KDE/Plasma development could provide some ideas where to look further or maybe try to reproduce the wrong behaviour I observe.
Comment 3 Sven Brauch 2017-08-03 12:29:52 UTC
Did you try lauching just "env" and seeing what is in there? Environment variables inside the AppImage are rather complicated.
Comment 4 Gregor Mi 2017-08-03 13:19:29 UTC
When I tried to launch just "/usr/bin/env" I could not copy the output properly into a text file for comparing. So I launched Konsole and from there "env" if that is also OK.

I found these notable differences between my KF5 environment and the KDevelop environment:

Existent on KDevelop environment but not in my traditional KF5 env:
   APPDIR=/tmp/.mount_0dd2si
   APPIMAGE=/home/gregor/bin/apps/KDevelop-5.1.1-x86_64.AppImage
   KDE_FORK_SLAVES=1
   KONSOLE_DBUS_WINDOW=/Windows/1
   LD_PRELOAD=/tmp/.mount_0dd2si/exec_wrapper.so

Non-existent on KDevelop environment but in my traditional KF5 env:
   QML2_IMPORT_PATH=/home/gregor/kde/usr/lib/qml:/home/gregor/kde/usr/lib64/qml:/home/gregor/kde/usr/lib/x86_64-linux-gnu/qml:/usr/qml
   QT_PLUGIN_PATH=/home/gregor/kde/usr/lib/plugins:/home/gregor/kde/usr/lib64/plugins:/home/gregor/kde/usr/lib/x86_64-linux-gnu/plugins:/usr/plugins:

This is interesting because the last two variables (QML2_IMPORT_PATH, QT_PLUGIN_PATH) are definitely set in the KDev Environment dialog but not appear in the env output from KDevelop.