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 581237 - gtk-doc uses wrong gtkdoc-check in "make check" phase
gtk-doc uses wrong gtkdoc-check in "make check" phase
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: 1.12
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-04 00:28 UTC by Mart Raudsepp
Modified: 2009-11-25 22:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mart Raudsepp 2009-05-04 00:28:28 UTC
There were some changes in trunk about allowing gtk-doc to run tests when the system doesn't have gtk-doc installed yet, but it doesn't seem to quite work.

tests/gtkdoctest.sh makes a direct call to gtkdoc-check, but that is the system gtkdoc-check, not the one just "compiled", so if the system doesn't have any gtk-doc installed yet, the tests fail.
However it is also wrong because it's testing the system gtk-doc's gtkdoc-check instead of what's currently being compile/installed/developed.

The line in question is:

cd $dir/$suite/docs && gtkdoc-check
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2009-05-04 08:03:27 UTC
this shold actually be addressed by these line in tests/Makefile.am. Are you having a recent svn trunk/git head?

TESTS_ENVIRONMENT = \
	PATH=$(abs_top_builddir):$(srcdir):$(PATH) \
	PERL5LIB=$(abs_top_builddir):$(PERL5LIB)
Comment 2 Mart Raudsepp 2009-05-09 16:36:43 UTC
No, I only saw it fail in gtk-doc-0.11 and looked that git had a plain call to gtkdoc-check still, didn't figure to check if the necessary stuff isn't exported elsewhere by some means
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2009-05-09 19:03:49 UTC
Yes the testscript has a plain call to gtkdoc-check, but the Makefile.am defines TESTS_ENVIRONMENT and this is activated when you run make check. IMHO, this works with the comming gtk-doc-0.12. Please close if you can confirm.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2009-05-25 18:46:10 UTC
Please reopen if its still an issue.
Comment 5 Mart Raudsepp 2009-09-20 07:20:26 UTC
No, it still doesn't work.
Now it gets stuck in tests/annotations/doc gtkdoc-mkhtml calls, it seems TESTS_ENVIRONMENT doesn't apply recursively to subdirs
Comment 6 Mart Raudsepp 2009-09-20 07:22:02 UTC
make  check-local
make[3]: Entering directory `/tmp/portage/dev-util/gtk-doc-1.11/work/gtk-doc-1.11/tests/annotations/docs'
gtk-doc: Scanning header files
Can't locate gtkdoc-common.pl in @INC (@INC contains: /usr/share/gtk-doc/data /etc/perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux /usr/lib64/perl5/vendor_perl/5.8.8 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux /usr/lib64/perl5/site_perl/5.8.8 /usr/lib64/perl5/site_perl /usr/lib64/perl5/5.8.8/x86_64-linux /usr/lib64/perl5/5.8.8 /usr/local/lib/site_perl .) at ../../../gtkdoc-scan line 43.
if grep -l '^..*$' ./tester.types > /dev/null 2>&1 ; then \
	    CC="/bin/sh ../../../libtool --mode=compile x86_64-pc-linux-gnu-gcc     -march=core2 -msse4.1 -mcx16 -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 -mtune=core2 -O2 -pipe -ggdb -ftracer -ftree-vectorize -fno-omit-frame-pointer -Wall" LD="/bin/sh ../../../libtool --mode=link x86_64-pc-linux-gnu-gcc  -march=core2 -msse4.1 -mcx16 -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 -mtune=core2 -O2 -pipe -ggdb -ftracer -ftree-vectorize -fno-omit-frame-pointer -Wall  -Wl,-O1,--as-needed,--hash-style=gnu" RUN="/bin/sh ../../../libtool --mode=execute" CFLAGS="-I../../.. -I../../../tests/annotations/src -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -march=core2 -msse4.1 -mcx16 -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 -mtune=core2 -O2 -pipe -ggdb -ftracer -ftree-vectorize -fno-omit-frame-pointer -Wall" LDFLAGS="-lgobject-2.0 -lglib-2.0   ../../../tests/annotations/src/libtester.la -Wl,-O1,--as-needed,--hash-style=gnu" ../../../gtkdoc-scangobj --module=tester --output-dir=. 2>&1 | tee gtkdoc-scangobj.log; \
	else \
	    cd . ; \
	    for i in tester.args tester.hierarchy tester.interfaces tester.prerequisites tester.signals ; do \
               test -f $i || touch $i ; \
	    done \
	fi
touch scan-build.stamp
gtk-doc: Building XML
Can't locate gtkdoc-common.pl in @INC (@INC contains: /usr/share/gtk-doc/data /etc/perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux /usr/lib64/perl5/vendor_perl/5.8.8 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux /usr/lib64/perl5/site_perl/5.8.8 /usr/lib64/perl5/site_perl /usr/lib64/perl5/5.8.8/x86_64-linux /usr/lib64/perl5/5.8.8 /usr/local/lib/site_perl .) at ../../../gtkdoc-mkdb line 37.
touch sgml-build.stamp
gtk-doc: Building HTML
rm -rf ./html
mkdir ./html
/bin/sh: line 1: gtkdoc-mkhtml: command not found
test "x" = "x" || ( cd . && cp  html )
gtk-doc: Fixing cross-references
touch html-build.stamp
make[3]: Leaving directory `/tmp/portage/dev-util/gtk-doc-1.11/work/gtk-doc-1.11/tests/annotations/docs'
make[2]: Leaving directory `/tmp/portage/dev-util/gtk-doc-1.11/work/gtk-doc-1.11/tests/annotations/docs'
make[1]: Leaving directory `/tmp/portage/dev-util/gtk-doc-1.11/work/gtk-doc-1.11/tests/annotations'
Making check in .
make[1]: Entering directory `/tmp/portage/dev-util/gtk-doc-1.11/work/gtk-doc-1.11/tests'
make  check-TESTS
make[2]: Entering directory `/tmp/portage/dev-util/gtk-doc-1.11/work/gtk-doc-1.11/tests'
Running suite(s): gtk-doc-tester
Cannot open tester-undocumented.txt: No such file or directory
FAIL: gobject.sh
Running suite(s): gtk-doc-tester
Cannot open tester-undocumented.txt: No such file or directory
FAIL: bugs.sh
Running suite(s): gtk-doc-tester
Cannot open tester-undocumented.txt: No such file or directory
FAIL: annotations.sh
========================================================================
3 of 3 tests failed
Please report to http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc
========================================================================
Comment 7 Mart Raudsepp 2009-09-20 07:39:50 UTC
Adding the same TESTS_ENVIRONMENT line to
tests/annotations/docs/Makefile.am
tests/bugs/docs/Makefile.am
and
tests/gobject/docs/Makefile.am
seems to fix it. Not sure if that's the right way to fix it though..


