Fix the rcc binary package generation
ClosedPublic

Authored by bshah on Mar 24 2018, 12:17 PM.

Details

Summary

kpackage_install_bundled_package used install(CODE ..) for the
generation and installation of the rcc file. This had multiple flows,

  • It didn't respect the DESTDIR variable of install target which made

most of distribution packaging fail as it tried to write to installation
prefix directly.

  • It used the execute_process which resulted in the rcc file generation

at time of install instead of the build-time, so it would fail with
permission errors if make install is run as normal user

Test Plan
  • tested with kdeplasma-addons that it installs all the applets
  • it installs the content.rcc in $prefix/share/plasma/plasmoids/$id/

Diff Detail

Repository
R290 KPackage
Branch
fix-bundled-packages
Lint
No Linters Available
Unit
No Unit Test Coverage
bshah created this revision.Mar 24 2018, 12:17 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 24 2018, 12:17 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
bshah requested review of this revision.Mar 24 2018, 12:17 PM
bshah updated this revision to Diff 30385.
bshah edited the test plan for this revision. (Show Details)

update commit message

kossebau added inline comments.
KF5PackageMacros.cmake
158

This "Generating xyz" might be still good to have. Please consider picking this up with a

COMMENT "Generating: ${xyz}"

added to add_custom_command, where ${xyz} gets a proper variable name :) and as content the relative path to the current bin dir, by some

file(RELATIVE_PATH xyz ${CMAKE_CURRENT_BINARY_DIR} ${GENERATED_RRC_CONTENTS})

or possibly using directly without the xyz var ${component}-contents.rcc in the COMMENT message.

kossebau added inline comments.Mar 24 2018, 12:41 PM
KF5PackageMacros.cmake
158

And rather

COMMENT "Generating ${xyz}"

so without the ":" to follow the usual pattern.

apol requested changes to this revision.Mar 24 2018, 1:48 PM

See older reviews. This won't work because cmake doesn't know when one of the contained files is modified so rcc files are never regenerated properly.

I suggest actually checking DESTDIR.

This revision now requires changes to proceed.Mar 24 2018, 1:48 PM
bshah added a comment.Mar 24 2018, 2:05 PM
In D11642#232866, @apol wrote:

See older reviews. This won't work because cmake doesn't know when one of the contained files is modified so rcc files are never regenerated properly.

I've solution for that in mind.. will fix.

bshah updated this revision to Diff 30412.Mar 24 2018, 5:21 PM
  • regnerate rcc file on every build
  • add comment in add_custom_target for logging in build log
  • Fix the path in the qrc file which broke in previous attempt, plasma/plasmoids/<component>/ v/s plasma/plasmoids//
bshah marked 2 inline comments as done.Mar 24 2018, 5:34 PM
davidedmundson accepted this revision.Mar 24 2018, 10:23 PM

Seems to work \o/ Good stuff.

Ship this, but lets not rush the workspace changes back in without some more people verifying that.

kossebau added inline comments.Mar 25 2018, 2:21 AM
KF5PackageMacros.cmake
164

Does a plain ${KDE_INSTALL_DATADIR} not also work? The non-FULL variable variants are the ones used usually with install(). Not exactly sure why they are, but doing here as well would be consistent at least and less surprising.

bshah added inline comments.Mar 25 2018, 11:09 AM
KF5PackageMacros.cmake
164

I'll create seperate PR for that.

This revision was not accepted when it landed; it landed in state Needs Review.Mar 25 2018, 11:10 AM
This revision was automatically updated to reflect the committed changes.
bshah marked 2 inline comments as done.Mar 25 2018, 11:14 AM

opened PR for KDE_INSTALL_DATADIR : https://phabricator.kde.org/D11675

Edit.

Installation works, which is better.
However it still doesn't work properly.

make && install
Add a file to applets/digital-clock/contents/ui/Foo.qml with some valid QML

and then use it from main.qml

make && install

I get an error that the new file is not there.

This change cannot handle spaces in the path, which causes all CI builds involving RCC generation which have received this updated code to fail.
https://build.kde.org/job/Plasma%20plasma-pa%20kf5-qt5%20FreeBSDQt5.9/21/consoleText