GNU bug report logs - #12688
AM_PROG_VALAC: error message -> warning message

Previous Next

Package: automake;

Reported by: Sébastien Wilmet <swilmet <at> gnome.org>

Date: Fri, 19 Oct 2012 22:52:03 UTC

Severity: normal

Tags: patch

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

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 12688 in the body.
You can then email your comments to 12688 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#12688; Package automake. (Fri, 19 Oct 2012 22:52:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sébastien Wilmet <swilmet <at> gnome.org>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Fri, 19 Oct 2012 22:52:03 GMT) Full text and rfc822 format available.

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

From: Sébastien Wilmet <swilmet <at> gnome.org>
To: bug-automake <at> gnu.org
Cc: latexila-list <at> gnome.org
Subject: AM_PROG_VALAC: error message -> warning message
Date: Sat, 20 Oct 2012 00:11:55 +0200
Hello,

In the AM_PROG_VALAC macro, when the optional parameter specifying the 
minimum release number is not provided, and if the Vala compiler is not 
found, then there is a _warning_ message.

On the other hand, when the version number is specified, when the Vala 
compiler is too old, there is an _error_ message.

This error message is problematic, because for a tarball, the Vala 
compiler is not required: the generated C code is included in the 
tarball. So if a user wants to compile the software, he shouldn't need 
the valac program.

So the AC_MSG_ERROR should be modified as a AC_MSG_WARN.

Best regards,
Sébastien




Information forwarded to bug-automake <at> gnu.org:
bug#12688; Package automake. (Sat, 20 Oct 2012 18:22:01 GMT) Full text and rfc822 format available.

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

From: Matthieu Baerts <matttbe <at> glx-dock.org>
To: 12688 <at> debbugs.gnu.org
Cc: Sébastien Wilmet <swilmet <at> gnome.org>
Subject: Re: [LaTeXila] AM_PROG_VALAC: error message -> warning message
Date: Sat, 20 Oct 2012 12:31:21 +0200
[Message part 1 (text/plain, inline)]
Hello

20/10/2012 00:11 +0200, Sébastien Wilmet wrote:
> Hello,
> 
> In the AM_PROG_VALAC macro, when the optional parameter specifying the 
> minimum release number is not provided, and if the Vala compiler is not 
> found, then there is a _warning_ message.
> 
> On the other hand, when the version number is specified, when the Vala 
> compiler is too old, there is an _error_ message.
> 
> This error message is problematic, because for a tarball, the Vala 
> compiler is not required: the generated C code is included in the 
> tarball. So if a user wants to compile the software, he shouldn't need 
> the valac program.
> 
> So the AC_MSG_ERROR should be modified as a AC_MSG_WARN.

I confirm that I had this problem with LaTeXila: I had a too old version
of Vala and I was not able to compile LaTeXila except if
'/usr/bin/valac' was removed/renamed.

This is how this bug has been fixed in LaTeXila:
https://github.com/swilmet/latexila/commit/993b073c71f094ca5c15cb2a44e69399176b882a (for those who wants a workaround ;) )

Note that if a warning message is produced when a too old version is
detected, 'VALAC' variable has to be unset in vala.m4


This bug should be fixed with the attached patch :)


Thank you,

