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 650407 - Buildings docs while distchecking produces thousands of “No declaration found” warnings, then fails.
Buildings docs while distchecking produces thousands of “No declaration found...
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
1.17
Other Linux
: Normal blocker
: 1.18
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2011-05-17 16:46 UTC by Will Thompson
Modified: 2011-09-08 16:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Will Thompson 2011-05-17 16:46:46 UTC
With gtk-doc 1.17 (gtk-doc-tools 1.17-2 in Debian Unstable), distchecking telepathy-glib master yields 2859 “No declaration found for:” warnings, and then the build fails:

chmod: cannot access `../../../docs/reference/version.xml': No such file or directory
make[4]: [../../../docs/reference/../../../docs/reference/version.xml] Error 1 (ignored)
echo 0.14.999.1 > ../../../docs/reference/version.xml
gtk-doc: Building HTML
warning: failed to load external entity "../version.xml"
../telepathy-glib-docs.sgml:10: parser error : Failure to process entity tpglibversion
      This manual documents telepathy-glib version &tpglibversion;.
                                                                  ^
../telepathy-glib-docs.sgml:10: parser error : Entity 'tpglibversion' not defined
      This manual documents telepathy-glib version &tpglibversion;.
                                                                  ^
unable to parse ../telepathy-glib-docs.sgml
make[4]: *** [html-build.stamp] Error 6

Building the documentation in-tree with a regular `make` invocation works fine. If I downgrade to 1.15, I can also distcheck (relatively) successfully.

I think 2859 is roughly “every symbol in telepathy-glib”. Interestingly, all the HTML documentation is apparently successfully built in the distcheck directory. telepathy-glib-undocumented.txt and telepathy-glib-undeclared.txt contain 1438 and 1169 symbols respectively.

I have not spent much time debugging this. I may try to figure out what's going on when I have some spare time. I'm surprised no-one else has hit something similar in other projects: is telepathy-glib's documentation really exceptional enough to break gtk-doc?

Full output of configure && make && make distcheck is at http://people.collabora.com/~wjt/tmp/tp-glib-master-distcheck-gtk-doc-failure.txt

You can grab telepathy-glib from `git clone git://anongit.freedesktop.org/telepathy/telepathy-glib`.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2011-05-17 16:56:58 UTC
I hope the debian folks have followed my advice and included an extra patch (the .2 hints that they do). I'll try to took at this later on but in the long run the only feasible way is that people test the git version from time to time, specially when I ask to do so in prep for a release.
Would it be possible for you to try the git version to see if it is fixed already?

A quick guess of mine is that version.xml is not listed under content_files=...
Could you try such change.
Comment 2 Will Thompson 2011-05-18 11:37:16 UTC
The only patch in Debian's -2 package is the one that fixes the invocation of highlight, I believe.

gtk-doc master has the same issue.

Adding version.xml to content_files does fix that issue, but it doesn't fix ~every symbol ending up in -undocumented.txt. telepathy-glib's 'make check' checks that -undocumented and -unused are empty, so the build fails. (In fact, it's checking the wrong location: it assumes that these files will be written to the srcdir, as gtk-doc did in the past, but now they end up in the builddir. I can't find which commit introduced this change. So I will fix tp-glib to cope with either (for compatibility with older gtk-doc versions.).)

I'll see about bisecting the issue later.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2011-05-18 11:54:29 UTC
Don't bisect - the big change in 1.17 is that it does out-of-sourcedir builds. Before it was chmod +r $srcdir and building in srcdir, which is a bad hack. The crux is that not all the buildtools support searchpaths for files, this gtk-doc needs to copy files to builddir for out-of-srcdir builds.

I'll try building it myself. if possible, please joinf #gtkdoc on gimpnet irc.
Comment 4 Fabio Durán Verdugo 2011-07-08 03:18:48 UTC
any news for this report?
Comment 5 Will Thompson 2011-07-29 14:44:31 UTC
Finally got around to looking at this again.

The issue seems pretty simple now I look at it with a clear mind. Since 1.17, DOC_SOURCE_DIRS is considered relative to the build dir, not the source dir. (Contradicting the example Makefile.am: http://git.gnome.org/browse/gtk-doc/tree/examples/Makefile.am#n21 )

So if I change

  DOC_SOURCE_DIRS=../../telepathy-glib

to:

  DOC_SOURCE_DIRS=$(srcdir)/../../telepathy-glib

it works again.

I guess the options are, either respect the old meaning of this variable and interpret DOC_SOURCE_DIRS relative to the source dir, or update the example and expect projects to update theirs if they want out-of-tree builds to work. (Setting it to DOC_SOURCE_DIRS=$(abs_top_srcdir)/foo should work out-of-tree with both old and new gtk-docs, I suppose.)
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2011-08-03 12:48:39 UTC
There have been no such changes in scan. But that might have happened indirectly as gtk-doc now supports out-of-srcdir builds. Thats why you see that in make distcheck :/

I could fix that in the makefiles by adding $(srcdir) for relative paths

scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
	@echo '  DOC   Scanning header files'
	@_source_dir='' ; \
	for i in $(DOC_SOURCE_DIR) ; do \
	    _source_dir="$${_source_dir} --source-dir=$$i" ; \
	done ; \
	gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)

or ask everybody to use absolute paths and fix the example. Any opinion?

I never noticed as I was using this form in my projects:
DOC_SOURCE_DIR=$(top_srcdir)/src/xxx
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2011-09-08 16:49:57 UTC
No complaints received. The 1.18 release notes will contain a suggestion to use 
DOC_SOURCE_DIR=$(top_srcdir)/src/xxx and the example Makefile.am has been updated. Sorry for the hassle.