From: Eric Blake Date: Mon, 13 Jul 2009 18:54:19 +0000 (-0600) Subject: Disable asynchronous job notification for parallel tests. X-Git-Tag: v2.64~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8db042ad03bd140212c528077f9b5589da91d49;p=thirdparty%2Fautoconf.git Disable asynchronous job notification for parallel tests. * lib/autotest/general.m4 (AT_INIT) : Turn off notify mode, since zsh leaves it on after 'emulate sh'. * doc/autoconf.texi (Limitations of Builtins) : Document that job control options are not portable. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 37b7b15c..26ddce08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2009-07-13 Eric Blake + Disable asynchronous job notification for parallel tests. + * lib/autotest/general.m4 (AT_INIT) : Turn off notify + mode, since zsh leaves it on after 'emulate sh'. + * doc/autoconf.texi (Limitations of Builtins) : Document that + job control options are not portable. + Guarantee that exit status trumps output matching. * doc/autoconf.texi (Writing Testsuites) : Document this better. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index a4aed6f8..cd2a65d5 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -16257,6 +16257,35 @@ Thus, when writing a script in M4sh, rather than trying to rely on @samp{set -e}, it is better to append @samp{|| AS_EXIT} to any statement where it is desirable to abort on failure. +@cindex @command{set -b} +@cindex @command{set -m} +Job control is not provided by all shells, so the use of @samp{set -m} +or @samp{set -b} must be done with care. When using @command{zsh} in +native mode, asynchronous notification (@samp{set -b}) is enabled by +default, and using @samp{emulate sh} to switch to Posix mode does not +clear this setting (although asynchronous notification has no impact +unless job monitoring is also enabled). Also, @command{zsh} 4.3.10 and +earlier have a bug where job control can be manipulated in interactive +shells, but not in subshells or scripts. Furthermore, some shells, like +@command{pdksh}, fail to treat subshells as interactive, even though the +parent shell was. + +@example +$ @kbd{echo $ZSH_VERSION} +4.3.10 +$ @kbd{set -m; echo $?} +0 +$ @kbd{zsh -c 'set -m; echo $?'} +set: can't change option: -m +$ @kbd{(set -m); echo $?} +set: can't change option: -m +1 +$ @kbd{pdksh -ci 'echo $-; (echo $-)'} +cim +c +@end example + + @item @command{shift} @c ------------------ @prindex @command{shift} diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index b9beb0e6..cf88b99c 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -1250,7 +1250,8 @@ dnl shell to start each parallel task as its own shell job, thus as a new dnl process group leader. We then send the signal to all new process groups. dnl Do we have job control? -if (set -m && set +m) >/dev/null 2>&1; then +if (set -m && set +m && set +b) >/dev/null 2>&1; then + set +b at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=- else at_job_control_on=: at_job_control_off=: at_job_group=