Matt
[0001-m4-AM_PROG_VALAC-should-not-produce-an-error.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-automake <at> gnu.org:
bug#12688; Package automake. (Fri, 26 Oct 2012 14:02:01 GMT) Full text and rfc822 format available.

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

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Matthieu Baerts <matttbe <at> glx-dock.org>
Cc: 12688 <at> debbugs.gnu.org,
	Sébastien Wilmet <swilmet <at> gnome.org>
Subject: Re: bug#12688: [LaTeXila] AM_PROG_VALAC: error message -> warning
	message
Date: Fri, 26 Oct 2012 15:59:09 +0200
Hi Matthieu, Sébastien, sorry for the delay.

On 10/20/2012 12:31 PM, Matthieu Baerts wrote:
> Hello
> 
> 20/10/2012 00:11 +0200, Sébastien Wilmet wrote:
>> Hello,
>>
>> In the AM_PROG_VALAC macro, when the optional parameter specifying the 
>> minimum release number is not provided, and if the Vala compiler is not 
>> found, then there is a _warning_ message.
>>
>> On the other hand, when the version number is specified, when the Vala 
>> compiler is too old, there is an _error_ message.
>>
>> This error message is problematic, because for a tarball, the Vala 
>> compiler is not required: the generated C code is included in the 
>> tarball. So if a user wants to compile the software, he shouldn't need 
>> the valac program.
>>
>> So the AC_MSG_ERROR should be modified as a AC_MSG_WARN.
> 
> I confirm that I had this problem with LaTeXila: I had a too old version
> of Vala and I was not able to compile LaTeXila except if
> '/usr/bin/valac' was removed/renamed.
> 
> This is how this bug has been fixed in LaTeXila:
> https://github.com/swilmet/latexila/commit/993b073c71f094ca5c15cb2a44e69399176b882a
> (for those who wants a workaround ;) )
> 
> Note that if a warning message is produced when a too old version is
> detected, 'VALAC' variable has to be unset in vala.m4
> 
> 
> This bug should be fixed with the attached patch :)
> 
> 
> Thank you,
> 
> Matt
>
I agree the behaviour you want is better and more sensible than the
current one.  In fact, it mimics the behaviour of a macro like
AC_PROG_YACC, which doesn't abort configure if a bison/yacc program
is not found in PATH (which makes perfect sense, since Automake
distributes the bison-generated C sources, exactly to ensure the
final user doesn't need to have a proper bison/yacc program himself).

However, I'm not going to apply your patch right away because first
I'd like to work on this other enhancement:

  <http://lists.gnu.org/archive/html/automake-patches/2012-09/msg00012.html>

Once that is done (might be a few days), I will get back to your
patch.  I definitely plan to have it committed (in one form or another)
before releasing Automake 1.12.5.

Thanks,
  Stefano




Information forwarded to bug-automake <at> gnu.org:
bug#12688; Package automake. (Fri, 26 Oct 2012 15:32:02 GMT) Full text and rfc822 format available.

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

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Matthieu Baerts <matttbe <at> glx-dock.org>
Cc: 12688 <at> debbugs.gnu.org,
	Sébastien Wilmet <swilmet <at> gnome.org>
Subject: Re: bug#12688: [LaTeXila] AM_PROG_VALAC: error message -> warning
	message
Date: Fri, 26 Oct 2012 17:29:25 +0200
tags 12688 + patch
thanks

On 10/26/2012 03:59 PM, Stefano Lattarini wrote:
> Hi Matthieu, Sébastien, sorry for the delay.
> 
> On 10/20/2012 12:31 PM, Matthieu Baerts wrote:
>> Hello
>>
>> 20/10/2012 00:11 +0200, Sébastien Wilmet wrote:
>>> Hello,
>>>
>>> In the AM_PROG_VALAC macro, when the optional parameter specifying the 
>>> minimum release number is not provided, and if the Vala compiler is not 
>>> found, then there is a _warning_ message.
>>>
>>> On the other hand, when the version number is specified, when the Vala 
>>> compiler is too old, there is an _error_ message.
>>>
>>> This error message is problematic, because for a tarball, the Vala 
>>> compiler is not required: the generated C code is included in the 
>>> tarball. So if a user wants to compile the software, he shouldn't need 
>>> the valac program.
>>>
>>> So the AC_MSG_ERROR should be modified as a AC_MSG_WARN.
>>
>> I confirm that I had this problem with LaTeXila: I had a too old version
>> of Vala and I was not able to compile LaTeXila except if
>> '/usr/bin/valac' was removed/renamed.
>>
>> This is how this bug has been fixed in LaTeXila:
>> https://github.com/swilmet/latexila/commit/993b073c71f094ca5c15cb2a44e69399176b882a
>> (for those who wants a workaround ;) )
>>
>> Note that if a warning message is produced when a too old version is
>> detected, 'VALAC' variable has to be unset in vala.m4
>>
>>
>> This bug should be fixed with the attached patch :)
>>
>>
>> Thank you,
>>
>> Matt
>>
> I agree the behaviour you want is better and more sensible than the
> current one.  In fact, it mimics the behaviour of a macro like
> AC_PROG_YACC, which doesn't abort configure if a bison/yacc program
> is not found in PATH (which makes perfect sense, since Automake
> distributes the bison-generated C sources, exactly to ensure the
> final user doesn't need to have a proper bison/yacc program himself).
> 
> However, I'm not going to apply your patch right away because first
> I'd like to work on this other enhancement:
> 
>   <http://lists.gnu.org/archive/html/automake-patches/2012-09/msg00012.html>
> 
> Once that is done (might be a few days), I will get back to your
> patch.  I definitely plan to have it committed (in one form or another)
> before releasing Automake 1.12.5.
>
Here is the patch.  Can I have your ACK on it?  I will push it by this
evening if there is no answer by then?

Thanks,
  Stefano

P.S. note that this patch is part of a wider patch series I'm writing, so
it won't apply cleanly on maint or master.  I will later post the whole
series on the automake-patches list, in case anyone is interested.

-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----

From 8a1f86381f1c7a8b21b4da38ebb53b44e1664667 Mon Sep 17 00:00:00 2001
Message-Id: <8a1f86381f1c7a8b21b4da38ebb53b44e1664667.1351264987.git.stefano.lattarini <at> gmail.com>
From: =?UTF-8?q?S=C3=A9bastien=20Wilmet?= <swilmet <at> gnome.org>
Date: Fri, 26 Oct 2012 17:08:09 +0200
Subject: [PATCH] vala: AM_PROG_VALAC should not produce an error for tool-old valac

This change fixes automake bug#12688.

In the AM_PROG_VALAC macro, when the optional parameter specifying the
minimum release number is not provided, and/or if the Vala compiler is
not found, then there is a _warning_ message.

On the other hand, when the version number is specified and if the Vala
compiler is too old, there is an _error_ message.

This error message is problematic, because for a tarball, the Vala
compiler is not required: the generated C code is included in the
tarball.  So if a user wants to compile the software, he shouldn't
need the valac program with the right version.

* m4/vala.m4 (AM_PROG_VALAC): Modify to use AC_MSG_WARN instead
of AC_MSG_ERROR.
* t/vala4.sh: Adjust and enhance.
* doc/automake.texi (Vala Support): Likewise.
* THANKS: Update.

Co-authored-by: Matthieu Baerts <matttbe <at> glx-dock.org>
Co-authored-by: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini <at> gmail.com>
---
 THANKS            |  2 ++
 doc/automake.texi |  3 +--
 m4/vala.m4        |  2 +-
 t/vala4.sh        | 40 +++++++++++++++++++++++++++-------------
 4 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/THANKS b/THANKS
index 88f539c..1ff7c08 100644
--- a/THANKS
+++ b/THANKS
@@ -247,6 +247,7 @@ Matthew D. Langston             langston <at> SLAC.Stanford.EDU
 Matthias Andree                 matthias.andree <at> gmx.de
 Matthias Clasen                 clasen <at> mathematik.uni-freiburg.de
 Matthias Klose                  doko <at> ubuntu.com
+Matthieu Baerts                 matttbe <at> glx-dock.org
 Max Horn                        max <at> quendi.de
 Maxim Sinev                     good <at> goods.ru
 Maynard Johnson                 maynardj <at> us.ibm.com
@@ -348,6 +349,7 @@ Sam Steingold                   sds <at> gnu.org
 Sander Niemeijer                niemeijer <at> science-and-technology.nl
 Santiago Vila                   sanvila <at> unex.es
 Scott James Remnant             scott <at> netsplit.com
+Sébastien Wilmet                swilmet <at> gnome.org
 Sergey Poznyakoff               gray <at> gnu.org.ua
 Sergey Vlasov                   vsu <at> mivlgu.murom.ru
 Seth Alves                      alves <at> hungry.com
diff --git a/doc/automake.texi b/doc/automake.texi
index 54262c8..aaf4a98 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -6893,8 +6893,7 @@ package.  If a compiler is found and satisfies @var{minimum-version},
 then @var{action-if-found} is run (this defaults to do nothing).
 Otherwise, @var{action-if-not-found} is run.  If @var{action-if-not-found}
 is not specified, the default value is to print a warning in case no
-compiler is found, and to abort the configure script (with status 77)
-if a too-old version of the compiler is found.
+compiler is found, or if a too-old version of the compiler is found.
 @end defmac

 There are a few variables that are used when compiling Vala sources:
diff --git a/m4/vala.m4 b/m4/vala.m4
index 0674c8e..0da8d67 100644
--- a/m4/vala.m4
+++ b/m4/vala.m4
@@ -27,7 +27,7 @@ AC_DEFUN([AM_PROG_VALAC],
          [AC_MSG_RESULT([no])
           VALAC=:])])
     if test x"$VALAC" = x":"; then
