GNOME Bugzilla – Bug 581237
gtk-doc uses wrong gtkdoc-check in "make check" phase
Last modified: 2009-11-25 22:28:33 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
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)
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
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.
Please reopen if its still an issue.
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
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 ========================================================================
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
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
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.