This issue is documented in [1] and there is a workaround (building polkit-qt-1 and then rebuilding kauth), but still, it would be nice to have it fixed. [1]: https://techbase.kde.org/Getting_Started/Build/Troubleshooting#Issues_building_kdebase Reproducible: Always Steps to Reproduce: 1. git clone git://anongit.kde.org/kwalletmanager.git && cd kwalletmanager 2. mkdir build && cd build 3. cmake -DCMAKE_INSTALL_PREFIX=~/foo .. 4. make install Actual Results: CMake Error at src/konfigurator/cmake_install.cmake:92 (file): file INSTALL cannot copy file "/home/elvis/kwalletmanager/build/src/konfigurator/org.kde.kcontrol.kcmkwallet5.policy" to "/usr/share/polkit-1/actions/org.kde.kcontrol.kcmkwallet5.policy". a.k.a. kauth_install_actions ignores my CMAKE_INSTALL_PREFIX and tries to install in /usr/share/polkit-1/actions/ Expected Results: make install exits without error a.k.a. kauth_install_actions (called by kwalletmanager) respects CMAKE_INSTALL_PREFIX.
Can polkit be instructed to also look into other directories? From what I know, both dbus and polkit only check the system directories, because of security reasons. It might be possible to expand this path of system directories.
(In reply to Christoph Feck from comment #1) > Can polkit be instructed to also look into other directories? From what I > know, both dbus and polkit only check the system directories, because of > security reasons. It might be possible to expand this path of system > directories. The techbase link above does mention a KDE4_AUTH_POLICY_FILES_INSTALL_DIR cmake variable that used to be configurable via command line. Nowadays doesn't seem to work anymore (KAuth has a KAUTH_POLICY_FILES_INSTALL_DIR variable, but I'm not sure it can be overriden). dbus doesn't seem affected, e.g. kwalletmanager install the following dbus files just fine: -- Installing: /home/elvis/test/etc/dbus-1/system.d/org.kde.kcontrol.kcmkwallet5.conf -- Installing: /home/elvis/test/share/dbus-1/system-services/org.kde.kcontrol.kcmkwallet5.service
> kwalletmanager install the following dbus files just fine But you also need to add these directories to /etc/dbus-1/*.conf For details, see https://dbus.freedesktop.org/doc/dbus-daemon.1.html
Would it be possible to not install the policy file if an install prefix is set?
I just realised, that this would make packaging impossible. But I looked into actual packaging and found that setting DESTDIR on installation resolves the issue.
*** Bug 397517 has been marked as a duplicate of this bug. ***
This issue is more broad than just the polkit case and currently hinders building and installing plasma-desktop locally without kdesrc-build, and I assume this should affect any other KDE software that uses KAUTH_HELPER_INSTALL_DIR. There's a relevant mailing list thread about this: https://mail.kde.org/pipermail/kde-core-devel/2020-October/091002.html It is not possible to bypass this permission issue in any way. I tried with all of these, none worked: KAUTH_HELPER_INSTALL_DIR INSTALL_BROKEN_KAUTH_POLICY_FILES KAUTH_BACKEND_NAME KAUTH_POLICY_FILES_INSTALL_DIR KDE4_AUTH_POLICY_FILES_INSTALL_DIR And I tried numerous combinations of CMAKE_INSTALL_PREFIX and DESTDIR in my attempts to make this work for months, thinking this was perhaps some user error on my side. So currently the only ways of testing software that uses this KAuth feature without kdesrc-build are: * install everything as root, which is liable to break things And assuming you actually know about this issue, what's happening in the background and what to do with this cryptic error message: * CMAKE_INSTALL_PREFIX=/local/path then sudo install, thus overriding the package manager's installed files * comment out the install line in the CMakeLists.txt that uses KAUTH_HELPER_INSTALL_DIR * compile KAuth together with the application one wants to compile Use case: I was trying to self compile plasma-desktop just to work on a KCM which isn't related and doesn't use KAUTH_HELPER_INSTALL_DIR anywhere.
I'm going to leave these references here one shows polkit hardcoding /usr and one shows dbus hardcoding /usr. https://gitlab.freedesktop.org/polkit/polkit/-/blob/92b910ce2273daf6a76038f6bd764fa6958d4e8e/src/polkitbackend/polkitbackendinteractiveauthority.c#L302 https://gitlab.freedesktop.org/dbus/dbus/-/blob/9722d621497b2e7324e696f4095f56e2a9307a7e/bus/activation-helper.c#L422
>I'm going to leave these references here one shows polkit hardcoding /usr and one shows dbus hardcoding /usr. By my understanding this shows, that for the use case Thiago described, skipping the installation is the most sensible option.
As Harald pointed out, there is the INSTALL_BROKEN_KAUTH_POLICY_FILES cmake option. However, this is only used inside of the KAUTH_INSTALL_ACTIONS function. Meaning the KAuth config paths will not respect those settings. An alternative might be to allow overriding the KAuth backend that is used and then set the KAuth variables accordingly to the CMAKE_INSTALL_PREFIX. Then projects like plasma-desktop can installed, without some files getting installed to /usr. What do you think?
Ran into this while trying to extend a KAuth helper; really unfortunate developer experience. If we don't have a good way to resolve the root issues, perhaps someone familiar could at least update the KAuth guide with information about how to properly build and test: https://develop.kde.org/docs/features/kauth/using_kauth/