Problem building appstream using kdesrc-build

I’m having problem using kdesrc-build - the appstream package fails to build with the following errors:

[200/251] Generating data/gen-output with a custom command
FAILED: data/nol10n_withrelinfo_org.freedesktop.appstream.cli.metainfo.xml 
/home/odeda/kde/build/appstream/tools/appstreamcli news-to-metainfo --limit=6
  ../../src/appstream/data/../NEWS ../../src/appstream
/home/odeda/kde/build/appstream/tools/appstreamcli: symbol lookup error: 
  /home/odeda/kde/build/appstream/tools/appstreamcli: undefined symbol:

I figured that as_component_box_is_empty is a method from src/as-component-box.c, which - according to is supposed to be linked in properly. What am I missing?

Do you still have this issue?

I frequently have symbol lookup error when I build appstream. So far I always could solve it by kdesrcbuild with --refresh-build or nuking my kde/usr folder.

After I ran --refresh-build, I still get a symbol lookup error when building appstream, though on a different symbol:

...kde/build/appstream/tools/appstreamcli: symbol lookup error: 
  ...kde/build/appstream/tools/appstreamcli: undefined symbol:

I figure out the problem - its with the appstream build script: It tries to run appstreamcli after the build for something (“NEWS” or some such), like so:

  news-to-metainfo --limit=6 ../../src/appstream/data/../NEWS
   ../../src /appstream/data/org.freedesktop.appstream.cli.metainfo.xml

But this is the newly built tool, and it needs the newly built libraries to run, but it isn’t using the new libraries:

$ ldd /home/odeda/kde/build/appstream/tools/appstreamcli (0x00007fff78c78000) => /home/odeda/kde/usr/lib/x86_64-linux-gnu/ (0x00007fe983112000)

It is using the libraries from the previous build - these older builds have different code and would not work with an executable that targets new symbols.

Running the same command, while setting LD_PRELOAD to load the freshly build library - completes successfully.

Now I just need to figure out how to change the build script to do that automatically.

It seems that simply deleting the old build results at /home/odeda/kde/usr/lib/x86_64-linux-gnu before starting a new build (or just the offending library, when resuming from a specific project) solves the problem…


OK, to reiterate - kdesrc-build is completely borked.

I just had plasma-workspace fail to build because a header file from kjobwidgets had an old API that was incompatible with a (updated) header from knotifications. Rebuilding kcoreaddons, knotifications, kwidgetaddons and/or kjobwidgets could not get that solve - i.e. after a successful build (multiple times) the offending header file was still installed. Only deleting all the kjobwidgets header files manually (is there an automatic process to “uninstall a kdesrc-build built package”?) a rebuild of kjobwidgets got the correct files installed and let the plasma-workspace build complete.

I get a feeling that it is not possible to do incremental builds with kdesrc-build - if you don’t do a complete nuke and pave every time (and wait the >10 hours for a new from-scratch build to complete), it is almost guaranteed that the build will fail.

You can instead use the --use-clean-install flag. It will attempt to uninstall the files in kde/usr related to the program before installing the new ones, so it might fix some issues.