-      m4_default([$3], [AC_MSG_ERROR([no proper vala compiler found], [77])])
+      m4_default([$3], [AC_MSG_WARN([no proper vala compiler found])])
     else
       m4_default([$2], [:])
     fi])])
diff --git a/t/vala4.sh b/t/vala4.sh
index f622e5c..fcb60ed 100755
--- a/t/vala4.sh
+++ b/t/vala4.sh
@@ -26,7 +26,7 @@ END

 cat > Makefile.am << 'END'
 has-valac:
-	case '$(VALAC)' in *valac) exit 0;; *) exit 1;; esac
+	case '$(VALAC)' in */valac) exit 0;; *) exit 1;; esac
 no-valac:
 	test x'$(VALAC)' = x:
 END
@@ -59,23 +59,29 @@ $ACLOCAL
 $AUTOMAKE -a
 $AUTOCONF

-# The "|| exit 1" are required here even if 'set -e' is active,
-# because ./configure might exit with status 77, and in that case
-# we want to FAIL, not to SKIP.
-./configure || exit 1
+st=0; ./configure 2>stderr || st=$?
+cat stderr >&2
+grep 'WARNING.*vala' stderr && exit 1
+test $st -eq 0
 $MAKE has-valac
-vala_version=99.9 ./configure || exit 1
+
+st=0; vala_version=99.9 ./configure 2>stderr || st=$?
+cat stderr >&2
+grep 'WARNING.*vala' stderr && exit 1
+test $st -eq 0
 $MAKE has-valac

 st=0; vala_version=0.1.2 ./configure 2>stderr || st=$?
 cat stderr >&2
