After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 485806 - gtkdoc-check can't cope with BUILDDIR != SRCDIR
gtkdoc-check can't cope with BUILDDIR != SRCDIR
Status: RESOLVED INCOMPLETE
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-doc maintainers
gtk-doc maintainers
: 521784 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-10-11 17:21 UTC by Benjamin Otte (Company)
Modified: 2010-12-01 02:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Benjamin Otte (Company) 2007-10-11 17:21:36 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.
Comment 1 Yeti 2007-10-11 17:41:07 UTC
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).
Comment 2 John Carr 2007-12-29 11:32:13 UTC
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.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2008-03-20 12:50:34 UTC
*** Bug 521784 has been marked as a duplicate of this bug. ***
Comment 4 Martin Pitt 2009-07-01 06:52:27 UTC
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.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2009-12-19 20:37:53 UTC
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.
Comment 6 Sven Herzberg 2010-01-09 18:29:28 UTC
I hit that, too…
Comment 7 Sven Herzberg 2010-01-09 18:32:26 UTC
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.
Comment 8 Aleksander Morgado 2010-05-12 18:34:35 UTC
>   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.
Comment 9 Aleksander Morgado 2010-05-12 20:05:03 UTC
(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
Comment 10 Stefan Sauer (gstreamer, gtkdoc dev) 2010-10-04 09:25:52 UTC
(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.
Comment 11 Fabio Durán Verdugo 2010-12-01 02:06:35 UTC
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!