Hi Eric, * Ralf Wildenhues wrote on Mon, Apr 20, 2009 at 10:11:12PM CEST: > * Eric Blake wrote on Mon, Apr 20, 2009 at 06:44:17PM CEST: > > But the point remains that we DO want perl's flock to work for > > cross-process locking (automake and autoconf both need a lock on > > autom4te.cache/requests, to block whichever task starts late). > > Yes, definitely. And a testsuite addition to Autoconf or Automake to > ensure this would be good, I guess.
Proposed patch against Autoconf. Tested on GNU/Linux and Cygwin: as it is, the patch hasn't caused a failure in several runs. When I comment out the $icache_file->lock (LOCK_EX); line in bin/autom4te.in or go for a shared lock with LOCK_SH, rebuild, then the test has a fairly high chance of failing. Results I've observed so far are rare false passes, otherwise one of these two failures: ../../autoconf/tests/tools.at:333: grep 'cannot rename' errlog ++ grep 'cannot rename' errlog --- /dev/null 2008-01-01 20:00:00.000000000 +0200 +++ /home/ralf/ac/build/tests/testsuite.dir/at-groups/8/stdout 2009-04-22 20:04:13.000000000 +0200 @@ -0,0 +1 @@ +autom4te: cannot rename autom4te.cache/traces.0t as autom4te.cache/traces.0: No such file or directory ../../autoconf/tests/tools.at:333: exit code was 0, expected 1 ++ autom4te --language=autoconf -o configure --- /dev/null 2008-01-01 20:00:00.000000000 +0200 +++ /home/ralf/ac/build/tests/testsuite.dir/at-groups/8/stderr 2009-04-22 20:04:08.000000000 +0200 @@ -0,0 +1,3 @@ +Use of uninitialized value in concatenation (.) or string at /home/ralf/ac/build/bin/autom4te line 1026. +unknown channel m4trace:stdin:1: -1- AC_SUBST_T at /home/ralf/ac/build/../autoconf/lib/Autom4te/Channels.pm line 634 + Autom4te::Channels::msg('m4trace:stdin:1: -1- AC_SUBST_T', 'undef', 'warning: ') called at /home/ralf/ac/build/bin/autom4te line 1026 ../../autoconf/tests/tools.at:329: exit code was 1, expected 0 ++ echo 8. tools.at:323: FAILED (tools.at:329) OK to apply? Thanks, Ralf New test to ensure autom4te cache file locking works. * tests/tools.at (autom4te cache locking): New test. Report by Eric Blake. diff --git a/tests/tools.at b/tests/tools.at index 871d267..c4016cc 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -1011,6 +1011,26 @@ AT_CHECK([test "`find configure -newer newer`" = "" || AT_CLEANUP +# autom4te cache locking +# ---------------------- + +AT_SETUP([autom4te cache locking]) + +# Cannot use AT_CHECK here, autotest internals could be messed up. + +(echo AC_INIT; sleep 2; echo) \ + | (autom4te --language=autoconf -o configure; echo $? >&2 ) 2>errlog & +AT_CHECK([echo AC_INIT | autom4te --language=autoconf -o configure]) +wait + +# Ignore additional output from shell verbose or xtrace mode. +AT_CHECK([grep 'cannot rename' errlog], [1]) +AT_CHECK([grep '^0$' errlog], [], [ignore]) +AT_CHECK_CONFIGURE + +AT_CLEANUP + + # autotools and file names containing whitespace # ---------------------------------------------