Bug 1465665 - 1.36.x build failure: gtkdocize fails using newer autotools due to missing GTK_DOC_CHECK in configure.ac
Summary: 1.36.x build failure: gtkdocize fails using newer autotools due to missing GT...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-27 21:40 UTC by hlein-rhbz
Modified: 2017-07-10 16:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-10 16:05:32 UTC
Embargoed:


Attachments (Terms of Use)
Work around gtkdocize errors during build (800 bytes, patch)
2017-06-27 21:40 UTC, hlein-rhbz
no flags Details | Diff

Description hlein-rhbz 2017-06-27 21:40:48 UTC
Created attachment 1292473 [details]
Work around gtkdocize errors during build

Description of problem:
Trying to build on a system with automake 1.15.1 instead of 1.15 causes a full autotools rebuild, which in turn triggers a failure when gtkdocize is run due to missing macros / includes in configure.ac.

Version-Release number of selected component (if applicable):
libguestfs-1.36.5 (also happens with .3)
automake-1.15.1
autoconf-2.69
gtk-doc-1.25
m4-1.4.18
gcc-5.4.0

This occurred on Gentoo, but I believe the same would happen anywhere with this combination of automake, gtk-doc, libguestfs.

How reproducible:
100%

Steps to Reproduce:
1. Unpack source.
2. Run aclocal -I m4 (done under the hood by Gentoo when building)
3. That does some m4 autom4te magic (I lose track, I am not smart enough for autotools)
4. That eventually runs gtkdocize --copy, which fails.

Actual results:
build fails with this gtkdocize error:

gtkdocize: GTK_DOC_CHECK not called in ./configure.ac

Expected results:
Finish configuring, build successfully.

Additional info:
I found a few other projects with build issues re: GTK_DOC_CHECK:

https://bugs.webkit.org/show_bug.cgi?id=113397
https://lists.altlinux.org/pipermail/devel/2010-January/179004.html

Maybe the Gentoo build system is setting or not-setting some build environment variable that could avoid triggering this, I don't know.

Based on what I see other projects doing, I cobbled together a patch for configure.ac that adds GTK_DOC_CHECK and a couple of other required GTK_DOC_* symbols.  It allows 1.36.5 to build for me, but it is very likely not the best way to solve this problem.

Comment 1 Richard W.M. Jones 2017-06-28 09:56:42 UTC
I'd really love to get rid of gtk-doc.  It's by far the slowest part
of the build, and adds no value since we generate documentation using POD.

Anyway ...

We already include m4/gtk-doc.m4.  I conclude this because if I add
  m4_include([m4/gtk-doc.m4])                                                     
then I get this warning:
  m4/guestfs_gobject.m4:64: warning: file `m4/gtk-doc.m4' included several times

We are calling GTK_DOC_CHECK in m4/guestfs_gobject.m4 already.

> which in turn triggers a failure when gtkdocize is run due to missing
> macros / includes in configure.ac.

What is the error?

Comment 2 hlein-rhbz 2017-06-28 17:13:27 UTC
(In reply to Richard W.M. Jones from comment #1)
> I'd really love to get rid of gtk-doc.  It's by far the slowest part
> of the build, and adds no value since we generate documentation using POD.

I would not object :)

> Anyway ...
> 
> We already include m4/gtk-doc.m4.  I conclude this because if I add
>   m4_include([m4/gtk-doc.m4])                                               
> 
> then I get this warning:
>   m4/guestfs_gobject.m4:64: warning: file `m4/gtk-doc.m4' included several
> times
> 
> We are calling GTK_DOC_CHECK in m4/guestfs_gobject.m4 already.
> 
> > which in turn triggers a failure when gtkdocize is run due to missing
> > macros / includes in configure.ac.
> 
> What is the error?

Sorry, that was the entire error.  From the Gentoo build process:

 * Running aclocal -I m4 ...
 * Automake used for the package (1.15) differs from the installed version (1.15.1).
 * Forcing a full rebuild of the autotools to workaround.
 * Running eautoreconf in '/var/tmp/portage/app-emulation/libguestfs-1.36.5/work/libguestfs-1.36.5' ...
 * Running gtkdocize --copy ...

 * Failed Running gtkdocize !
 * 
 * Include in your bugreport the contents of:
 * 
 *   /var/tmp/portage/app-emulation/libguestfs-1.36.5/temp/gtkdocize.out

