bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: divert()/m4_divert() broken in autoconf-2.64+


From: Eric Blake
Subject: Re: divert()/m4_divert() broken in autoconf-2.64+
Date: Tue, 24 Nov 2009 22:02:36 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

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

> you guys release new versions but you dont test 
> them with nearly the same coverage we get nor deal with the breakage that 
> seems to come with every new version.

And we appreciate your testing.  I'm sorry if it doesn't come across in that 
manner.

>  i'm sorry to have wasted '15 minutes', 
> but we distros have multiple people spending hours on this

But you can help us help you by coming to us a bit sooner, and with a bit more 
details - reduced test cases are nice, but posting a simultaneous link to the 
URL of the file that you reduced is even nicer.

> 
> the note you quoted about diversions being subject to breakage really needs 
to 
> have stronger wording and be up front, not after paragraphs of documentation 

It already _is_ up front:

| @node Diversion support
| @subsection Diversion support
| 
| M4sugar makes heavy use of diversions, because it is often the case that
| text that must appear early in the output is not discovered until late
| in the input.  Additionally, some of the topological sorting algorithms
| used in resolving macro dependencies use diversions.  However, most
| macros should not need to change diversions directly, but rather rely on
| higher-level M4sugar macros to manage diversions transparently.

That paragraph occurs before any mention of m4_divert_push, m4_divert_text, or 
diversion names.  How can I make it stronger than that?

I guess I can add a sentence to m4_divert and m4_undivert, which were 
documented in an earlier node than Diversion support.

And I think that I can also make it so that calling m4_divert with a number 
instead of a name will issue a syntax warning (or, more precisely, m4_divert 
would issue a syntax warning if the macro _m4_divert([name]) is undefined), via 
this (untested) patch:

diff --git i/lib/m4sugar/m4sugar.m4 w/lib/m4sugar/m4sugar.m4
index e0cacfb..966865e 100644
--- i/lib/m4sugar/m4sugar.m4
+++ w/lib/m4sugar/m4sugar.m4
@@ -1380,11 +1380,11 @@ m4_define([m4_cleardivert],
 # _m4_divert(DIVERSION-NAME or NUMBER)
 # ------------------------------------
 # If DIVERSION-NAME is the name of a diversion, return its number,
-# otherwise if it is a NUMBER return it.
+# otherwise if it is a NUMBER return it, but warn that names are preferred.
 m4_define([_m4_divert],
 [m4_ifdef([_m4_divert($1)],
          [m4_indir([_m4_divert($1)])],
-         [$1])])
+         [m4_warn([syntax], [prefer named diversions])$1])])

 # KILL is only used to suppress output.
 m4_define([_m4_divert(KILL)],           -1)


But until I test it, I can't even be sure it won't trigger due to autoconf 
internals.

> my point was that using diversions at all seems to result in breakage.  after 
> converting the php code to use numeric diversions in the range suggested by 
> Eric, configure still didnt work, but for different reasons.  so once again, 
i 
> produced a reduced example from real world code to focus on the problem.

And hopefully I showed why that reduction didn't work in my previous mail.  But 
without seeing the PHP configure.ac, I can't tell if your reduction was an 
accurate representation of the core issue of the PHP failure.

-- 
Eric Blake






reply via email to

[Prev in Thread] Current Thread [Next in Thread]