mainAutoconf - Support: sr #110319, autoconf incompatible change not...

 
 

sr #110319: autoconf incompatible change not fixed by autoupdate

Submitter:  Per Bothner <bothner>
Submitted:  Fri 25 Sep 2020 08:21:43 PM UTC
   
 
Priority:  * 5 - Unprioritized Severity:  3 - Normal
Status:  Invalid Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 26 Sep 2020 04:30:14 PM UTC, comment #1: 

I confirm the problem, but unfortunately there's nothing we can do to fix it.

Your second snippet is correct and is how the arguments to AS_IF should always have been quoted (see the "M4 Quotation" section of the manual).

In your first snippet, AC_CHECK_PROG is expanded before AS_IF is expanded.  In 2.69c, the expansion of AC_CHECK_PROG contains a shell 'case' statement and therefore an unbalanced close parenthesis.  M4 thinks that close parenthesis is supposed to end the argument list of AS_IF, and so the expansion of AS_IF puts a `fi` in the middle of the expansion of AC_CHECK_PROG.

In 2.69, AC_CHECK_PROG didn't expand to a construct containing a shell 'case' statement.  It was introduced in commit 0eebfff3e04aae651b954cf98b97b5d382f3f230 as a bug fix for problems with absolute paths starting with // on cygwin.  Off the top of my head I can't think of a way to get the same effect without using 'case' that doesn't involve running subprocesses, and this particular construct gets used a whole lot in autoconf scripts so I am inclined to say we need it not to run subprocesses.

This is not the only way things can go wrong if the second argument to AS_IF is not quoted, either.  For instance, if AC_CHECK_PROG happened to expand to a construct containing a comma that wasn't inside either square brackets or a macro argument list, the expansion would be understood as multiple arguments to AS_IF.

autoupdate cannot fix this because autoupdate can only replace obsolete macros.  It can't do anything about improper quotation.

I will make the existing note about improper quotation in NEWS more explicit but beyond that, again, there's nothing we can do.  Sorry.

Zack Weinberg <zackw>
Group administrator
Fri 25 Sep 2020 08:21:43 PM UTC, original submission:  

The following works with 2.69, but breaks with 2.69c:

AS_IF([test -z "$with_asciidoctor"],
    AC_CHECK_PROG(with_asciidoctor, asciidoctor, "yes", "no"))

Adding brackets seems to work:

AS_IF([test -z "$with_asciidoctor"],
    [AC_CHECK_PROG(with_asciidoctor, asciidoctor, "yes", "no")])

Autoupdate does not deal with this case.

Per Bothner <bothner>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by zackw (Posted a comment)
  • -email is unavailable- added by bothner (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-09-26 zackw StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code