GNOME Bugzilla – Bug 701638
Support automake parallel test harness (fix error with GTKDOC_CHECK)
Last modified: 2014-02-10 13:33:38 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.
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.
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.
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").
(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
Requested feedback from the automake folks: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15403
David, it seems that make dist-check fails with this approach.
(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.
(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
(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.
(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...
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.
The following fix has been pushed: 7ae9380 make: Fix GTKDOC_CHECK for Automake 1.13
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.
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
You should not be adding "cd $(srcdir) &&" to TESTS_ENVIRONMENT anymore: https://git.gnome.org/browse/gtk-doc/commit/?id=8a17bcf851398b54a37bc65d8c9112a4e06afbeb
(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 :)
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?
Oh foo, I had a "cd $(srcdir) &&" in TESTS_ENVIRONMENT.