This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ZxmoVniKIwgQCM1AUTplfk81mfRhAfdzq Content-Type: multipart/mixed; boundary="3qAEQ337jaoC813Z7SDymH0l9XRa51kz7" --3qAEQ337jaoC813Z7SDymH0l9XRa51kz7 Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 19.10.20 17:06, Milian Wolff wrote: > On Montag, 19. Oktober 2020 16:56:27 CEST Harald Sitter wrote: >> On 19.10.20 12:30, Milian Wolff wrote: >>> On Montag, 19. Oktober 2020 11:27:29 CEST Harald Sitter wrote: >>>> Yo >>>> >>>> On 18.10.20 10:11, Milian Wolff wrote: >>>>> Hey all, >>>>> >>>>> since some time now I'm only compiling parts of KF5 selectively int= o a >>>>> custom prefix. Most notably, I'm only interested in ktexteditor and= >>>>> syntax- highlighting, and would like to obtain all other frameworks= >>>>> through my distribution packages. >>>>> >>>>> Sadly, this doesn't work as easily, as ktexteditor is trying to do = this: >>>>> >>>>> ``` >>>>> install(TARGETS kauth_ktexteditor_helper DESTINATION $ >>>>> {KAUTH_HELPER_INSTALL_DIR} ) >>>>> kauth_install_helper_files(kauth_ktexteditor_helper >>>>> org.kde.ktexteditor.katetextbuffer root) >>>>> kauth_install_actions(org.kde.ktexteditor.katetextbuffer buffer/ >>>>> org.kde.ktexteditor.katetextbuffer.actions) >>>>> ``` >>>>> >>>>> Because my KAuth is a system-provided installation, and KTextEditor= >>>>> should >>>>> be installed into a user-writable prefix, I get this error on `ninj= a >>>>> install`: >>>>> >>>>> ``` >>>>> >>>>> CMake Error at src/cmake_install.cmake:143 (file): >>>>> file INSTALL cannot copy file >>>>> "/home/milian/projects/kf5/build/frameworks/ktexteditor/src/ >>>>> >>>>> org.kde.ktexteditor.katetextbuffer.policy" >>>>> >>>>> to >>>>> "/usr/share/polkit-1/actions/org.kde.ktexteditor.katetextbuffer.p= olicy >>>>> " >>>>> =20 >>>>> Permission denied. >>>>> >>>>> Call Stack (most recent call first): >>>>> cmake_install.cmake:77 (include) >>>>> >>>>> ``` >>>>> >>>>> I can workaround this by either commenting out the kauth install bi= ts in >>>>> ktexteditor or by installing kauth seperately too. But both are in = my >>>>> opinion not ideal. >>>>> >>>>> I don't think it's currently possible to overwrite the KAuth instal= l >>>>> directory at cmake configure time. I would like to change that, unl= ess >>>>> there is something I'm missing which would prevent this? I am hopin= g >>>>> that >>>>> any folder works as long as it's listed in the `XDG_DATA_DIRS` env = var - >>>>> can someone confirm this? >>>> >>>> Alas, the path is hardcoded at buildtime from what I see: >>>> https://gitlab.freedesktop.org/polkit/polkit/-/blob/master/src/polki= tback >>>> end /polkitbackendinteractiveauthority.c#L302 >>>> >>>> Relevant: https://bugs.kde.org/show_bug.cgi?id=3D425272 >>> >>> So the path that needs to be used is actually the polkit path? >> >> That's my understanding of the code, yes. >> >>> Meaning the >>> question where KAuth is being installed to doesn't really matter? Tha= t >>> would imply that KAuth is broken anyways when it's not installed to t= he >>> same prefix that polkit is being installed to, no? >> >> Nope. If the policy was installed to a different path it would be >> broken, but the very error you posted is because kauth is insisting on= >> putting the policy in the correct path rather than the prefix the rest= >> of the build is installing to. >=20 > No, it's using the install location of kauth, it doesn't query polkit i= tself.=20 > I.e. if I hand-compile KAuth and install into a custom prefix, then I w= ill=20 > have: >=20 > ``` > $ grep INSTALL /home/milian/projects/compiled/kf5-dbg/lib/cmake/KF5Auth= / > KF5AuthConfig.cmake > set(KAUTH_POLICY_FILES_INSTALL_DIR "/home/milian/projects/compiled/kf5/= share/ > polkit-1/actions") > set(KAUTH_HELPER_INSTALL_DIR "lib/libexec/kauth") > set(KAUTH_HELPER_INSTALL_ABSOLUTE_DIR "/home/milian/projects/compiled/k= f5/lib/ > libexec/kauth") > ``` Ohh! This is indeed plain silly. I had thought it would use the value from pkgconfig :S > Now I can happily compile e.g. ktexteditor against this, but it would b= e just=20 > as broken as the polkit files it installed will never be found anyways.= >=20 > So, I guess there are two things to solve here: >=20 > a) make it easy to opt-out / disable kauth polkit file installation via= a=20 > cache var in the `kauth_install_*` cmake macros, such that I can just d= isable=20 > that when building ktexteditor. I'm not sure it's a good idea, but we could treat this like KDE_INSTALL_USE_QT_SYS_PATHS. By default we'll simply install to $CMAKE_PREFIX/share/polkit-1/actions/ unless explicitly configured with KDE_INSTALL_USE_POLKIT_PATHS in which case we'll use whatever polkit uses= =2E What sets this apart from qt_syspath of course is that not using the polkit path basically never makes sense as it'd be broken. So maybe the default state should be ON and when one is sure that polkit isn't needed one could turn it OFF. > b) find a way to query polkit for the right path to use and use that by= =20 > default instead of the kauth install prefix. polkit-gobject-1's pkgconfig encodes the path. So that's easy. HS --3qAEQ337jaoC813Z7SDymH0l9XRa51kz7-- --ZxmoVniKIwgQCM1AUTplfk81mfRhAfdzq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEmUvOVl9TGc6jhe6fuSpfBOyUkSEFAl+NrvgACgkQuSpfBOyU kSEIyA/+Mc9E47E5GctXICMdV7FDjerDPfLaBBLZ1DuaB0pJjfj7jJlpAnZpHae1 yI2HTXuQ90w2RievFzOzCMI5jUAIv0ZVb0wdXJGW3hwwwKxvk6yIugREfXy7wafh cEoOsVXtKWnrh5PITRDVXeffDEFSYNkWyf5wOla/e48LGHdY5zGwGyAQFM9TR59q m6M5SKMqyg06oUckuQL3WevwE6YI7bZz9blGnc2qM1p8tDYXd1GCVyvsE9nc4yY4 W8GO6bch0D1I8bhMhMYPykXKfgMCMwlC7ieKeA4XDxN4TMMiwhXGMzT9utpit+wO IuNz4pOL+iAWUEypMs64+yfazekgX22HKboF3CtM6+3fF/6N8pl04VwnnG7CAVro BhfgtFlF+Veu6wwj/2X709KF2VXT0RnZUBQxJTxW3i1tCQ9A0qeOOFtbdhLtO2+J hOCmjPzVSnh0r013WATufRArRcOmchwZ89QCf4WN1xiN5a5+UuVJTJjxLAHHGhJe 0yLZzgr4nOYIjGGmTshzRETliU3QcYnYbgVELZqfLkLAglcR6crNUIoEvmyh5eG1 73AU+YA26IdxK7Y/tjxqs6ysiNCW1EbORGp2EMmC6LHiBOxtBkyruMqhF4cqa2Qz A29M1ZAZfZZTmEGXlWNFjDrqg0udzNEOeocQ7mBU4wYcFLl4U+8= =ZZky -----END PGP SIGNATURE----- --ZxmoVniKIwgQCM1AUTplfk81mfRhAfdzq--