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 701638 - Support automake parallel test harness (fix error with GTKDOC_CHECK)
Support automake parallel test harness (fix error with GTKDOC_CHECK)
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: 1.20
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-05 11:25 UTC by David King
Modified: 2014-02-10 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
preliminary patch (2.11 KB, patch)
2013-06-05 21:09 UTC, David King
none Details | Review
updated patch, including gtk-doc.notmpl.make (2.78 KB, patch)
2013-08-28 14:45 UTC, David King
committed Details | Review
make: Fix GTKDOC_CHECK for Automake 1.13 (2.78 KB, patch)
2013-09-20 12:27 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description David King 2013-06-05 11:25:24 UTC
Since Automake 1.13 (which is entering many distributions), tests are executed in parallel by default:

http://www.flameeyes.eu/autotools-mythbuster/forwardporting/automake.html#idm100296530519152

For tests run in parallel, Automake grabs the output and results of the test and outputs it to two new files, with a .log and .trs extension. It creates the filenames based on the test name, which in the case of GTKDOC_CHECK is the absolute path to the gtkdoc-check binary. This is generally $(prefix)/bin and not writable by the user. This leads to errors when running the gtk-doc check when using Automake 1.13 or above:

http://cgit.freedesktop.org/systemd/systemd/commit/?id=bff9cfcc5c065e7ff0a6ccaf5d0b844c7ebc8081
https://mail.gnome.org/archives/commits-list/2013-March/msg18871.html

One solution would be to add a make rule to create a wrapper script in the builddir, which would then call the gtkdoc-check binary, and add the wrapper script to GTKDOC_CHECK instead.
Comment 1 David King 2013-06-05 21:09:09 UTC
Created attachment 246115 [details] [review]
preliminary patch

The patch generates a shell script in builddir, which in turn calls the gtkdoc-check binary. In this way, the log and result file are created in builddir and the build can proceed as normal. This works fine for me with Automake 1.12, but I have not tried with Automake 1.13 and the parallel test driver yet. Hopefully, I will get a chance tomorrow.
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2013-06-06 09:41:33 UTC
Too bad they made that a default without large testing. Anyway the approach looks okay to me. You need to also patch gtk-doc.notmpl.make.

Thanks for looking into it.
Comment 3 David King 2013-08-28 14:45:04 UTC
Created attachment 253396 [details] [review]
updated patch, including gtk-doc.notmpl.make

