kservice_to_json dependency troubles

Aurélien Gâteau agateau at kde.org
Wed Nov 13 13:13:44 UTC 2013


Hi,

I have been investigating some weird build failures on build.kde.org, such 
as this one:

http://build.kde.org/job/kde-workspace_master_qt5/1432/console (error is
at 12:04:37)

I found out this is a dependency issue: the new json system should run
commands in this order (commands are simplified):

    desktoptojson \
        plasma-containmentactions-contextmenu.desktop \
        plasma-containmentactions-contextmenu.json

    moc menu.cpp -o menu.moc

    g++ menu.cpp -o menu.o

The kservice framework provides a macro to call desktoptojson:
kservice_desktop_to_json. The problem right now is that the macro does
not define a dependency to express that the json file should be
generated before moc is run.

I put together a new test for kservice to reproduce this problem, see
attached patch. It builds successfully with `make -j1` in the test dir,
but I am able to reproduce the build failure with `make -j4`.
(Note that you must manually rm the .json file from the build dir to
reproduce it over and over: `make clean` does not remove it)

I tried to express the missing dependency using various mixes of
OBJECT_DEPENDS, but I can't find a way to say: "this target must be
built before moc". Do you have any advice?

Aurélien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-test-for-kservice_desktop_to_json.patch
Type: text/x-patch
Size: 3361 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20131113/c67f8a2a/attachment.patch>


More information about the Kde-buildsystem mailing list