-test $st -eq 77 || exit 1
-#$MAKE no-valac
+test $st -eq 0
+grep '^configure: WARNING: no proper vala compiler found' stderr
+$MAKE no-valac

 st=0; ./configure VALAC="$(pwd)/bin/valac.old" 2>stderr || st=$?
 cat stderr >&2
-test $st -eq 77 || exit 1
-#$MAKE no-valac
+test $st -eq 0 || exit 1
+grep '^configure: WARNING: no proper vala compiler found' stderr
+$MAKE no-valac

 sed 's/^\(AM_PROG_VALAC\).*/\1([1], [: > ok], [: > ko])/' <configure.ac >t
 mv -f t configure.ac
@@ -83,19 +89,27 @@ rm -rf autom4te*.cache
 $ACLOCAL
 $AUTOCONF

-./configure
+st=0; ./configure 2>stderr || st=$?
+cat stderr >&2
+grep 'WARNING.*vala' stderr && exit 1
 test -f ok
 test ! -e ko
 $MAKE has-valac
 rm -f ok ko

-vala_version=0.1.2 ./configure
+st=0; vala_version=0.1.2 ./configure 2>stderr || st=$?
+cat stderr >&2
+grep 'WARNING.*vala' stderr && exit 1
+test $st -eq 0
 test ! -e ok
 test -f ko
 $MAKE no-valac
 rm -f ok ko

-./configure VALAC="$(pwd)/bin/valac.old"
+st=0; ./configure VALAC="$(pwd)/bin/valac.old" 2>stderr || st=$?
+cat stderr >&2
+grep 'WARNING.*vala' stderr && exit 1
+test $st -eq 0
 test ! -e ok
 test -f ko
 $MAKE no-valac
-- 
1.8.0




Added tag(s) patch. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 26 Oct 2012 15:32:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#12688; Package automake. (Fri, 26 Oct 2012 15:58:02 GMT) Full text and rfc822 format available.

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

From: Matthieu Baerts <matttbe <at> glx-dock.org>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: 12688 <at> debbugs.gnu.org,
	Sébastien Wilmet <swilmet <at> gnome.org>
Subject: Re: bug#12688: [LaTeXila] AM_PROG_VALAC: error message -> warning
	message
Date: Fri, 26 Oct 2012 17:55:04 +0200
[Message part 1 (text/plain, inline)]
Hi Stefano and thank you for maintaining Automake :)

On 10/26/2012 17:29 +0200, Stefano Lattarini wrote:
> tags 12688 + patch
> thanks
> 
> On 10/26/2012 03:59 PM, Stefano Lattarini wrote:
> > Hi Matthieu, Sébastien, sorry for the delay.
> > I agree the behaviour you want is better and more sensible than the
> > current one.  In fact, it mimics the behaviour of a macro like
> > AC_PROG_YACC, which doesn't abort configure if a bison/yacc program
> > is not found in PATH (which makes perfect sense, since Automake
> > distributes the bison-generated C sources, exactly to ensure the
> > final user doesn't need to have a proper bison/yacc program himself).
> > 
> > However, I'm not going to apply your patch right away because first
> > I'd like to work on this other enhancement:
> > 
> >   <http://lists.gnu.org/archive/html/automake-patches/2012-09/msg00012.html>
> > 
> > Once that is done (might be a few days), I will get back to your
> > patch.  I definitely plan to have it committed (in one form or another)
> > before releasing Automake 1.12.5.
> >
> Here is the patch.  Can I have your ACK on it?  I will push it by this
> evening if there is no answer by then?

This seems perfect, thank you for this fix!

> Thanks,
>   Stefano
> 
> P.S. note that this patch is part of a wider patch series I'm writing, so
> it won't apply cleanly on maint or master.  I will later post the whole
> series on the automake-patches list, in case anyone is interested.

I'll test this new version asap.

Have a nice day,

Thanks,
Matt

[signature.asc (application/pgp-signature, inline)]

bug closed, send any further explanations to 12688 <at> debbugs.gnu.org and Sébastien Wilmet <swilmet <at> gnome.org> Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 21 Nov 2012 13:24: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. (Thu, 20 Dec 2012 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 179 days ago.

Previous Next


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