Hi Bruno, thanks for the report.

On 04/21/2012 02:54 PM, Bruno Haible wrote:
> Hi Stefano,
> 
> In Automake 1.11.3b I reported these:
>>> FAIL: vala-vpath.test
>>> FAIL: vala-mix.test
>>> FAIL: vala-mix2.test
>>
>>> [SNIP]
>> ...
>>> Looking at git://git.gnome.org/vala it is clear that the option --profile
>>> was added on 2009-05-08, in version 0.7.3. The autoconf test reported
>>> "checking /arch/x86_64-linux/gnu/bin/valac is at least version 0.7... yes"
>>> which is correct. But it should have tested for at least version 0.7.3.
>>>
>> Thanks for the analysis.  I've added you as the main author of the patch to
>> fix this bug (attached).  Can you confirm that it works
> 
> Now I'm testing Automake 1.11.4 and 1.11.5. The vala-vpath.test is now
> SKIPped, as expected.
> 
> The tests vala-mix.test and vala-mix2.test and, in 1.11.5, vala-vapi.test
> all still failing, however.
> 
> FAIL: vala-mix.test
> FAIL: vala-mix2.test
> FAIL: vala-vapi.test
> 
> Excerpts from tests/test-suite.log:
> 
> 
> FAIL: vala-mix.test (exit: 1)
> =============================
> 
> vala-mix: running valac --version
> Vala 0.7.2
> vala-mix: dummy requirement 'cc', no check done
> vala-mix: running make --version -v | grep GNU
> GNU Make 3.81
> === Running test ./vala-mix.test
> ...
> checking for valac... /arch/x86_64-linux/gnu/bin/valac
> checking /arch/x86_64-linux/gnu/bin/valac is at least version 0.7.3... no
> configure: error: Vala 0.7.3 not found.
> + exit_status=1
> + set +e
> + cd /home/bruno/data/build/automake-1.11.5/tests
> + case $exit_status,$keep_testdirs in
> + test 0 '!=' 0
> + echo 'vala-mix: exit 1'
> vala-mix: exit 1
> + exit 1
> 
> FAIL: vala-mix2.test (exit: 1)
> ==============================
> 
> vala-mix2: running valac --version
> Vala 0.7.2
> vala-mix2: dummy requirement 'cc', no check done
> vala-mix2: dummy requirement 'c++', no check done
> vala-mix2: running make --version -v | grep GNU
> GNU Make 3.81
> === Running test ./vala-mix2.test
> ...
> checking for valac... /arch/x86_64-linux/gnu/bin/valac
> checking /arch/x86_64-linux/gnu/bin/valac is at least version 0.7.3... no
> configure: error: Vala 0.7.3 not found.
> + exit_status=1
> + set +e
> + cd /home/bruno/data/build/automake-1.11.5/tests
> + case $exit_status,$keep_testdirs in
> + test 0 '!=' 0
> + echo 'vala-mix2: exit 1'
> vala-mix2: exit 1
> + exit 1
> 
> FAIL: vala-vapi.test (exit: 1)
> ==============================
> 
> vala-vapi: running valac --version
> Vala 0.7.2
> vala-vapi: dummy requirement 'cc', no check done
> vala-vapi: running make --version -v | grep GNU
> GNU Make 3.81
> === Running test ./vala-vapi.test
> ...
> checking for valac... /arch/x86_64-linux/gnu/bin/valac
> checking /arch/x86_64-linux/gnu/bin/valac is at least version 0.7.3... no
> configure: error: Vala 0.7.3 not found.
> + exit_status=1
> + set +e
> + cd /home/bruno/data/build/automake-1.11.5/tests
> + case $exit_status,$keep_testdirs in
> + test 0 '!=' 0
> + echo 'vala-vapi: exit 1'
> vala-vapi: exit 1
> + exit 1
> 
> Whereas in the test that is skipped:
> 
> SKIP: vala-vpath.test (exit: 77)
> ================================
> 
> vala-vpath: running valac --version
> Vala 0.7.2
> vala-vpath: running make --version -v | grep GNU
> GNU Make 3.81
> === Running test ./vala-vpath.test
> ...
> checking for valac... /arch/x86_64-linux/gnu/bin/valac
> checking /arch/x86_64-linux/gnu/bin/valac is at least version 0.7.3... no
> configure: error: Vala 0.7.3 not found.
> + Exit 77
> + set +e
> + exit 77
> + exit 77
> + exit_status=77
> + set +e
> + cd /home/bruno/data/build/automake-1.11.5/tests
> + case $exit_status,$keep_testdirs in
> + test 0 '!=' 0
> + echo 'vala-vpath: exit 77'
> vala-vpath: exit 77
> + exit 77
> 
> This patch fixes the failures.
> 
> --- tests/vala-mix2.test.bak  2012-04-13 16:46:01.000000000 +0200
> +++ tests/vala-mix2.test      2012-04-21 14:50:53.000000000 +0200
> @@ -73,7 +73,7 @@
>  $AUTOMAKE -a
>  $AUTOCONF
>  
> -./configure
> +./configure || Exit 77
>  
>  $MAKE all
>  ls -l # For debugging.
> --- tests/vala-mix.test.bak   2012-04-13 16:46:01.000000000 +0200
> +++ tests/vala-mix.test       2012-04-21 14:50:49.000000000 +0200
> @@ -87,7 +87,7 @@
>  $AUTOMAKE -a
>  $AUTOCONF
>  
> -./configure
> +./configure || Exit 77
>  
>  $MAKE all
>  ls -l # For debugging.
> --- tests/vala-vapi.test.bak  2012-04-13 16:46:01.000000000 +0200
> +++ tests/vala-vapi.test      2012-04-21 14:50:56.000000000 +0200
> @@ -66,7 +66,7 @@
>  $AUTOMAKE -a
>  $AUTOCONF
>  
> -./configure --enable-dependency-tracking
> +./configure --enable-dependency-tracking || Exit 77
>  
>  $MAKE
>  ls -l        # For debugging.
> 