I updated the patch and tested it with automake 1.13.4 on Fedora 19. The parallel test driver seems to work fine after the change (I tested it with Cheese by running "make distcheck").
Comment 4 Dieter Verfaillie 2013-09-17 18:40:25 UTC
(In reply to comment #3)
> Created an attachment (id=253396) [details] [review]
> updated patch, including gtk-doc.notmpl.make
> 
> I updated the patch and tested it with automake 1.13.4 on Fedora 19. The
> parallel test driver seems to work fine after the change (I tested it with
> Cheese by running "make distcheck").

Tested with automake 1.13.4 (also on Fedora 19) and a bog
standard docs/reference/Makefile.am [1] on my wip
gobject-introspection docs branch and it seems to be
working just fine. Thanks!

[1] https://git.gnome.org/browse/gtk-doc/tree/examples/Makefile.am?id=9d24fcd883bfd0e4e5b8f403f13a36439ac06e50#n96
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2013-09-17 18:41:33 UTC
Requested feedback from the automake folks:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15403
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2013-09-17 19:05:10 UTC
David, it seems that make dist-check fails with this approach.
Comment 7 David King 2013-09-17 19:44:08 UTC
(In reply to comment #6)
> David, it seems that make dist-check fails with this approach.

I tried myself and I cannot even get gtk-doc to pass "make dist" (but this is both with and without the parallel tests patch):

make[4]: *** No rule to make target `tester-docs.xml', needed by `distdir'.  Stop.
Comment 8 Dieter Verfaillie 2013-09-17 20:02:07 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > David, it seems that make dist-check fails with this approach.
> 
> I tried myself and I cannot even get gtk-doc to pass "make dist" (but this is
> both with and without the parallel tests patch):
> 
> make[4]: *** No rule to make target `tester-docs.xml', needed by `distdir'. 
> Stop.

Unless I misunderstood, it's about running "make distcheck"
for a project using the GTK-Doc parallel make check integration
attachment #253396 [details] fixes and not "make distcheck" for the
GTK-Doc project itself. The former, with now fails with
gtkdoc-check.log and gtkdoc-check.trs being created in
$(srcdir), but that location is read-only during "make distcheck".

That said, I suspect this is due to the standard GTK-Doc docs/reference/Makefile.am recommending a "cd $(srcdir)" in 
TESTS_ENVIRONMENT [1]. Not sure it is save to remove that
"cd $(srcdir)" though as the project I'm working on does not yet
pass the documentation tests...

[1] https://git.gnome.org/browse/gtk-doc/tree/examples/Makefile.am?id=9d24fcd883bfd0e4e5b8f403f13a36439ac06e50#n99
Comment 9 David King 2013-09-17 20:33:42 UTC
(In reply to comment #8)
> Unless I misunderstood, it's about running "make distcheck"
> for a project using the GTK-Doc parallel make check integration
> attachment #253396 [details] fixes and not "make distcheck" for the
> GTK-Doc project itself. The former, with now fails with
> gtkdoc-check.log and gtkdoc-check.trs being created in
> $(srcdir), but that location is read-only during "make distcheck".

Ah, you are indeed right, silly me.

> That said, I suspect this is due to the standard GTK-Doc
> docs/reference/Makefile.am recommending a "cd $(srcdir)" in 
> TESTS_ENVIRONMENT [1]. Not sure it is save to remove that
> "cd $(srcdir)" though as the project I'm working on does not yet
> pass the documentation tests...

Right, indeed that seems to fix it. I thought that it was solely because Cheese had a peculiar gtk-doc setup.
Comment 10 Dieter Verfaillie 2013-09-19 09:18:37 UTC
(In reply to comment #9)
> > That said, I suspect this is due to the standard GTK-Doc
> > docs/reference/Makefile.am recommending a "cd $(srcdir)" in 
> > TESTS_ENVIRONMENT [1]. Not sure it is save to remove that
> > "cd $(srcdir)" though as the project I'm working on does not yet
> > pass the documentation tests...
> 
> Right, indeed that seems to fix it. I thought that it was solely because Cheese
> had a peculiar gtk-doc setup.

Finally got far enough with g-i docs to also confirm that
when using attachment #253396 [details], "make distcheck" seems to
function correctly after removing the "cd $(srcdir)" from
TESTS_ENVIRONMENT in docs/reference/Makefile.am

I'd still like to hear why that "cd" is being recommended in
the first place and if it is safe to remove before committing
anything to g-i though...
Comment 11 Stefan Sauer (gstreamer, gtkdoc dev) 2013-09-20 12:26:11 UTC
commit 8a17bcf851398b54a37bc65d8c9112a4e06afbeb
Author: Stefan Sauer <ensonic@users.sf.net>
Date:   Fri Sep 20 14:24:53 2013 +0200

    makefile: remove the cd ($srcdir) from the example Makefile.am
    
    This is a leftover from the times where gtk-doc was forcing to build in srcdir.
Comment 12 Stefan Sauer (gstreamer, gtkdoc dev) 2013-09-20 12:27:46 UTC
The following fix has been pushed:
7ae9380 make: Fix GTKDOC_CHECK for Automake 1.13
Comment 13 Stefan Sauer (gstreamer, gtkdoc dev) 2013-09-20 12:27:54 UTC
Created attachment 255392 [details] [review]
make: Fix GTKDOC_CHECK for Automake 1.13

The parallel test driver that is the default in Automake 1.13 and above
creates log files with .log and .trs extensions. It creates the
filenames based on the test name, which in the case of GTKDOC_CHECK is
the absolute path to the gtkdoc-check binary. This is generally
$(prefix)/bin and not writable by the user, which leads to a build
failure.

Avoid this situation by generating a shell script in builddir, which in
turn calls the gtkdoc-check binary. In this way, the log and result file
are created in builddir and the build can proceed as normal.
Comment 14 Zeeshan Ali 2013-09-23 15:06:27 UTC
Although the original issue seems to be gone w/ gtk-doc from git master, I still getting into errors from the same lines in docs/Makefile.am in geocode-glib on `make distcheck`:

make[4]: Entering directory `/extra-data/checkout/gnome/geocode-glib/geocode-glib-3.10.0/_build/docs'
  GEN      gtkdoc-check.test
../../test-driver: line 95: gtkdoc-check.log: Permission denied
FAIL: gtkdoc-check.test
../../test-driver: line 114: gtkdoc-check.trs: Permission denied
../../test-driver: line 115: gtkdoc-check.trs: Permission denied
../../test-driver: line 116: gtkdoc-check.trs: Permission denied
../../test-driver: line 117: gtkdoc-check.trs: Permission denied
make[4]: *** [gtkdoc-check.log] Error 1
Comment 15 David King 2013-09-23 15:18:54 UTC
You should not be adding "cd $(srcdir) &&" to TESTS_ENVIRONMENT anymore:

https://git.gnome.org/browse/gtk-doc/commit/?id=8a17bcf851398b54a37bc65d8c9112a4e06afbeb
Comment 16 Zeeshan Ali 2013-09-23 15:21:57 UTC
(In reply to comment #15)
> You should not be adding "cd $(srcdir) &&" to TESTS_ENVIRONMENT anymore:
> 
> https://git.gnome.org/browse/gtk-doc/commit/?id=8a17bcf851398b54a37bc65d8c9112a4e06afbeb

Thanks :)
Comment 17 Stefan Sauer (gstreamer, gtkdoc dev) 2014-02-09 11:46:05 UTC
When I am doing make distcheck in my modules after this change:

make[6]: Entering directory `/home/ensonic/projects/buzztrax/gst-buzztrax/gst-buzztrax-0.8.0/_build/docs/reference'
echo "#!/bin/sh -e" > gtkdoc-check.test; \
		echo "/usr/bin/gtkdoc-check || exit 1" >> gtkdoc-check.test; \
		chmod +x gtkdoc-check.test
/bin/sh: line 9: ./gtkdoc-check.test: No such file or directory
FAIL: gtkdoc-check.test
=====================================================

Although the local verison is there and executable :/ 
ls -al gst-buzztrax-0.8.0/_build/docs/reference/gtkdoc-check.test
-rwxr-x--- 1 ensonic eng 45 Feb  9 12:39 gst-buzztrax-0.8.0/_build/docs/reference/gtkdoc-check.test*

grep GTKDOC_CHECK gst-buzztrax-0.8.0/_build/docs/reference/Makefile 
GTKDOC_CHECK = gtkdoc-check.test
GTKDOC_CHECK_PATH = /usr/bin/gtkdoc-check
TESTS = $(GTKDOC_CHECK)
		echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \

Any ideas?
Comment 18 Stefan Sauer (gstreamer, gtkdoc dev) 2014-02-10 13:33:38 UTC
Oh foo, I had a "cd $(srcdir) &&" in TESTS_ENVIRONMENT.