GNU bug report logs - #30172
dvi, ps, and pdf targets use AM_MAKEINFOFLAGS

Previous Next

Package: automake;

Reported by: Mathieu Lirzin <mthl <at> gnu.org>

Date: Fri, 19 Jan 2018 15:31:02 UTC

Severity: normal

Tags: confirmed, patch

Done: Mike Frysinger <vapier <at> gentoo.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30172 in the body.
You can then email your comments to 30172 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#30172; Package automake. (Fri, 19 Jan 2018 15:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mathieu Lirzin <mthl <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Fri, 19 Jan 2018 15:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: bug-automake <at> gnu.org
Subject: dvi, ps, and pdf targets use AM_MAKEINFOFLAGS
Date: Fri, 19 Jan 2018 16:30:32 +0100
[Message part 1 (text/plain, inline)]
The test suite fails for “t/txinfo-many-output-formats.sh” and
“t/txinfo-many-output-formats-vpath.sh”.

  $ make check \
      TESTS="t/txinfo-many-output-formats.sh t/txinfo-many-output-formats-vpath.sh"

[test-suite.log (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]
The following patch makes the tests pass.

[makeinfoflags-issue.patch (text/x-patch, inline)]
diff --git a/t/txinfo-many-output-formats-vpath.sh b/t/txinfo-many-output-formats-vpath.sh
index 331f57255..114ddc2ef 100644
--- a/t/txinfo-many-output-formats-vpath.sh
+++ b/t/txinfo-many-output-formats-vpath.sh
@@ -155,6 +155,9 @@ test ! -e share/$me/html/main.html
 test ! -e share/$me/html/main2.html
 test ! -e share/$me/html/main3.html
 
+# Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
+cp -f $srcdir/Makefile.sav $srcdir/Makefile.am
+
 $MAKE dvi
 test -f main.dvi
 test -f sub/main2.dvi
@@ -198,8 +201,6 @@ test ! -e share/$me/pdf/main2.pdf
 test ! -e share/$me/pdf/main3.pdf
 test ! -e share/$me/pdf/hello
 
-# Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
-cp -f $srcdir/Makefile.sav $srcdir/Makefile.am
 using_gmake || $MAKE Makefile
 $MAKE distcheck
 
diff --git a/t/txinfo-many-output-formats.sh b/t/txinfo-many-output-formats.sh
index 978417e60..65bbd360d 100644
--- a/t/txinfo-many-output-formats.sh
+++ b/t/txinfo-many-output-formats.sh
@@ -156,6 +156,9 @@ test ! -e share/$me/html/main.html
 test ! -e share/$me/html/main2.html
 test ! -e share/$me/html/main3.html
 
+# Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
+cp -f $srcdir/Makefile.sav $srcdir/Makefile.am
+
 $MAKE dvi
 test -f main.dvi
 test -f sub/main2.dvi
@@ -199,8 +202,6 @@ test ! -e share/$me/pdf/main2.pdf
 test ! -e share/$me/pdf/main3.pdf
 test ! -e share/$me/pdf/hello
 
-# Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
-cp -f $srcdir/Makefile.sav $srcdir/Makefile.am
 using_gmake || $MAKE Makefile
 $MAKE distcheck
 
[Message part 5 (text/plain, inline)]
The reason is that ‘texi2dvi’ is used by the dvi, ps, and pdf targets.
‘texi2dvi’ uses MAKEINFO internally which Automake augments with
AM_MAKEINFOFLAGS.  See the following snippet from the generated
Makefile:

--8<---------------cut here---------------start------------->8---
.texi.dvi:
	$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
	$(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
	$<
--8<---------------cut here---------------end--------------->8---

Whereas the manual claims that AM_MAKEINFOFLAGS should be used only when
building ‘.info’ files:

--8<---------------cut here---------------start------------->8---
‘AM_MAKEINFOFLAGS’
‘AM_MAKEINFOHTMLFLAGS’
     Maintainer flags passed to each ‘makeinfo’ invocation.  Unlike
     ‘MAKEINFOFLAGS’, these variables are meant to be defined by
     maintainers in ‘Makefile.am’.  ‘$(AM_MAKEINFOFLAGS)’ is passed to
     ‘makeinfo’ when building ‘.info’ files; and
     ‘$(AM_MAKEINFOHTMLFLAGS)’ is used when building ‘.html’ files.
--8<---------------cut here---------------end--------------->8---

Here is what could be done:

  1. Fix the manual to state that AM_MAKEINFOFLAGS is used for every
     non-html documentation target.

  2. Remove $(AM_MAKEINFOFLAGS) from the dvi, ps, and pdf targets

I am not sure what should be done.  Enlightened suggestions are welcome.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

Information forwarded to bug-automake <at> gnu.org:
bug#30172; Package automake. (Tue, 08 Feb 2022 05:24:01 GMT) Full text and rfc822 format available.

Message #8 received at 30172 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: 30172 <at> debbugs.gnu.org
Subject: Re: bug#30172: dvi, ps, and pdf targets use AM_MAKEINFOFLAGS
Date: Tue, 8 Feb 2022 00:23:25 -0500
[Message part 1 (text/plain, inline)]
On 19 Jan 2018 16:30, Mathieu Lirzin wrote:
> The test suite fails for “t/txinfo-many-output-formats.sh” and
> “t/txinfo-many-output-formats-vpath.sh”.
> 
>   $ make check \
>       TESTS="t/txinfo-many-output-formats.sh t/txinfo-many-output-formats-vpath.sh"
>
> TEXINPUTS=".:$TEXINPUTS" \
> MAKEINFO='/bin/sh /home/mthl/src/automake/t/txinfo-many-output-formats.dir/missing makeinfo --unsupported-option  -I .' \
> texi2dvi  --build-dir=main.t2d -o main.dvi  \
> main.texi
> Unknown option: unsupported-option
> This is TeXk, Version 3.14159265 (TeX Live 2017) (preloaded format=tex)
> /gnu/store/cphfgqpcs458ab72692jsxm903amqvc2-profile/bin/texi2dvi: tex exited with bad status, quitting.
> make[1]: *** [Makefile:406: main.dvi] Error 1

hmm, you're hitting a codepath that you shouldn't be in texinfo.  texi2dvi
normally doesn't run $MAKEINFO.  it does so as a fallback if the tex install
seems to be broken (won't properly expand macros).  i'm guessing that's what
you have on your system (misbehaving tex install), so texi2dvi fell back to
running the $MAKEINFO setting.

let's look at the tests causing you trouble.

> --- a/t/txinfo-many-output-formats-vpath.sh
> +++ b/t/txinfo-many-output-formats-vpath.sh
> @@ -155,6 +155,9 @@ test ! -e share/$me/html/main.html
>  test ! -e share/$me/html/main2.html
>  test ! -e share/$me/html/main3.html
>  
> +# Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
> +cp -f $srcdir/Makefile.sav $srcdir/Makefile.am
> +
>  $MAKE dvi
>  test -f main.dvi
>  test -f sub/main2.dvi
> @@ -198,8 +201,6 @@ test ! -e share/$me/pdf/main2.pdf
>  test ! -e share/$me/pdf/main3.pdf
>  test ! -e share/$me/pdf/hello
>  
> -# Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
> -cp -f $srcdir/Makefile.sav $srcdir/Makefile.am
>  using_gmake || $MAKE Makefile
>  $MAKE distcheck

the point of txinfo-many-output-formats-vpath.sh is:
# Test support for building HTML documentation, and the many
# install-DOC flavors, in VPATH builds.

it feels a bit weird that it's also validating flag behavior here:
# Make sure AM_MAKEINFOHTMLFLAGS is supported, and override AM_MAKEINFO.

but it is what it is i guess.  i think your patch has the right idea, but it
also needs to rebuild the makefile before continuing.
	(cd $srcdir && $AUTOMAKE)
	./config.status Makefile

> --- a/t/txinfo-many-output-formats.sh
> +++ b/t/txinfo-many-output-formats.sh

same feedback for this test

> Here is what could be done:
> 
>   1. Fix the manual to state that AM_MAKEINFOFLAGS is used for every
>      non-html documentation target.
> 
>   2. Remove $(AM_MAKEINFOFLAGS) from the dvi, ps, and pdf targets
> 
> I am not sure what should be done.  Enlightened suggestions are welcome.

we want to keep AM_MAKEINFOFLAGS when invoking $(MAKEINFO) i think.
we discussed this at bit in https://bugs.gnu.org/23599

i don't think we want to advertise it as such in the manual though as the
flags aren't normally used ... they're a fallback for a situation that
shouldn't have happened, and when it does, AM_MAKEINFOFLAGS is assisting
in that fallback/recovery codepath.  it's certainly not ideal, but i'm not
sure we can easily or usefully convey this nuance in the manual without it
just confusing most readers.  so all things considered, the status quo seems
like the least worst option.  totally open to someone wanting to wordsmith
this though :).
-mike
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-automake <at> gnu.org:
bug#30172; Package automake. (Tue, 08 Feb 2022 05:29:02 GMT) Full text and rfc822 format available.

Message #11 received at 30172 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: 30172 <at> debbugs.gnu.org
Subject: [PATCH] tests: do not assume AM_MAKEINFOHTMLFLAGS is used in non-html
 targets
Date: Tue,  8 Feb 2022 00:28:25 -0500
From: Mathieu Lirzin <mthl <at> gnu.org>

Fixes automake bug https://bugs.gnu.org/30172.

Since AM_MAKEINFOHTMLFLAGS overrides AM_MAKEINFOFLAGS only for html
targets, make sure we restore the hacked up makefile before testing
the non-html formats.  This normally doesn't cause a problem for most
people, but if their tex install doesn't work correctly, texi2dvi will
fallback to running $MAKEINFO and using invalid flags in the process.

* THANKS: Add Mathieu Lirzin.
* t/txinfo-many-output-formats.sh: Restore Makefile.am after testing
html targets.
* t/txinfo-many-output-formats-vpath.sh: Likewise.
---
 THANKS                                | 1 +
 t/txinfo-many-output-formats-vpath.sh | 9 +++++++--
 t/txinfo-many-output-formats.sh       | 9 +++++++--
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/THANKS b/THANKS
index 554013ca87c3..41e15eb73b34 100644
--- a/THANKS
+++ b/THANKS
@@ -269,6 +269,7 @@ Martin Waitz                    tali <at> admingilde.org
 Mathias Doreille                doreille <at> smr.ch
 Mathias Froehlich               M.Froehlich <at> science-computing.de
 Mathias Hasselmann              mathias.hasselmann <at> gmx.de
+Mathieu Lirzin                  mthl <at> gnu.org
 Matt Burgess                    matthew <at> linuxfromscratch.org
 Matt Leach                      mleach <at> cygnus.com
 Matthew D. Langston             langston <at> SLAC.Stanford.EDU
diff --git a/t/txinfo-many-output-formats-vpath.sh b/t/txinfo-many-output-formats-vpath.sh
index 98a88428e3eb..3842e63cdca8 100644
--- a/t/txinfo-many-output-formats-vpath.sh
+++ b/t/txinfo-many-output-formats-vpath.sh
@@ -155,6 +155,13 @@ test ! -e share/$me/html/main.html
 test ! -e share/$me/html/main2.html
 test ! -e share/$me/html/main3.html
 
+# Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
+# This must happen before processing any non-html targets.  See
+# https://bugs.gnu.org/30172
+cp -f $srcdir/Makefile.sav $srcdir/Makefile.am
+(cd $srcdir && $AUTOMAKE)
+./config.status Makefile
+
 $MAKE dvi
 test -f main.dvi
 test -f sub/main2.dvi
@@ -198,8 +205,6 @@ test ! -e share/$me/pdf/main2.pdf
 test ! -e share/$me/pdf/main3.pdf
 test ! -e share/$me/pdf/hello
 
-# Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
-cp -f $srcdir/Makefile.sav $srcdir/Makefile.am
 using_gmake || $MAKE Makefile
 $MAKE distcheck
 
diff --git a/t/txinfo-many-output-formats.sh b/t/txinfo-many-output-formats.sh
index 9903d4ef875e..cdb0bf40c792 100644
--- a/t/txinfo-many-output-formats.sh
+++ b/t/txinfo-many-output-formats.sh
@@ -160,6 +160,13 @@ test ! -e share/$me/html/main.html
 test ! -e share/$me/html/main2.html
 test ! -e share/$me/html/main3.html
 
+# Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
+# This must happen before processing any non-html targets.  See
+# https://bugs.gnu.org/30172
+cp -f $srcdir/Makefile.sav $srcdir/Makefile.am
+(cd $srcdir && $AUTOMAKE)
+./config.status Makefile
+
 $MAKE dvi
 test -f main.dvi
 test -f sub/main2.dvi
@@ -203,8 +210,6 @@ test ! -e share/$me/pdf/main2.pdf
 test ! -e share/$me/pdf/main3.pdf
 test ! -e share/$me/pdf/hello
 
-# Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
-cp -f $srcdir/Makefile.sav $srcdir/Makefile.am
 using_gmake || $MAKE Makefile
 $MAKE distcheck
 
-- 
2.34.1





Added tag(s) confirmed and patch. Request was from Mike Frysinger <vapier <at> gentoo.org> to control <at> debbugs.gnu.org. (Tue, 08 Feb 2022 05:34:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#30172; Package automake. (Tue, 08 Feb 2022 22:52:03 GMT) Full text and rfc822 format available.

Message #16 received at 30172 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: vapier <at> gentoo.org
Cc: 30172 <at> debbugs.gnu.org
Subject: Re: bug#30172: [PATCH] tests: do not assume AM_MAKEINFOHTMLFLAGS is
 used in non-html targets
Date: Tue, 8 Feb 2022 15:51:00 -0700
    Fixes automake bug https://bugs.gnu.org/30172.

No problem seen by me. Thanks.




bug closed, send any further explanations to 30172 <at> debbugs.gnu.org and Mathieu Lirzin <mthl <at> gnu.org> Request was from Mike Frysinger <vapier <at> gentoo.org> to control <at> debbugs.gnu.org. (Wed, 09 Feb 2022 04:06:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 09 Mar 2022 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 48 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.