GNU bug report logs - #65600
[PATCH] Allow parameters AM_PROG_LEX

Previous Next

Package: automake-patches;

Reported by: Bogdan <bogdro_rep <at> gmx.us>

Date: Tue, 29 Aug 2023 18:58:02 UTC

Severity: normal

Tags: patch

Merged with 65730

Done: Karl Berry <karl <at> freefriends.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 65600 in the body.
You can then email your comments to 65600 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 automake-patches <at> gnu.org:
bug#65600; Package automake-patches. (Tue, 29 Aug 2023 18:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bogdan <bogdro_rep <at> gmx.us>:
New bug report received and forwarded. Copy sent to automake-patches <at> gnu.org. (Tue, 29 Aug 2023 18:58:02 GMT) Full text and rfc822 format available.

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

From: Bogdan <bogdro_rep <at> gmx.us>
To: automake-patches <at> gnu.org
Subject: [PATCH] Allow parameters AM_PROG_LEX
Date: Tue, 29 Aug 2023 20:56:18 +0200
[Message part 1 (text/plain, inline)]
Hi.

 In reference to:
https://lists.gnu.org/archive/html/automake/2023-07/msg00007.html.

 The attached patch allows the AM_PROG_LEX macro to accept
parameters, to accommodate for the fact that AC_PROG_LEX now (since
Autoconf 2.70) requires one. The values accepted by AM_PROG_LEX are
passed to AC_PROG_LEX the following way:
- an empty value is passed as empty, resulting in an Autoconf warning
(just like it is now),
- the word 'yywrap' is passed unchanged,
- the word 'noyywrap' is passed unchanged,
- the word 'empty' results in an empty value (and thus an Autoconf
warning)
- any other word results in a syntax warning and an empty value being
passed (resulting in an Autoconf warning).

 Since it's Autoconf 2.70 that started using the parameter, I've
bumped the required value. You may change back if needed.

 My M4 "knowledge" is simply basing on other examples and doing
whatever that doesn't result in an error, so you may change the code
as needed (m4_define, m4_warn, m4_expand).

 Test for the parameters is added. All tests matching *lex*sh pass.
+11-20s to testing time.

--
Regards - Bogdan ('bogdro') D.                 (GNU/Linux & FreeDOS)
X86 assembly (DOS, GNU/Linux):    http://bogdro.evai.pl/index-en.php
Soft(EN): http://bogdro.evai.pl/soft  http://bogdro.evai.pl/soft4asm
www.Xiph.org  www.TorProject.org  www.LibreOffice.org  www.GnuPG.org
[automake-am_prog_lex-params-mail.diff (text/x-patch, attachment)]

Information forwarded to automake-patches <at> gnu.org:
bug#65600; Package automake-patches. (Thu, 31 Aug 2023 15:50:01 GMT) Full text and rfc822 format available.

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

