Bug 8273 - openjade-native doesn't remove from sysroot correctly
Summary: openjade-native doesn't remove from sysroot correctly
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 1.9
Hardware: All Multiple
: Medium normal
Target Milestone: 2.2 M4
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
: 10202 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-09-09 19:41 UTC by Ross Burton
Modified: 2016-09-19 12:41 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2015-09-09 19:41:51 UTC
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.
Comment 1 Ross Burton 2016-07-01 11:00:57 UTC
Reassigning to Alex, I think this might end up needing to be solved as part of gtk-doc.
Comment 2 Alexander Kanavin 2016-07-05 18:24:57 UTC
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?
Comment 3 Alexander Kanavin 2016-07-05 20:29:02 UTC
The code that does file removal was added in ccb2d1b481c0fba69c06a0c0f2553e2a45ee937a, so reassigning to Richard.
Comment 4 Alexander Kanavin 2016-07-06 09:39:21 UTC
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.
Comment 5 Robert Yang 2016-09-03 02:46:57 UTC
*** Bug 10202 has been marked as a duplicate of this bug. ***
Comment 6 Alexander Kanavin 2016-09-05 11:44:36 UTC
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.
Comment 7 Richard Purdie 2016-09-15 11:21:27 UTC
I'd be happy to see the sgml stuff dropped, in the meantime, I was able to fix this rebuild issue.
Comment 8 Ross Burton 2016-09-19 12:41:57 UTC
Fixed in oe-core cdae3e76232110903d124195b036e4e70fb28aa4.