I think that the best fix would be to improve AM_PROG_VALAC to exit
with status '77' instead of '1' if the vala compiler found is too old;
so, what about the attached patch?  Most importantly, would it fix
the failures you are seeing?

Thanks,
  Stefano
>From 001db08953af104250a2d00f7e46c9b4817d2ced Mon Sep 17 00:00:00 2001
Message-Id: <001db08953af104250a2d00f7e46c9b4817d2ced.1335016417.git.stefano.lattar...@gmail.com>
From: Stefano Lattarini <stefano.lattar...@gmail.com>
Date: Sat, 21 Apr 2012 15:51:09 +0200
Subject: [PATCH] vala: configure exit with status 77, not 1, if valac version
 is too old

>From a report by Bruno Haible in automake bug#1193.  This change should
also automatically avoid spurious testsuite failures with older vala
versions.

* m4/vala.m4 (AM_PROG_VALAC): Exit with status 77, rather than 1, if
the Vala compiler found older than the minimal required version (if
any).  This is more consistent with what is done by other macros like
AM_PROG_UPC or AC_PROG_CC.
* NEWS: Update.
* t/vala-headers.sh: Adjust, so that the test is only skipped of the
vala compiler is too old or the required PKG_CHECK_MODULES third-party
macro is not found by aclocal, and not if a generic error happens in
the configure script.
* t/vala-libs.sh: Likewise.
* t/vala2.sh: Likewise.
* t/vala3.sh: Likewise.
* t/vala5.sh: Likewise.
* t/vala-vpath.sh: Likewise (but don't check for the potential error
with PKG_CHECK_MODULES, as that macro is not used in any way here).
* t/vala4.sh: Adjust, to avoid the new semantic causing this test to
skip instead of failing.

Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com>
---
 NEWS              |    3 +++
 m4/vala.m4        |    4 ++--
 t/vala-headers.sh |    4 +++-
 t/vala-libs.sh    |    4 +++-
 t/vala-vpath.sh   |    2 +-
 t/vala2.sh        |    4 +++-
 t/vala3.sh        |    4 +++-
 t/vala4.sh        |   12 +++++++++---
 t/vala5.sh        |    2 +-
 9 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/NEWS b/NEWS
index 0410158..75ca31f 100644
--- a/NEWS
+++ b/NEWS
@@ -182,6 +182,9 @@ New in 1.11e:
 
 * Miscellaneous changes:
 
+  - The AM_PROG_VALAC macro now causes configure to exit with status 77,
+    rather than 1, if the vala compiler found is too old.
+
   - The build system of Automake itself now avoids the use of make
     recursion as much as possible.
 
