bug#7849: new instspc* test failures
Hi Peter, thanks for the patch. Looks good, modulo a couple of nits below. Feel free to push to master when they have been addressed. On 01/05/2012 01:35 AM, Peter Rosin wrote: From 27100f0b94f8e38e8bd30c27277d7ad4e9f4dd1a Mon Sep 17 00:00:00 2001 From: Peter Rosin p...@lysator.liu.se Date: Thu, 5 Jan 2012 01:29:27 +0100 Subject: [PATCH] tests: work around strangeness in MSYS MSYS mishandles carriage returns and behaves very strange for s/strange/strangely/? Not a rhetorical question -- strangely seems more correct to me, but I'm not sure it really is. directories with colon in them. It seems that colon-directories are somehow mixed up with drive letters. Fixes automake bug#7849. * tests/instspc.tap: Skip instead of erroring out when $test_string is empty for the carriageret case, as that is expected on MSYS. Also, for similar reasons, skip instead of erroring out when it is not possible to cd into the just created directory, and the directory name contains a colon. I assume that, after your changes, this test doesn't error out anymore and doesn't experience any failure even on MSYS. Right? If there are still failures, it might be worth stating it in the commit message. --- tests/instspc.tap | 28 +++- 1 files changed, 27 insertions(+), 1 deletions(-) diff --git a/tests/instspc.tap b/tests/instspc.tap index 9eb145f..2e9641c 100755 --- a/tests/instspc.tap +++ b/tests/instspc.tap The copyright years should be updated (the `update-copyright' script from gnulib can help you with this chore). [SNIP] Thanks, Stefano
bug#7849: new instspc* test failures
Stefano Lattarini skrev 2012-01-05 09:38: Hi Peter, thanks for the patch. Looks good, modulo a couple of nits below. Feel free to push to master when they have been addressed. Pushed with nits addressed. I'm not sure about the strange/strangely thing either, but strangely seems safer so... The test no longer errors out on MSYS, it's all PASS, XFAIL and SKIPs. Cheers, Peter
bug#7849: new instspc* test failures
tags 7849 patch close 7849 thanks On 01/05/2012 10:53 AM, Peter Rosin wrote: Stefano Lattarini skrev 2012-01-05 09:38: Hi Peter, thanks for the patch. Looks good, modulo a couple of nits below. Feel free to push to master when they have been addressed. Pushed with nits addressed. I'm not sure about the strange/strangely thing either, but strangely seems safer so... The test no longer errors out on MSYS, it's all PASS, XFAIL and SKIPs. Very good! Then I'm closing the bug report. Thank you very much for working on this, Stefano
bug#10436: New testsuite driver and extra trailing backslash in recipes
On 01/05/2012 01:47 PM, Stefano Lattarini wrote: [adding bug-automake in CC:] Reference: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=104367#8 And here is the definitive version of the patch that I'll push by this evening (to master) if there is no objection. Thanks, Stefano From c891eff22b84027ea56cf67b4c5aac55b75390d9 Mon Sep 17 00:00:00 2001 Message-Id: c891eff22b84027ea56cf67b4c5aac55b75390d9.1325768871.git.stefano.lattar...@gmail.com From: Stefano Lattarini stefano.lattar...@gmail.com Date: Thu, 5 Jan 2012 13:41:13 +0100 Subject: [PATCH] parallel-tests: avoid trailing backslashes in make recipes The new testsuite-harness could generate recipes with a trailing backslash character (possibly followed by blank characters only), in the very common case where the user hadn't defined the special $(AM_TESTS_FD_REDIRECT) variable. This caused spurious syntax errors with at least older bash versions (e.g., bash 2.05b), and could be potentially unportable to other weaker shells. See automake bug#10436: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10436 and coreutils bug#10427: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10427#8 * lib/am/check2.am: Rework line breaks so that no backslash can be at the end of a line. * tests/parallel-tests-trailing-bslash.test: New test. * tests/list-of-tests.mk: Add it. --- lib/am/check2.am | 10 +- tests/list-of-tests.mk|1 + tests/parallel-tests-trailing-bslash.test | 114 + 3 files changed, 120 insertions(+), 5 deletions(-) create mode 100755 tests/parallel-tests-trailing-bslash.test diff --git a/lib/am/check2.am b/lib/am/check2.am index ad0a4aa..9a0fe9d 100644 --- a/lib/am/check2.am +++ b/lib/am/check2.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc. +## Copyright (C) 2008, 2009, 2011, 2012 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -19,8 +19,8 @@ ?!GENERIC?%OBJ%: %SOURCE% @p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name $$f \ --log-file '%BASE%.log' --trs-file '%BASE%.trs' \ - $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% $$tst \ - $(AM_TESTS_FD_REDIRECT) + $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \ + $$tst $(AM_TESTS_FD_REDIRECT) ## If no programs are built in this package, then this rule is removed ## at automake time. Otherwise, %am__EXEEXT% expands to a configure time @@ -30,6 +30,6 @@ if %am__EXEEXT% ?GENERIC?%EXT%$(EXEEXT).log: @p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name $$f \ --log-file '%BASE%.log' --trs-file '%BASE%.trs' \ - $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% $$tst \ - $(AM_TESTS_FD_REDIRECT) + $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \ + $$tst $(AM_TESTS_FD_REDIRECT) endif %am__EXEEXT% diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk index 8b4f2ca..dbadfdc 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -709,6 +709,7 @@ parallel-tests-no-spurious-summary.test \ parallel-tests-exit-statuses.test \ parallel-tests-console-output.test \ parallel-tests-once.test \ +parallel-tests-trailing-bslash.test \ tests-environment.test \ am-tests-environment.test \ tests-environment-backcompat.test \ diff --git a/tests/parallel-tests-trailing-bslash.test b/tests/parallel-tests-trailing-bslash.test new file mode 100755 index 000..418b722 --- /dev/null +++ b/tests/parallel-tests-trailing-bslash.test @@ -0,0 +1,114 @@ +#! /bin/sh +# Copyright (C) 2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +# Check that the new testsuite harness do not generate recipes that can +# have a trailing `\', since that can cause spurious syntax errors with +# older bash versions (e.g., bash 2.05b). +# See automake bug#10436. + +am_parallel_tests=yes +. ./defs || Exit 1 + +echo AC_OUTPUT configure.in + +cat Makefile.am 'END' +TESTS = foo.test +EXTRA_DIST = $(TESTS) +am__backslash = \\ # foo +.PHONY: bad-recipe +bad-recipe: + @printf '%s\n' $(am__backslash) +END + +cat foo.test 'END' +#!/bin/sh +exit 0 +END +chmod +x foo.test + +am__SHELL=$SHELL; export am__SHELL +am__PERL=$PERL; export am__PERL + +cat my-shell 'END' +#!/bin/sh -e +set -u
bug#10437: parallel-tests: `recheck' recipe can cause sed to be invoked with too long input lines
On 01/05/12 06:07, Stefano Lattarini wrote: Which sort of thing exactly? I could find only one place which suffers of the problem you've pointed out, i.e., the `recheck recheck-html' rules in lib/am/check.am. Am I missing something? Sorry, that appears to have been a miscount on my part: I was counting some files that Automake generates for itself while building. In Automake source there are only two instances, which your patch caught: the 'recheck recheck-html' rule and the 'check-TESTS' rule (the latter is what actually triggered the problem with coreutils). So this should be OK. Thanks for the quick fixes, by the way!
bug#10436: bug#10427: bug#10436: New testsuite driver and extra trailing backslash in recipes
I pushed the following doc fix into Autoconf, so that these two portability issues are documented there. It turns out that the second issue is actually due to an old Bash bug -- it's not Solaris-specific. From b1f0e147aa7aa259dea2c34c5a0ac7965d6efd7e Mon Sep 17 00:00:00 2001 From: Paul Eggert egg...@cs.ucla.edu Date: Thu, 5 Jan 2012 11:00:45 -0800 Subject: [PATCH 1/2] doc: clarify sed buffer limit * doc/autoconf.texi (Limitations of Usual Tools): That 4000-byte limit applies to output and internal buffers, too. --- ChangeLog |6 ++ doc/autoconf.texi |5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30312be..238c09f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-01-05 Paul Eggert egg...@cs.ucla.edu + + doc: clarify sed buffer limit + * doc/autoconf.texi (Limitations of Usual Tools): + That 4000-byte limit applies to output and internal buffers, too. + 2012-01-03 Paul Eggert egg...@cs.ucla.edu maint: update copyright year diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 72ff7f8..ea2419b 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -19256,8 +19256,9 @@ $ @kbd{echo a | sed 's/x/x/;;s/x/x/'} sed: 1: s/x/x/;;s/x/x/: invalid command code ; @end example -Input should not have unreasonably long lines, since some @command{sed} -implementations have an input buffer limited to 4000 bytes. Likewise, +Some @command{sed} implementations have a buffer limited to 4000 bytes, +and this limits the size of input lines, output lines, and internal +buffers that can be processed portably. Likewise, not all @command{sed} implementations can handle embedded @code{NUL} or a missing trailing newline. -- 1.7.6.5 From 0445b4ad121e6356f409833dec3678ae613e1d08 Mon Sep 17 00:00:00 2001 From: Paul Eggert egg...@cs.ucla.edu Date: Thu, 5 Jan 2012 12:32:12 -0800 Subject: [PATCH 2/2] doc: mention Bash 2.03 bug with backslash-newline * doc/autoconf.texi (Invoking the Shell): New section. (Backslash-Newline-Empty): Rename from Backslash-Newline-Newline. Mention problem with Bash 2.03. --- ChangeLog |5 doc/autoconf.texi | 56 +--- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 238c09f..69df405 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2012-01-05 Paul Eggert egg...@cs.ucla.edu + doc: mention Bash 2.03 bug with backslash-newline + * doc/autoconf.texi (Invoking the Shell): New section. + (Backslash-Newline-Empty): Rename from Backslash-Newline-Newline. + Mention problem with Bash 2.03. + doc: clarify sed buffer limit * doc/autoconf.texi (Limitations of Usual Tools): That 4000-byte limit applies to output and internal buffers, too. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index ea2419b..5c3feef 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -501,6 +501,7 @@ Dependencies Between Macros Portable Shell Programming * Shellology:: A zoology of shells +* Invoking the Shell:: Invoking the shell as a command * Here-Documents:: Quirks and tricks * File Descriptors::FDs and redirections * Signal Handling:: Shells, signals, and headaches @@ -520,7 +521,7 @@ Portable Make Programming * $ in Ordinary Make Rules:: $ in ordinary rules * Failure in Make Rules:: Failing portably in rules * Special Chars in Names:: Special Characters in Macro Names -* Backslash-Newline-Newline:: Empty last lines in macro definitions +* Backslash-Newline-Empty:: Empty lines after backslash-newline * Backslash-Newline Comments:: Spanning comments across line boundaries * Long Lines in Makefiles:: Line length limitations * Macros and Submakes:: @code{make macro=value} and submakes @@ -15067,6 +15068,7 @@ subset described above, is fairly portable nowadays. Also please see @menu * Shellology:: A zoology of shells +* Invoking the Shell:: Invoking the shell as a command * Here-Documents:: Quirks and tricks * File Descriptors::FDs and redirections * Signal Handling:: Shells, signals, and headaches @@ -15205,6 +15207,28 @@ The default Mac OS X @command{sh} was originally Zsh; it was changed to Bash in Mac OS X 10.2. @end table +@node Invoking the Shell +@section Invoking the Shell +@cindex invoking the shell +@cindex shell invocation + +Bash 2.03 has a bug when invoked with the @option{-c} option: if the +option-argument ends in backslash-newline, Bash incorrectly reports a +syntax error. The problem does not occur if a character follows the +backslash: + +@example +$ @kbd{$ bash -c 'echo foo \} + @kbd{'} +bash: -c: line 2: syntax error: unexpected end of file +$ @kbd{bash -c 'echo foo \} + @kbd{ '} +foo +@end example + +@noindent
bug#10440: Can't locate TAP/Parser.pm
Hi! I tried make check on MSYS with the current master, and among other things, this problem stands out as it FAILs so many test cases. I'm using tap-bailout-w.test as an example, no use reporting the same problem 80+ times, right :-) The perl version is 5.8.8 Here's tap-bailout-w.log: ./tap-bailout-w.test: will source ./tap-bailout.test Running from installcheck: no Using TAP: no PATH = /home/peda/automake/tests:/c/Program Files (x86)/Microsoft F#/v4.0/:/c/Program Files (x86)/Microsoft Visual Studio 10.0/VSTSDB/Deploy:/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/:/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/BIN:/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools/:/c/Windows/Microsoft.NET/Framework/v4.0.30319:/c/Windows/Microsoft.NET/Framework/v3.5:/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/VCPackages:/c/Program Files (x86)/HTML Help Workshop:/c/Program Files (x86)/Microsoft Visual Studio 10.0/Team Tools/Performance Tools:/c/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin/NETFX 4.0 Tools:.:/usr/local/bin:/mingw/bin:/bin:/c/Program Files/Common Files/Microsoft Shared/Windows Live:/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/ +++ pwd /home/peda/automake/tests/tap-bailout-w.dir ++ . /home/peda/automake/tests/tap-setup.sh +++ test -f ../defs-static +++ test -f ../defs +++ test '!' -f Makefile.am +++ test -d ../tap-common-setup.dir +++ cp -Rp ../tap-common-setup.dir/Makefile ../tap-common-setup.dir/Makefile.am ../tap-common-setup.dir/Makefile.in ../tap-common-setup.dir/aclocal.m4 ../tap-common-setup.dir/config.log ../tap-common-setup.dir/config.status ../tap-common-setup.dir/configure ../tap-common-setup.dir/configure.in ../tap-common-setup.dir/depcomp ../tap-common-setup.dir/install-sh ../tap-common-setup.dir/missing . +++ fetch_tap_driver +++ case $am_tap_implementation in +++ sed '1s|#!.*|#! /bin/perl -w|' /home/peda/automake/lib/tap-driver.pl +++ chmod a+x tap-driver +++ sed 10q tap-driver #! /bin/perl -w # Copyright (C) 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of +++ test -f Makefile.am~ +++ : ++ : ++ cat ++ cat ++ cat ++ cat ++ cat ++ cat ++ cat ++ echo 'ERROR: d.test - Bail out! mktemp -d: Permission denied' ++ cat ++ echo 'ERROR: e.test - Bail out!' ++ test_counts='total=12 pass=3 fail=1 xpass=1 xfail=1 skip=1 error=5' ++ TESTS='a.test b.test c.test d.test e.test' ++ make -e check Can't locate TAP/Parser.pm in @INC (@INC contains: /usr/lib/perl5/5.8/msys /usr/lib/perl5/5.8 /usr/lib/perl5/site_perl/5.8/msys /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8/msys /usr/lib/perl5/vendor_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .) at ./tap-driver line 33. BEGIN failed--compilation aborted at ./tap-driver line 33. make[2]: *** [a.log] Error 2 make[1]: *** [check-TESTS] Error 2 make: *** [check-am] Error 2 ++ cat stdout make check-TESTS make[1]: Entering directory `/home/peda/automake/tests/tap-bailout-w.dir' make[2]: Entering directory `/home/peda/automake/tests/tap-bailout-w.dir' make[2]: Leaving directory `/home/peda/automake/tests/tap-bailout-w.dir' make[1]: Leaving directory `/home/peda/automake/tests/tap-bailout-w.dir' ++ count_test_results total=12 pass=3 fail=1 xpass=1 xfail=1 skip=1 error=5 ++ total=ERR ++ pass=ERR ++ fail=ERR ++ xpass=ERR ++ xfail=ERR ++ skip=ERR ++ error=ERR ++ eval total=12 pass=3 fail=1 xpass=1 xfail=1 skip=1 error=5 +++ total=12 +++ pass=3 +++ fail=1 +++ xpass=1 +++ xfail=1 +++ skip=1 +++ error=5 ++ /bin/grep -E -i '(total|x?pass|x?fail|skip|error)' stdout ++ : ++ rc=0 ++ set +e +++ grep -c '^PASS:' stdout ++ test 0 -eq 3 ++ rc=1 +++ grep -c '^XFAIL:' stdout ++ test 0 -eq 1 ++ rc=1 +++ grep -c '^SKIP:' stdout ++ test 0 -eq 1 ++ rc=1 +++ grep -c '^FAIL:' stdout ++ test 0 -eq 1 ++ rc=1 +++ grep -c '^XPASS:' stdout ++ test 0 -eq 1 ++ rc=1 +++ grep -c '^ERROR:' stdout ++ test 0 -eq 5 ++ rc=1 ++ grep '^# TOTAL: *12$' stdout ++ rc=1 ++ grep '^# PASS: *3$' stdout ++ rc=1 ++ grep '^# XFAIL: *1$' stdout ++ rc=1 ++ grep '^# SKIP: *1$' stdout ++ rc=1 ++ grep '^# FAIL: *1$' stdout ++ rc=1 ++ grep '^# XPASS: *1$' stdout ++ rc=1 ++ grep '^# ERROR: *5$' stdout ++ rc=1 ++ test 1 -eq 0 + exit_status=1 + set +e + cd /home/peda/automake/tests + test no = yes + case $am_explicit_skips in + test 1 -eq 0 + keep_testdirs=yes + am_keeping_testdirs + case $keep_testdirs in + return 0 + set +x tap-bailout-w: exit 1
bug#10441: The testsuite assumes that ln -s really creates a symlink
Hi! ln -s on MSYS does not create a symlink, instead it makes a regular copy. Lots of test cases (on master) FAIL due to this. test -h foo will simply not return success on MSYS, ever. Affected tests (that I have noticed): add-missing.tap (lots of failing test cases) copy.test Cheers, Peter
Re: [PATCH] amhello: help compilers not supporting -c and -o together
On 01/05/2012 01:46 AM, Peter Rosin wrote: Hi! Ok for maint, or should the example be as simple as it can possible get even if portability is sacrificed? Are you sure portability is being sacrificed in our example? I thought that the use of `-c' and `-o' together was only required when target-specific flags where used (as with e.g. foo_CPPFLAGS = -DFOO=1). Am I missing something? You might also want to look at the test `amhello-binpkg.test'; if it doesn't fail when using a compiler that cannot grasp `-c -o' together, then our example should have no portability problem. Thanks, Stefano
Re: [PATCH] amhello: help compilers not supporting -c and -o together
Stefano Lattarini skrev 2012-01-05 10:04: On 01/05/2012 01:46 AM, Peter Rosin wrote: Hi! Ok for maint, or should the example be as simple as it can possible get even if portability is sacrificed? Are you sure portability is being sacrificed in our example? I thought that the use of `-c' and `-o' together was only required when target-specific flags where used (as with e.g. foo_CPPFLAGS = -DFOO=1). Am I missing something? No. I simply forgot about that. But while -o (w/o -c) does work for cl *in this case*, -o has been deprecated for eons (IIRC it was deprecated at least in MSVC 6, some 10-15 years ago, but perhaps it was deprecated even before that?) and doesn't work as one would hope (you can't move the output to some other directory, or something like that). Anyway, this doesn't look too good (but it works): $ cl -o hello.exe main.obj Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release Microsoft (R) Incremental Linker Version 10.00.40219.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:main.exe /out:hello.exe main.obj While this looks so much better: $ lib/compile cl -o hello.exe main.obj Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. Microsoft (R) Incremental Linker Version 10.00.40219.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:hello.exe main.obj But lets cross the bridge when MS actually removes that option. You might also want to look at the test `amhello-binpkg.test'; if it doesn't fail when using a compiler that cannot grasp `-c -o' together, then our example should have no portability problem. Right. Wasted effort, sigh... Cheers, Peter
Re: bug#10436: New testsuite driver and extra trailing backslash in recipes
On 01/05/2012 01:47 PM, Stefano Lattarini wrote: [adding bug-automake in CC:] Reference: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=104367#8 And here is the definitive version of the patch that I'll push by this evening (to master) if there is no objection. Thanks, Stefano From c891eff22b84027ea56cf67b4c5aac55b75390d9 Mon Sep 17 00:00:00 2001 Message-Id: c891eff22b84027ea56cf67b4c5aac55b75390d9.1325768871.git.stefano.lattar...@gmail.com From: Stefano Lattarini stefano.lattar...@gmail.com Date: Thu, 5 Jan 2012 13:41:13 +0100 Subject: [PATCH] parallel-tests: avoid trailing backslashes in make recipes The new testsuite-harness could generate recipes with a trailing backslash character (possibly followed by blank characters only), in the very common case where the user hadn't defined the special $(AM_TESTS_FD_REDIRECT) variable. This caused spurious syntax errors with at least older bash versions (e.g., bash 2.05b), and could be potentially unportable to other weaker shells. See automake bug#10436: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10436 and coreutils bug#10427: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10427#8 * lib/am/check2.am: Rework line breaks so that no backslash can be at the end of a line. * tests/parallel-tests-trailing-bslash.test: New test. * tests/list-of-tests.mk: Add it. --- lib/am/check2.am | 10 +- tests/list-of-tests.mk|1 + tests/parallel-tests-trailing-bslash.test | 114 + 3 files changed, 120 insertions(+), 5 deletions(-) create mode 100755 tests/parallel-tests-trailing-bslash.test diff --git a/lib/am/check2.am b/lib/am/check2.am index ad0a4aa..9a0fe9d 100644 --- a/lib/am/check2.am +++ b/lib/am/check2.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc. +## Copyright (C) 2008, 2009, 2011, 2012 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -19,8 +19,8 @@ ?!GENERIC?%OBJ%: %SOURCE% @p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name $$f \ --log-file '%BASE%.log' --trs-file '%BASE%.trs' \ - $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% $$tst \ - $(AM_TESTS_FD_REDIRECT) + $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \ + $$tst $(AM_TESTS_FD_REDIRECT) ## If no programs are built in this package, then this rule is removed ## at automake time. Otherwise, %am__EXEEXT% expands to a configure time @@ -30,6 +30,6 @@ if %am__EXEEXT% ?GENERIC?%EXT%$(EXEEXT).log: @p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name $$f \ --log-file '%BASE%.log' --trs-file '%BASE%.trs' \ - $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% $$tst \ - $(AM_TESTS_FD_REDIRECT) + $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \ + $$tst $(AM_TESTS_FD_REDIRECT) endif %am__EXEEXT% diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk index 8b4f2ca..dbadfdc 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -709,6 +709,7 @@ parallel-tests-no-spurious-summary.test \ parallel-tests-exit-statuses.test \ parallel-tests-console-output.test \ parallel-tests-once.test \ +parallel-tests-trailing-bslash.test \ tests-environment.test \ am-tests-environment.test \ tests-environment-backcompat.test \ diff --git a/tests/parallel-tests-trailing-bslash.test b/tests/parallel-tests-trailing-bslash.test new file mode 100755 index 000..418b722 --- /dev/null +++ b/tests/parallel-tests-trailing-bslash.test @@ -0,0 +1,114 @@ +#! /bin/sh +# Copyright (C) 2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +# Check that the new testsuite harness do not generate recipes that can +# have a trailing `\', since that can cause spurious syntax errors with +# older bash versions (e.g., bash 2.05b). +# See automake bug#10436. + +am_parallel_tests=yes +. ./defs || Exit 1 + +echo AC_OUTPUT configure.in + +cat Makefile.am 'END' +TESTS = foo.test +EXTRA_DIST = $(TESTS) +am__backslash = \\ # foo +.PHONY: bad-recipe +bad-recipe: + @printf '%s\n' $(am__backslash) +END + +cat foo.test 'END' +#!/bin/sh +exit 0 +END +chmod +x foo.test + +am__SHELL=$SHELL; export am__SHELL +am__PERL=$PERL; export am__PERL + +cat my-shell 'END' +#!/bin/sh -e +set -u
Re: bug#10437: parallel-tests: `recheck' recipe can cause sed to be invoked with too long input lines
Reference: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10437 On 01/05/2012 03:07 PM, Stefano Lattarini wrote: Patch coming up soon. And here it is. I will push by this evening if there is no objection. Regards, Stefano From e3b0e12400f5fa4220fc0aa79dd0989e56def9c6 Mon Sep 17 00:00:00 2001 Message-Id: e3b0e12400f5fa4220fc0aa79dd0989e56def9c6.1325772813.git.stefano.lattar...@gmail.com From: Stefano Lattarini stefano.lattar...@gmail.com Date: Thu, 5 Jan 2012 15:13:30 +0100 Subject: [PATCH] parallel-tests: avoid issue with overly long lines in sed input See automake bug#10437: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10437 and coreutils bug#10427: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10427#8 * lib/am/check.am (recheck, recheck-html): In order to strip trailing whitespace from the definition of the `$list' variable, we used to invoke sed in a way that could cause it to get passed overly long input lines, causing spurious failures. So rework the logic of the recipe to avoid any sed invocation, relying on simpler shell idioms instead. (check-TESTS): Reorganize the recipe to be more similar to the one of `recheck', for consistency and simplicity. * NEWS: Update. Report and analysis by Paul Eggert. --- NEWS|4 lib/am/check.am | 38 +- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/NEWS b/NEWS index 2e572e4..7e52d83 100644 --- a/NEWS +++ b/NEWS @@ -89,6 +89,10 @@ Bugs fixed in 1.11.0a: * Bugs introduced by 1.11: + - The parallel-tests harness doesn't trip anymore on sed implementations +with stricter limits on the length of input lines (problem seen at +least on Solaris 8). + - The `parallel-tests' test driver works around a GNU make 3.80 bug with trailing white space in the test list (`TESTS = foo $(EMPTY)'), and does not report spurious successes when used with concurrent FreeBSD diff --git a/lib/am/check.am b/lib/am/check.am index 3d0188d..29faa38 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -245,15 +245,16 @@ check-TESTS: ## OTOH, this means that, in the rule for `$(TEST_SUITE_LOG)', we ## cannot use `$?' to compute the set of lazily rerun tests, lest ## we rely on .PHONY to work portably. -## + @test -z $(TEST_SUITE_LOG) || rm -f $(TEST_SUITE_LOG) + @list='' list2='$(TEST_LOGS)'; for f in $$list2; do \ ## Trailing whitespace in `TESTS = foo.test $(empty)' causes GNU make ## 3.80 to erroneously expand $(TESTS_LOGS) to `foo.log .log'. ## Work around this bug. - @test -z $(TEST_SUITE_LOG) || rm -f $(TEST_SUITE_LOG) - @list='$(TEST_LOGS)'; \ - list=`for f in $$list; do \ - test .log = $$f || echo $$f; \ - done | tr '\012\015' ' '`; \ + test .log = $$f continue; \ +## Be careful to avoid extra whitespace in the definition of $list. See +## comments in `recheck' below for why this might be useful. + if test -z $$list; then list=$$f; else list=$$list $$f; fi; \ + done; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS=$$list AM_RECURSIVE_TARGETS += check @@ -298,17 +299,20 @@ AM_RECURSIVE_TARGETS += check-html ## Rerun all FAILed or XPASSed tests. recheck recheck-html: - @target=`echo $@ | sed 's,^re,,'`;\ - list='$(TEST_LOGS)'; \ - list=`for f in $$list; do \ - test -f $$f || continue;\ - if test -r $$f read line $$f; then \ - case $$line in FAIL*|XPASS*) echo $$f;; esac; \ - else echo $$f; fi; \ - done | tr '\012\015' ' '`;\ -## This apparently useless munging helps to avoid a nasty bug (a -## segmentation fault!) on Solaris XPG4 make. - list=`echo $$list | sed 's/ *$$//'`;\ + @target=`echo $@ | sed 's,^re,,'`; \ + list='' list2='$(TEST_LOGS)'; for f in $$list2; do \ + test -f $$f || continue; \ + if test -r $$f read line $$f; then \ + case $$line in FAIL*|XPASS*) : ;; *) continue;; esac; \ + fi; \ +## Be careful to avoid extra whitespace in the definition of $list, since +## its value will be passed to the recursive make invocation below through +## the TEST_LOGS macro, and leading/trailing white space in a make macro +## definition can be problematic. In this particular case, trailing white +## space was known to cause a segmentation fault on Solaris 10 XPG4 make: +## http://lists.gnu.org/archive/html/bug-automake/2010-08/msg4.html + if test -z $$list; then list=$$f; else list=$$list $$f; fi; \ + done; \ $(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS='$$list'' .PHONY: recheck recheck-html -- 1.7.7.3
Re: bug#10427: bug#10436: New testsuite driver and extra trailing backslash in recipes
I pushed the following doc fix into Autoconf, so that these two portability issues are documented there. It turns out that the second issue is actually due to an old Bash bug -- it's not Solaris-specific. From b1f0e147aa7aa259dea2c34c5a0ac7965d6efd7e Mon Sep 17 00:00:00 2001 From: Paul Eggert egg...@cs.ucla.edu Date: Thu, 5 Jan 2012 11:00:45 -0800 Subject: [PATCH 1/2] doc: clarify sed buffer limit * doc/autoconf.texi (Limitations of Usual Tools): That 4000-byte limit applies to output and internal buffers, too. --- ChangeLog |6 ++ doc/autoconf.texi |5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30312be..238c09f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-01-05 Paul Eggert egg...@cs.ucla.edu + + doc: clarify sed buffer limit + * doc/autoconf.texi (Limitations of Usual Tools): + That 4000-byte limit applies to output and internal buffers, too. + 2012-01-03 Paul Eggert egg...@cs.ucla.edu maint: update copyright year diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 72ff7f8..ea2419b 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -19256,8 +19256,9 @@ $ @kbd{echo a | sed 's/x/x/;;s/x/x/'} sed: 1: s/x/x/;;s/x/x/: invalid command code ; @end example -Input should not have unreasonably long lines, since some @command{sed} -implementations have an input buffer limited to 4000 bytes. Likewise, +Some @command{sed} implementations have a buffer limited to 4000 bytes, +and this limits the size of input lines, output lines, and internal +buffers that can be processed portably. Likewise, not all @command{sed} implementations can handle embedded @code{NUL} or a missing trailing newline. -- 1.7.6.5 From 0445b4ad121e6356f409833dec3678ae613e1d08 Mon Sep 17 00:00:00 2001 From: Paul Eggert egg...@cs.ucla.edu Date: Thu, 5 Jan 2012 12:32:12 -0800 Subject: [PATCH 2/2] doc: mention Bash 2.03 bug with backslash-newline * doc/autoconf.texi (Invoking the Shell): New section. (Backslash-Newline-Empty): Rename from Backslash-Newline-Newline. Mention problem with Bash 2.03. --- ChangeLog |5 doc/autoconf.texi | 56 +--- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 238c09f..69df405 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2012-01-05 Paul Eggert egg...@cs.ucla.edu + doc: mention Bash 2.03 bug with backslash-newline + * doc/autoconf.texi (Invoking the Shell): New section. + (Backslash-Newline-Empty): Rename from Backslash-Newline-Newline. + Mention problem with Bash 2.03. + doc: clarify sed buffer limit * doc/autoconf.texi (Limitations of Usual Tools): That 4000-byte limit applies to output and internal buffers, too. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index ea2419b..5c3feef 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -501,6 +501,7 @@ Dependencies Between Macros Portable Shell Programming * Shellology:: A zoology of shells +* Invoking the Shell:: Invoking the shell as a command * Here-Documents:: Quirks and tricks * File Descriptors::FDs and redirections * Signal Handling:: Shells, signals, and headaches @@ -520,7 +521,7 @@ Portable Make Programming * $ in Ordinary Make Rules:: $ in ordinary rules * Failure in Make Rules:: Failing portably in rules * Special Chars in Names:: Special Characters in Macro Names -* Backslash-Newline-Newline:: Empty last lines in macro definitions +* Backslash-Newline-Empty:: Empty lines after backslash-newline * Backslash-Newline Comments:: Spanning comments across line boundaries * Long Lines in Makefiles:: Line length limitations * Macros and Submakes:: @code{make macro=value} and submakes @@ -15067,6 +15068,7 @@ subset described above, is fairly portable nowadays. Also please see @menu * Shellology:: A zoology of shells +* Invoking the Shell:: Invoking the shell as a command * Here-Documents:: Quirks and tricks * File Descriptors::FDs and redirections * Signal Handling:: Shells, signals, and headaches @@ -15205,6 +15207,28 @@ The default Mac OS X @command{sh} was originally Zsh; it was changed to Bash in Mac OS X 10.2. @end table +@node Invoking the Shell +@section Invoking the Shell +@cindex invoking the shell +@cindex shell invocation + +Bash 2.03 has a bug when invoked with the @option{-c} option: if the +option-argument ends in backslash-newline, Bash incorrectly reports a +syntax error. The problem does not occur if a character follows the +backslash: + +@example +$ @kbd{$ bash -c 'echo foo \} + @kbd{'} +bash: -c: line 2: syntax error: unexpected end of file +$ @kbd{bash -c 'echo foo \} + @kbd{ '} +foo +@end example + +@noindent
Re: [RCF] parallel-tests: removing the check-html target and the .log - .html conversion?
On Thu, 5 Jan 2012, Stefano Lattarini wrote: So, in conclusion, here is my simple proposal: 1. We deprecate the support for HTML testsuite output in the documentation of the 1.11.3 release. 2. In the 1.12 release, we remove it from the automake core, providing instead (in the automake tarball) an extra `.am' fragment that can offer a similar (and hopefully completely equivalent) functionality. Opinions? I am a fan of reStructuredText and rst2html but definitely agree that this functionality does not need to be in the core of Automake and that there only needs to be sufficient provision to hook in some formatting tool to produce alternate output formats. Bob -- Bob Friesenhahn bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer,http://www.GraphicsMagick.org/