Without TESTS_ENVIRONMENT in tests/*/bugs/Makefile.am as well, Makefile.in has calls like this:

@PATH=$(top_builddir):$(PATH) PERL5LIB=$(top_builddir):$(PERL5LIB) && cd $(srcdir)/html && \
gtkdoc-mkhtml --path="$(srcdir)" $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)  $(MKHTML_OPTIONS)

Note that PERL5LIB and PATH setting exists, but for an empty command, and cd and gtkdoc-mkhtml follows in subsequent calls, but as PATH and PERL5LIB weren't exported, they don't see it.

After adding TESTS_ENVIRONMENT to tests/*/bugs/Makefile.am and re-running automake, this changes to the following:

@cd $(srcdir)/html && PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) \
gtkdoc-mkhtml --path="$(srcdir)" $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)  $(MKHTML_OPTIONS) 

And as such works without a system gtk-doc
Comment 8 Mart Raudsepp 2009-09-20 07:51:01 UTC
Not sure if it's the right fix for the reason of it being a matter of building the docs in those subdirs. Not actually a matter of running tests on it, conceptually. But because the docs are built as part of BUILD_TESTS, it seems to work through TESTS_ENVIRONMENT.
Also not sure if the TESTS_ENVIRONMENT setting in tests/*/docs/Makefile.am should then be wrapped between "if BUILD_TESTS" or not
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2009-09-29 10:50:18 UTC
Thanks for your persistence to investigate the problem. I think its the easiest for now to add the TESTS_ENVIRONMENT to all Makefiles. I have also enclosed it in if BUILD_TESTS

commit 2f1c86ec4d3c19d02ac1789fedea44aa8687a558
Author: Stefan Kost <ensonic@users.sf.net>
Date:   Tue Sep 29 13:39:08 2009 +0300

    tests: add test-env to all Makefiles. Fixes #581237
    
    Also don't dist override.txt files as we don't use them.