diff --git a/m4/vala.m4 b/m4/vala.m4
index ea7e5f7..cc6ba53 100644
--- a/m4/vala.m4
+++ b/m4/vala.m4
@@ -6,7 +6,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 6
 
 # Check whether the Vala compiler exists in $PATH. If it is found, the
 # variable VALAC is set. Optionally a minimum release number of the
@@ -25,5 +25,5 @@ AC_DEFUN([AM_PROG_VALAC],
          [AC_MSG_RESULT([yes])],
          [AC_MSG_RESULT([yes])],
          [AC_MSG_RESULT([no])
-          AC_MSG_ERROR([Vala $1 not found.])])])])
+          AC_MSG_ERROR([Vala $1 not found.], [77])])])])
 ])
diff --git a/t/vala-headers.sh b/t/vala-headers.sh
index ffb66d9..a091c4c 100755
--- a/t/vala-headers.sh
+++ b/t/vala-headers.sh
@@ -62,7 +62,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure || skip_ "configure failure"
+grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
+
+./configure
 $MAKE
 
 # Test rebuild rules.
diff --git a/t/vala-libs.sh b/t/vala-libs.sh
index fa1d21b..00befdd 100755
--- a/t/vala-libs.sh
+++ b/t/vala-libs.sh
@@ -49,7 +49,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure || skip_ "configure failed"
+grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
+
+./configure
 
 cat > mu2.c << 'END'
 #include "mu2.h"
diff --git a/t/vala-vpath.sh b/t/vala-vpath.sh
index ae2d792..f2da4af 100755
--- a/t/vala-vpath.sh
+++ b/t/vala-vpath.sh
@@ -49,7 +49,7 @@ $AUTOMAKE
 
 mkdir build
 cd build
-../configure || Exit 77
+../configure
 $MAKE
 test -f ../foo_vala.stamp
 test -f ../bar_vala.stamp
diff --git a/t/vala2.sh b/t/vala2.sh
index 4ed1c79..cf52c50 100755
--- a/t/vala2.sh
+++ b/t/vala2.sh
@@ -56,7 +56,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure || skip_ "configure failure"
+grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
+
+./configure
 $MAKE
 
 # Test rebuild rules.
diff --git a/t/vala3.sh b/t/vala3.sh
index bb9bc15..220c76b 100755
--- a/t/vala3.sh
+++ b/t/vala3.sh
@@ -50,7 +50,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure || skip_ "configure failure"
+grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
+
+./configure
 $MAKE
 test -f src/zardoz.c
 test -f src_zardoz_vala.stamp
diff --git a/t/vala4.sh b/t/vala4.sh
index 067ea3f..879803f 100755
--- a/t/vala4.sh
+++ b/t/vala4.sh
@@ -43,16 +43,22 @@ cwd=`pwd`
 $ACLOCAL
 $AUTOMAKE -a
 $AUTOCONF
-./configure "VALAC=$cwd/valac" || Exit $?
+
+# The "|| Exit 1" is required here even if 'set -e' is active,
+# because ./configure migt exit with status 77, and in that case
+# we want to FAIL, not to SKIP.
+./configure "VALAC=$cwd/valac" || Exit 1
 
 sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([9999.9])/' < configure.ac >t
 mv -f t configure.ac
 $AUTOCONF --force
-./configure "VALAC=$cwd/valac" && Exit 1
+st=0; ./configure "VALAC=$cwd/valac" || st=$?
+test $st -eq 77 || Exit 1
 
 sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([1.2.3])/' < configure.ac >t
 mv -f t configure.ac
 $AUTOCONF --force
-./configure "VALAC=$cwd/valac" || Exit $?
+# See comments above for why "|| Exit 1" is needed.
+./configure "VALAC=$cwd/valac" || Exit 1
 
 :
diff --git a/t/vala5.sh b/t/vala5.sh
index 0c45d1e..6ea2738 100755
--- a/t/vala5.sh
+++ b/t/vala5.sh
@@ -70,7 +70,7 @@ $AUTOMAKE -a
 
 grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
 
-./configure || skip_ "configure failure"
+./configure
 $MAKE
 
 if cross_compiling; then :; else
-- 
1.7.9.5

Reply via email to