Re: AC_PACKAGE_VERSION visibility slightly changed in autoconf-2.69c. Bug or feature?

2020-10-20 Thread Sergei Trofimovich
On Tue, 20 Oct 2020 16:57:16 -0400
Nick Bowler  wrote:

> Hi,
> 
> On 2020-10-20, Sergei Trofimovich  wrote:
> > Initial bug is reported as autoconf failure on ghc-8.8.4:
> > https://bugs.gentoo.org/750191
> > There autconf 2.69 works, 2.69c does not.  
> 
> Note: the change you report is introduced by Zack's fix for related
> AC_INIT quoting regressions.  This patch is not included in 2.69c (or
> even on git master), but does seem to be applied by the Gentoo package.
> 
> The 2.69c release version seems to handle the example fine.

Oh, I did not realize we carry an out of tree patch with such a behaviour
change. Redirected the bug to Gentoo autoconf package maintainers.

Thank you!

-- 

  Sergei



Re: AC_PACKAGE_VERSION visibility slightly changed in autoconf-2.69c. Bug or feature?

2020-10-20 Thread Nick Bowler
Hi,

On 2020-10-20, Sergei Trofimovich  wrote:
> Initial bug is reported as autoconf failure on ghc-8.8.4:
> https://bugs.gentoo.org/750191
> There autconf 2.69 works, 2.69c does not.

Note: the change you report is introduced by Zack's fix for related
AC_INIT quoting regressions.  This patch is not included in 2.69c (or
even on git master), but does seem to be applied by the Gentoo package.

The 2.69c release version seems to handle the example fine.

> Here is the minimal example:
>
> OK:
>
>   $ cat configure.ac
>   AC_INIT([The Glorious Glasgow Haskell Compilation System], [9.1.0],
> [glasgow-haskell-b...@haskell.org], [ghc-AC_PACKAGE_VERSION])
>
>   echo "$PACKAGE_VERSION"
>
>   AC_OUTPUT
>   $ autoconf-2.69
>   $ ./configure
>   9.1.0
>   configure: creating ./config.status
>
> BAD:
>
>   $ autoconf-2.70_beta2
>   configure.ac:1: error: possibly undefined macro: AC_PACKAGE_VERSION
>   If this token and others are legitimate, please use m4_pattern_allow.
>   See the Autoconf documentation.

Yes I think now Zack's underquotation fixes have added the opposite
problem.  There is now too much quotation so the tarname (and other
arguments) are not fully expanded when used.

At least these changes should probably be simply dropped from the patch
or at least they perhaps need more consideration...

@@ -436,18 +427,12 @@ AC_SUBST([SHELL])dnl
 AC_SUBST([PATH_SEPARATOR])dnl

 # Identity of this package.
-AC_SUBST([PACKAGE_NAME],
-[m4_ifdef([AC_PACKAGE_NAME],  ['AC_PACKAGE_NAME'])])dnl
-AC_SUBST([PACKAGE_TARNAME],
-[m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])dnl
-AC_SUBST([PACKAGE_VERSION],
-[m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])dnl
-AC_SUBST([PACKAGE_STRING],
-[m4_ifdef([AC_PACKAGE_STRING],['AC_PACKAGE_STRING'])])dnl
-AC_SUBST([PACKAGE_BUGREPORT],
-[m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl
-AC_SUBST([PACKAGE_URL],
-[m4_ifdef([AC_PACKAGE_URL],   ['AC_PACKAGE_URL'])])dnl
+AC_SUBST([PACKAGE_NAME],  ['m4_defn([AC_PACKAGE_NAME])'])dnl
+AC_SUBST([PACKAGE_TARNAME],   ['m4_defn([AC_PACKAGE_TARNAME])'])dnl
+AC_SUBST([PACKAGE_VERSION],   ['m4_defn([AC_PACKAGE_VERSION])'])dnl
+AC_SUBST([PACKAGE_STRING],['m4_defn([AC_PACKAGE_STRING])'])dnl
+AC_SUBST([PACKAGE_BUGREPORT], ['m4_defn([AC_PACKAGE_BUGREPORT])'])dnl
+AC_SUBST([PACKAGE_URL],   ['m4_defn([AC_PACKAGE_URL])'])dnl

 m4_divert_pop([DEFAULTS])dnl
 m4_wrap_lifo([m4_divert_text([DEFAULTS],
@@ -1099,9 +1084,8 @@ Fine tuning of the installation directories:
   --infodir=DIR   info documentation [DATAROOTDIR/info]
   --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
   --mandir=DIRman documentation [DATAROOTDIR/man]
-]AS_HELP_STRING([--docdir=DIR],
-  [documentation root ]@<:@DATAROOTDIR/doc/m4_ifset([AC_PACKAGE_TARNAME],
-[AC_PACKAGE_TARNAME], [PACKAGE])@:>@)[
+  --docdir=DIRdocumentation root @<:@DATAROOTDIR/doc/]dnl
+m4_default_quoted(m4_defn([AC_PACKAGE_TARNAME]), [PACKAGE])[@:>@
   --htmldir=DIR   html documentation [DOCDIR]
   --dvidir=DIRdvi documentation [DOCDIR]
   --pdfdir=DIRpdf documentation [DOCDIR]

If you drop those two hunks from Zack's patch the example should work again.

Cheers,
  Nick



AC_PACKAGE_VERSION visibility slightly changed in autoconf-2.69c. Bug or feature?

2020-10-20 Thread Sergei Trofimovich
Initial bug is reported as autoconf failure on ghc-8.8.4:
https://bugs.gentoo.org/750191
There autconf 2.69 works, 2.69c does not.

Here is the minimal example:

OK:

  $ cat configure.ac
  AC_INIT([The Glorious Glasgow Haskell Compilation System], [9.1.0], 
[glasgow-haskell-b...@haskell.org], [ghc-AC_PACKAGE_VERSION])

  echo "$PACKAGE_VERSION"

  AC_OUTPUT
  $ autoconf-2.69
  $ ./configure
  9.1.0
  configure: creating ./config.status

BAD:

  $ autoconf-2.70_beta2
  configure.ac:1: error: possibly undefined macro: AC_PACKAGE_VERSION
  If this token and others are legitimate, please use m4_pattern_allow.
  See the Autoconf documentation.

https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Initializing-configure.html
says AC_INIT should define the AC_PACKAGE_VERSION, but evaluation probably 
happens later.

Should autoconf restore the old behaviour or should ghc adapt?
If we are to adapt what would be the best way not to repeat the version?

Thank you!

-- 

  Sergei