From: Karl Berry <karl <at> freefriends.org>
To: bogdro_rep <at> gmx.us
Cc: 65600 <at> debbugs.gnu.org
Subject: Re: [bug#65600] [PATCH] Allow parameters AM_PROG_LEX
Date: Thu, 31 Aug 2023 09:49:39 -0600
Hi Bogdan,

    In reference to:
    https://lists.gnu.org/archive/html/automake/2023-07/msg00007.html.

Thanks much!

    Since it's Autoconf 2.70 that started using the parameter, I've
    bumped the required value. 

I don't think we should require the brand-new ac 2.70 just for this
minor feature.  And I think it should be feasible not to: if the
autoconf version is >= 2.70, your new code runs; if <2.70, just ignore
any given argument.  That way people can use the new automake macro with
an older autoconf.

I'm no expert on checking autoconf versions, but from glancing through
the autoconf manual, it looks like m4_version_prereq might be the
simplest to use in this case. It was officially added in ac 2.66, which
should be old enough. It's described at the end of
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/autoconf.html#Number-processing-Macros

Wdyt? Can you tweak your patch along these lines?

Thanks again,
Karl




Information forwarded to automake-patches <at> gnu.org:
bug#65600; Package automake-patches. (Thu, 31 Aug 2023 16:15:01 GMT) Full text and rfc822 format available.

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

From: Nick Bowler <nbowler <at> draconx.ca>
To: Karl Berry <karl <at> freefriends.org>
Cc: 65600 <at> debbugs.gnu.org, bogdro_rep <at> gmx.us
Subject: Re: [bug#65600] [PATCH] Allow parameters AM_PROG_LEX
Date: Thu, 31 Aug 2023 12:14:25 -0400
On 31/08/2023, Karl Berry <karl <at> freefriends.org> wrote:
> Hi Bogdan,
>
>     In reference to:
>     https://lists.gnu.org/archive/html/automake/2023-07/msg00007.html.
>
> Thanks much!
>
>     Since it's Autoconf 2.70 that started using the parameter, I've
>     bumped the required value.
>
> I don't think we should require the brand-new ac 2.70 just for this
> minor feature.  And I think it should be feasible not to: if the
> autoconf version is >= 2.70, your new code runs; if <2.70, just ignore
> any given argument.  That way people can use the new automake macro with
> an older autoconf.

One way to maintain compatibility while ensuring the new options actually
are supported would be to just add the AC_PREREQ([2.70]) only in the cases
which actually trigger different behaviour in new Autoconf (i.e., the ones
that match yywrap and noyywrap options).  Keep the old prereq unchanged
outside of the case.

That way, the minimum autoconf version requirement is only triggered
for autoconf inputs that actually attempt to use the new feature (by
explicitly passing yywrap or noyywrap options to AM_PROG_LEX).

To implement a "fall back to old behaviour with old autoconf, even if
the user explicitly selected the new behaviour", then you can just not
touch AC_PREREQ at all.  There is no need for any version tests: old
versions of autoconf simply ignore any supplied arguments to
AC_PROG_LEX and always use the old behaviour.

Finally, one way to check whether AC_PROG_LEX accepts an argument is to
just use m4 to look for argument references in its definition, something
like:

  m4_bmatch(m4_defn([AC_PROG_LEX]), [[$][1@*]],
    [m4_errprintn([new lex macro])],
    [m4_errprintn([old lex macro])])

then you don't need to test autoconf version numbers at all.

Cheers,
  Nick




Information forwarded to automake-patches <at> gnu.org:
bug#65600; Package automake-patches. (Thu, 31 Aug 2023 22:29:01 GMT) Full text and rfc822 format available.

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

From: Karl Berry <karl <at> freefriends.org>
To: nbowler <at> draconx.ca
Cc: 65600 <at> debbugs.gnu.org, bogdro_rep <at> gmx.us
Subject: Re: [bug#65600] [PATCH] Allow parameters AM_PROG_LEX
Date: Thu, 31 Aug 2023 16:28:04 -0600
    One way to maintain compatibility 

Thank you very much, Nick. That is all excellent to know.

Bogdan: I will adjust the patch, one way or another.
Nothing more for you to do here after all :). --thanks, karl.




Information forwarded to automake-patches <at> gnu.org:
bug#65600; Package automake-patches. (Fri, 01 Sep 2023 09:36:01 GMT) Full text and rfc822 format available.

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

From: Bogdan <bogdro_rep <at> gmx.us>
To: Karl Berry <karl <at> freefriends.org>, nbowler <at> draconx.ca
Cc: 65600 <at> debbugs.gnu.org
Subject: Re: [bug#65600] [PATCH] Allow parameters AM_PROG_LEX
Date: Fri, 1 Sep 2023 11:35:19 +0200
Karl Berry <karl <at> freefriends.org>, Fri Sep 01 2023 00:28:04 GMT+0200
(Central European Summer Time)
>      One way to maintain compatibility
>
> Thank you very much, Nick. That is all excellent to know.
>
> Bogdan: I will adjust the patch, one way or another.
> Nothing more for you to do here after all :). --thanks, karl.


 Okay, no problem. Happy to have "triggered" this to move forward :)

--
Regards - Bogdan ('bogdro') D.                 (GNU/Linux & FreeDOS)
X86 assembly (DOS, GNU/Linux):    http://bogdro.evai.pl/index-en.php
Soft(EN): http://bogdro.evai.pl/soft  http://bogdro.evai.pl/soft4asm
www.Xiph.org  www.TorProject.org  www.LibreOffice.org  www.GnuPG.org





Information forwarded to automake-patches <at> gnu.org:
bug#65600; Package automake-patches. (Tue, 05 Sep 2023 19:51:01 GMT) Full text and rfc822 format available.

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

From: "Zack Weinberg" <zack <at> owlfolio.org>
To: "Karl Berry" <karl <at> freefriends.org>
Cc: 65730 <at> debbugs.gnu.org, Bogdan <bogdro_rep <at> gmx.us>,
 Łukasz Stelmach <stlman <at> poczta.fm>, 65600 <at> debbugs.gnu.org,
 Nick Bowler <nbowler <at> draconx.ca>
Subject: Re: [bug#65600] [PATCH] Allow parameters AM_PROG_LEX
Date: Tue, 05 Sep 2023 15:49:45 -0400
> Karl Berry <karl <at> freefriends.org>, Fri Sep 01 2023 00:28:04 GMT+0200
> (Central European Summer Time)
>> Bogdan: I will adjust the patch, one way or another. Nothing more for
>> you to do here after all :). --thanks, karl.

Karl: The same problem was also reported as bug 65730, with a patch
supplied by Łukasz Stelmach.  That patch is preferable to Bogdan's
patch, for two reasons.  First, Łukasz's patch uses $@ to forward *all*
arguments to AC_PROG_LEX, regardless of what they are, making it robust
to the possibility of *more* arguments being added to AC_PROG_LEX in the
future (for example, we might decide to add an option to specify that
you need Flex specifically).  Second, Łukasz's patch checks whether
AC_PROG_LEX has already been invoked, and if so does not run it again.
That makes the updated AM_PROG_LEX continue to be compatible with the
workaround we (Autoconf) have been suggesting for this issue, namely
to write

AC_PROG_LEX([noyywrap])
AM_PROG_LEX

It looks like Bogdan's patch does include a new set of tests that are
worth preserving, but please use Łukasz's actual code change.  (I regret
I cannot volunteer to merge the two patches as I am in the middle of
reinstalling the operating system on my workstation, and that's already
taken a week and a half with no end in sight.  You know how these things
go, I'm sure.)

zw




Information forwarded to automake-patches <at> gnu.org:
bug#65600; Package automake-patches. (Tue, 05 Sep 2023 21:16:01 GMT) Full text and rfc822 format available.

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

From: Karl Berry <karl <at> freefriends.org>
To: zack <at> owlfolio.org
Cc: 65730 <at> debbugs.gnu.org, bogdro_rep <at> gmx.us, stlman <at> poczta.fm,
 65600 <at> debbugs.gnu.org, nbowler <at> draconx.ca
Subject: Re: [bug#65600] [PATCH] Allow parameters AM_PROG_LEX
Date: Tue, 5 Sep 2023 15:15:16 -0600
    Karl: The same problem was also reported as bug 65730, with a patch

Thanks Zack. I had just composed a reply saying just about exactly the
same thing as you wrote :).

I will merge the patches and try Bogdan's test, no problem. -k

P.S. Bogdan, sorry that I wasn't thinking more clearly when I asked you
to write the more complicated version.




Information forwarded to automake-patches <at> gnu.org:
bug#65600; Package automake-patches. (Wed, 06 Sep 2023 09:08:01 GMT) Full text and rfc822 format available.

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

From: Bogdan <bogdro_rep <at> gmx.us>
To: Karl Berry <karl <at> freefriends.org>, zack <at> owlfolio.org
Cc: 65730 <at> debbugs.gnu.org, nbowler <at> draconx.ca, 65600 <at> debbugs.gnu.org,
 stlman <at> poczta.fm
Subject: Re: [bug#65600] [PATCH] Allow parameters AM_PROG_LEX
Date: Wed, 6 Sep 2023 11:06:56 +0200
Karl Berry <karl <at> freefriends.org>, Tue Sep 05 2023 23:15:16 GMT+0200
(Central European Summer Time)
>      Karl: The same problem was also reported as bug 65730, with a patch
>
> Thanks Zack. I had just composed a reply saying just about exactly the
> same thing as you wrote :).
>
> I will merge the patches and try Bogdan's test, no problem. -k
>
> P.S. Bogdan, sorry that I wasn't thinking more clearly when I asked you
> to write the more complicated version.


 No problem, new "experience points" earned :). M4 and all Autoconf
