GNOME Bugzilla – Bug 485806
gtkdoc-check can't cope with BUILDDIR != SRCDIR
Last modified: 2010-12-01 02:06:35 UTC
I noticed this when running make distcheck: The $MODULE-undocumented.txt and $MODULE-unused.txt files are created in $srcdir and not in $builddir, where gtkdoc-check looks for them.
gtk-doc has been always broken for builddir != srcdir. It might manage to pass distcheck by making srcdir read-write and writing there, but that only illustrates how terribly broken it was. This particular issue should be fixed by the patches in bug 127049 (plus a new makefile, building in builddir, not available yet).
I use JHBuild to build gtk-doc, and after recently experimenting with the buildroot option came across something like this. The patch in #505534 fixes it for me, but i'm not sure if its the same problem or not.
*** Bug 521784 has been marked as a duplicate of this bug. ***
I stumbled over that yesterday. I fixed it simply with gtkdocize --copy sed -i 's/srcdir/builddir/g' gtk-doc.make This works perfectly for me. Just in case there's any doubt, here is how to reproduce this: git clone git://kernel.org/pub/scm/linux/hotplug/udev.git cd udev gtkdocize --copy autoreconf -i mkdir build; cd build ../configure --enable-gtk-doc make cd ../../../libudev/docs/html && gtkdoc-mkhtml libudev ../libudev-docs.xml warning: failed to load external entity "../version.xml" ../libudev-docs.xml:10: parser error : Failure to process entity version <releaseinfo>for libudev version &version;</releaseinfo> ^ ../libudev-docs.xml:10: parser error : Entity 'version' not defined <releaseinfo>for libudev version &version;</releaseinfo> ^ unable to parse ../libudev-docs.xml make[3]: *** [html-build.stamp] Error 6 This is because it looks for version.xml in the source tree instead of the build tree. If I do above seddery, it works fine.
Martin, sed -i 's/srcdir/builddir/g' gtk-doc.make is way too trivial. It won't build the docs you'd expect simply. Also you are interested in bug #127049 and not the checks.
I hit that, too…
gtkdoc-check could simply check for the $srcdir environment variable that automake sets while running test cases. If opening a file in the current folder fails, gtkdoc-check can easily fallback to trying in $srcdir, again.
> cd ../../../libudev/docs/html && gtkdoc-mkhtml libudev ../libudev-docs.xml > warning: failed to load external entity "../version.xml" > ../libudev-docs.xml:10: parser error : Failure to process entity version > <releaseinfo>for libudev version &version;</releaseinfo> > ^ > ../libudev-docs.xml:10: parser error : Entity 'version' not defined > <releaseinfo>for libudev version &version;</releaseinfo> > ^ > unable to parse ../libudev-docs.xml > make[3]: *** [html-build.stamp] Error 6 > > This is because it looks for version.xml in the source tree instead of the > build tree. If I do above seddery, it works fine. The proper way to fix this seems to be (as per bug 314105): MKHTML_OPTIONS=--path="$(abs_builddir)" That will consider also the files in builddir, version.xml in this case.
(In reply to comment #5) > Martin, > sed -i 's/srcdir/builddir/g' gtk-doc.make > is way too trivial. It won't build the docs you'd expect simply. Also you are > interested in bug #127049 and not the checks. Just as reference, found already someone doing exactly that, I believe: http://patches.ubuntu.com/by-release/extracted/debian/u/udev/146-2/gtk-doc-builddir
(In reply to comment #8) > > cd ../../../libudev/docs/html && gtkdoc-mkhtml libudev ../libudev-docs.xml > > warning: failed to load external entity "../version.xml" > > ../libudev-docs.xml:10: parser error : Failure to process entity version > > <releaseinfo>for libudev version &version;</releaseinfo> > > ^ > > ../libudev-docs.xml:10: parser error : Entity 'version' not defined > > <releaseinfo>for libudev version &version;</releaseinfo> > > ^ > > unable to parse ../libudev-docs.xml > > make[3]: *** [html-build.stamp] Error 6 > > > > This is because it looks for version.xml in the source tree instead of the > > build tree. If I do above seddery, it works fine. > > The proper way to fix this seems to be (as per bug 314105): > MKHTML_OPTIONS=--path="$(abs_builddir)" > > That will consider also the files in builddir, version.xml in this case. This is Bug #127049. (in replay to comment 7) > gtkdoc-check could simply check for the $srcdir environment variable that > automake sets while running test cases. If opening a file in the current > folder fails, gtkdoc-check can easily fallback to trying in $srcdir, again. $srcdir is not exported. It is only avaioable in the makefile context. Anyway, I made improvements in the git version. One needs to update the Makefile.am to benefit from the changes. The solution is to export $srcdir and $builddir in the TEST_ENVIRONMENT so that gtkdoc-check and look for the files in both cases. The change in Makefile.am is not causing problems for older gtk-doc version. It is still failing for those though. Could you please retest and let me know if that works for you.
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!