The following commit https://cgit.kde.org/kwallet.git/commit/?id=0ba2aeadc90823515f03a1536d2f1838aace39fe makes the exec line absolute which does not work on Windows. Service executables are located in the bin dir and relative pathes will not work in any cases. [1][2] Instead on Windows the resulting Exec line should be: Exec=kwalletd5 which means the template need to have some like this +Exec=@SOME_PREFIX@kwalletd5 to be removable and ecm KDEInstallDirs.cmake needs to set this variable to empty on Windows This topics affects any dbus service file provided in any frameworks library. [1] https://mail.kde.org/pipermail/kde-buildsystem/2011-October/008227.html [2] https://lists.freedesktop.org/archives/dbus/2016-June/016949.html.
Well, the previous commit made the path relative. This broke autostart on linux. Was it working a few commits ago when org.kde.kwalletd5.service.in had : Exec=@CMAKE_INSTALL_PREFIX@/bin/kwalletd5 ?
(In reply to Christophe Giboudeaux from comment #1) > Well, the previous commit made the path relative. This broke autostart on > linux. > > Was it working a few commits ago when org.kde.kwalletd5.service.in had : > Exec=@CMAKE_INSTALL_PREFIX@/bin/kwalletd5 ? The short answer is no, for the long see below: According to dbus spawn implementation (see https://cgit.freedesktop.org/dbus/dbus/tree/dbus/dbus-spawn-win.c#n572) and CreateProcess implementation (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx) the search order for executables is only specified deterministic if the file name does not contain a directory path. Having any relative path results into having the current dir be added in front of the relative either if it would be Exec=./bin/kwalletd5 or Exec=../bin/kwalletd5 which is unreliable.
mmmh... so : - an absolute path breaks things on windows, - @CMAKE_INSTALL_PREFIX@/bin/foo breaks things for people using something different than 'bin' for binaries and Windows - and a relative path breaks things for every other users. out of curiosity, do services installed in libexec dirs work ? eg : org.kde.kssld5.service & org.kde.kioexecd.service have Exec=@KDE_INSTALL_FULL_LIBEXECDIR@/kf5/kiod5
(In reply to Christophe Giboudeaux from comment #3) > mmmh... so : > - an absolute path breaks things on windows, > - @CMAKE_INSTALL_PREFIX@/bin/foo breaks things for people using something > different than 'bin' for binaries and Windows > - and a relative path breaks things for every other users. > > out of curiosity, do services installed in libexec dirs work ? eg : without source code changes no, see bug 382459 and bug 382460. Source codes changes means if the related tool is only started under control of some library the full path to the executable in libexec needs to be calculated based on the runtime install root path of the application/library.
Review request https://phabricator.kde.org/D9383