If in a build it is determined that openjade-native needs to be rebuilt it is removed from the sysroot but the catalog in /etc/sgml/sgml-catalog isn't updated to remove the references so the sgml-common-native postinstall fails: | DEBUG: Staging files from /data/poky-master/tmp/work/x86_64-linux/sgml-common-native/0.6.3-r1/sysroot-destdir/data/poky-master/tmp/sysroots/x86_64-linux to /data/poky-master/tmp/sysroots/x86_64-linux | DEBUG: Executing shell function sgml_common_sstate_postinst | install-catalog: addition of /data/poky-master/tmp/sysroots/x86_64-linux/etc/sgml/sgml-ent.cat in /data/poky-master/tmp/sysroots/x86_64-linux/etc/sgml/sgml-docbook.cat | Warning: /data/poky-master/tmp/sysroots/x86_64-linux/etc/sgml/sgml-ent.cat is already installed in the centralized catalog /data/poky-master/tmp/sysroots/x86_64-linux/etc/sgml/sgml-docbook.cat | install-catalog: addition of /data/poky-master/tmp/sysroots/x86_64-linux/etc/sgml/sgml-docbook.cat in /data/poky-master/tmp/sysroots/x86_64-linux/etc/sgml/catalog | install-catalog: "/data/poky-master/tmp/sysroots/x86_64-linux/etc/sgml/openjade-1.3.2.cat" does not exist or is empty. | WARNING: exit code 2 from a shell command. | DEBUG: Python function sstate_task_postfunc finished | ERROR: Function failed: sgml_common_sstate_postinst (log file is located at /data/poky-master/tmp/work/x86_64-linux/sgml-common-native/0.6.3-r1/temp/log.do_populate_sysroot.24001) ERROR: Task 55 (/home/ross/Yocto/poky/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb, do_populate_sysroot) failed with exit code '1' openjade-native has a CLEANFUNC but clearly this isn't being executed correctly or at all.
Reassigning to Alex, I think this might end up needing to be solved as part of gtk-doc.
What happens here is that sstate.bbclass is removing all the files installed by the recipe, but does not execute CLEANFUNCS (which would, if executed, update the sgml catalog so that it does not anymore refer to deleted files). Then, the catalog continues to refer to a deleted file, and the build breaks down. CLEANFUNCS is only executed via do_clean, and I don't know how to force its execution prior to building a package. Hints?
The code that does file removal was added in ccb2d1b481c0fba69c06a0c0f2553e2a45ee937a, so reassigning to Richard.
How to reproduce: bump the PR in sgml-common (not sgml-common-native as it gets overriden) and openjade-native to force the sysroot cleaning of openjade-native and building of sgml-common-native. Then build sgml-common-native, and it will fail - because openjade catalog was removed, but index was not updated. Potential fix (from chat with RP): to write an rm file alongside the manifest and execute that at manifest uninstall time. Cleaning sysroots is not done in context of single recipes, and so hooking into them (for purposes of executing CLEANFUNCS defined there) might be tricky.
*** Bug 10202 has been marked as a duplicate of this bug. ***
Another 'solution' is to drop the SGML stack entirely. I'll investigate who is using it and for what, I have a gut feeling it's more or less obsoleted by XML. That has certainly happened in gtk-doc, which nowadays supports XML only.
I'd be happy to see the sgml stuff dropped, in the meantime, I was able to fix this rebuild issue.
Fixed in oe-core cdae3e76232110903d124195b036e4e70fb28aa4.