macros (knowledge about their existence) are still a bit out of my
range. Especially AC_PROVIDE_IFELSE, which I don't even have in my
Autoconf manual (it *is* found in the code, but not in the manual)...

Bogdan





Merged 65600 65730. Request was from Karl Berry <karl <at> freefriends.org> to control <at> debbugs.gnu.org. (Wed, 06 Sep 2023 20:46:02 GMT) Full text and rfc822 format available.

Reply sent to Karl Berry <karl <at> freefriends.org>:
You have taken responsibility. (Wed, 01 Nov 2023 16:24:03 GMT) Full text and rfc822 format available.

Notification sent to Bogdan <bogdro_rep <at> gmx.us>:
bug acknowledged by developer. (Wed, 01 Nov 2023 16:24:03 GMT) Full text and rfc822 format available.

Message #33 received at 65600-done <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: stlman <at> poczta.fm
Cc: 65730 <at> debbugs.gnu.org
Subject: Re: [bug#65730] [PATCH v2] m4: Update invocation of AC_PROG_LEX
Date: Wed, 1 Nov 2023 10:23:14 -0600
    * m4/lex.m4: pass the required argument to AC_PROG_LEX

Łukasz, I finally committed your patch for this.
Bogdan, I also committed your test.

Thanks much. Closing these out (#65730, #65600). --karl





Reply sent to Karl Berry <karl <at> freefriends.org>:
You have taken responsibility. (Wed, 01 Nov 2023 16:24:03 GMT) Full text and rfc822 format available.

Notification sent to Łukasz Stelmach <stlman <at> poczta.fm>:
bug acknowledged by developer. (Wed, 01 Nov 2023 16:24:03 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. (Thu, 30 Nov 2023 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 160 days ago.

Previous Next


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