And the entire contents of that file is:

> gtkdocize: GTK_DOC_CHECK not called in ./configure.ac

My impression is that gtkdocize is not that bright; if you Google for that exact phrase you'll see many other projects having to fight with it.  I think it does an initial grep before calling m4 to expand includes, causing it to quit early.

Oh, but I did not include the errors that caused me to then also add the GTK_DOC_{USE,BUILD}* pieces.  If I *just* add a reference to GTK_DOC_CHECK in configure.ac and regenerate, I get a bit further but then there's a failure during automake --add-missing --copy --foreign --force-missing:

 * Running aclocal -I m4 ...
 * Automake used for the package (1.15) differs from the installed version (1.15.1).
 * Forcing a full rebuild of the autotools to workaround.
 * Running eautoreconf in '/var/tmp/portage/app-emulation/libguestfs-1.36.5/work/libguestfs-1.36.5' ...
 * Running libtoolize --install --copy --force --automake ...
 * Running aclocal -I m4 ...
 * Running autoconf --force ...
 * Running autoheader ...
 * Running automake --add-missing --copy --foreign --force-missing ...
 * Failed Running automake !
 * 
 * Include in your bugreport the contents of:
 * 
 *   /var/tmp/portage/app-emulation/libguestfs-1.36.5/temp/automake.out

Which contained:

  configure.ac:83: installing 'build-aux/compile'
  configure.ac:35: installing 'build-aux/missing'
  align/Makefile.am: installing 'build-aux/depcomp'
  gobject/docs/gtk-doc.make:7: error: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
  gobject/docs/Makefile.am:95:   'gobject/docs/gtk-doc.make' included from here
  gobject/docs/gtk-doc.make:55: error: GTK_DOC_BUILD_HTML does not appear in AM_CONDITIONAL
  gobject/docs/Makefile.am:95:   'gobject/docs/gtk-doc.make' included from here
  gobject/docs/gtk-doc.make:60: error: GTK_DOC_BUILD_PDF does not appear in AM_CONDITIONAL
  gobject/docs/Makefile.am:95:   'gobject/docs/gtk-doc.make' included from here

So, I added the GTK_DOC_{USE_LIBTOOL,BUILD_HTML,BUILD_PDF} entries by trial and error after Googling the subsequent errors and others' workarounds.


Probably my workaround is the wrong or incomplete fix, but it _does_ allow the build to continue for me where the toolchain insists on running gtkdocize.  It's Gentoo's build process deciding to run an autoreconf, and gtkdocize inside of that.  I've also mentioned this in a Gentoo bug on this package, https://bugs.gentoo.org/show_bug.cgi?id=601162, and elsewhere there is a b.g.o bug for "don't always rerun gtkdocize": https://bugs.gentoo.org/show_bug.cgi?id=459978

If you think the right fix for libguestfs is "Gentoo, don't do that" then I'll update those two bugs accordingly.

Comment 3 Richard W.M. Jones 2017-06-29 10:03:05 UTC
Let me see how easy it is to *remove* gtk-docs ...

Comment 4 Richard W.M. Jones 2017-06-29 11:06:22 UTC
Patches to remove gtk-doc:

https://www.redhat.com/archives/libguestfs/2017-June/msg00298.html

Comment 5 hlein-rhbz 2017-07-01 02:50:00 UTC
Great, thank you!

Comment 6 Richard W.M. Jones 2017-07-10 16:05:32 UTC
Upstream in:

https://github.com/libguestfs/libguestfs/commit/2cb0413049f1a185a057c1b82b6642241f80dcdc
https://github.com/libguestfs/libguestfs/commit/f5f7f00a465c83351157bcebd0b320e38978ff0a
https://github.com/libguestfs/libguestfs/commit/f30b2065a202a17dc3beaaa0fe211d74ce8eb942

As this makes quite a large change to the build system and removes
a feature (Gtk docs) it's not 1.36 stable branch material, so I'm
closing this bug.  This will appear in libguestfs 1.38.


Note You need to log in before you can comment on or make changes to this bug.