autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

autoconf "make check" is reeeeeeeeeeeeally slow on Solaris 8


From: Paul Eggert
Subject: autoconf "make check" is reeeeeeeeeeeeally slow on Solaris 8
Date: Tue, 18 Apr 2006 21:22:33 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

I tried running "make check" with Autoconf on Solaris 8, configuring
with CONFIG_SHELL=/bin/ksh, and found that it ran reeeeeeeeeeeeally
slowly.  On my host (a 4-processor 1 GHz sparcv9) the first test case
took more than 3 hours, at which point I killed it.

I discovered that the problem is at least partly due to the fact that
"/bin/sh -n" is very slow on this host.  I.e., "/bin/sh -n testsuite"
takes more than 3 hours.

I installed the following patch to work around this problem, plus an
internal Autoconf error I uncovered while fixing it.  "make check" is
still really slow (for example, test 4 takes about 17 seconds, and we
have 279 tests!) but at least now I have a fighting chance.

2006-04-18  Paul Eggert  <address@hidden>

        * configure.ac (ac_cv_sh_n_works): Don't try to test for it, since
        some shells (e.g., Solaris 8 /bin/sh) implement it verrrry slowly.
        Instead, just list the shells that we know work.
        * tests/local.at (AT_CHECK_SHELL_SYNTAX): Remove 2nd arg.  All uses
        changed.  Be more cautious about the _cv_ variable.
        * tests/tools.at (Syntax of the shell scripts): Check the
        _cv_ variable once, at first, to avoid an internal autoconf error
        when sh -n does not work.

Index: configure.ac
===================================================================
RCS file: /cvsroot/autoconf/autoconf/configure.ac,v
retrieving revision 1.76
diff -p -u -r1.76 configure.ac
--- configure.ac        12 Apr 2006 23:08:21 -0000      1.76
+++ configure.ac        19 Apr 2006 04:09:10 -0000
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 # Copyright (C) 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003,
-# 2004 Free Software Foundation, Inc.
+# 2004, 2005, 2006 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
@@ -48,30 +48,25 @@ AM_INIT_AUTOMAKE([check-news 1.7.9 dist-
 #   $ time sh -nx endless.sh
 #   ^Csh -nx endless.sh  3,67s user 0,03s system 63% cpu 5,868 total
 #
+# Also, some implementations of /bin/sh (e.g., Solaris 8) are soooo slow
+# that they are unusable on large scripts like our testsuite.
+
 # So before using `/bin/sh -n' to check our scripts, we first check
-# that `/bin/sh -n' is not broken to death.
+# that `/bin/sh -n' is known to not have these problems.
 
-# A script that never returns.  We don't care that it never returns,
-# broken /bin/sh loop equally with `false', but it makes it easier to
-# test the robustness in a good environment: just remove the `-n'.
-AC_CACHE_CHECK([whether sh -n works], ac_cv_sh_n_works,
-[cat > conftest.sh <<_CONFEOF_
-while :
-do
-  :
-done
-_CONFEOF_
-
-(/bin/sh -n conftest.sh) &
-sleep 2
-if kill $! >/dev/null 2>&1; then
-  # We managed to kill the child, which means that we probably
-  # can't trust `/bin/sh -n', hence the test failed.
-  ac_cv_sh_n_works=no
-else
-  ac_cv_sh_n_works=yes
+AC_CACHE_CHECK([whether /bin/sh -n is known to work], ac_cv_sh_n_works,
+[if (
+    unset BASH_VERSION ZSH_VERSION
+    /bin/sh -c '
+      test -n "${BASH_VERSION+set}" || # Bash
+      test -n "${KSH_VERSION+set}" || # pdksh
+      test -n "${ZSH_VERSION+set}" || # zsh
+      test -n "${.sh.version}" # ksh93; put this last since its syntax is dodgy
+    '
+  ) 2>/dev/null
+then ac_cv_sh_n_works=yes
+else ac_cv_sh_n_works=no
 fi
-rm conftest.sh
 ])
 AC_SUBST(ac_cv_sh_n_works)
 
Index: tests/local.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/local.at,v
retrieving revision 1.28
diff -p -u -r1.28 local.at
--- tests/local.at      20 Mar 2006 20:29:45 -0000      1.28
+++ tests/local.at      19 Apr 2006 04:09:11 -0000
@@ -45,13 +45,13 @@ AT_CHECK([$at_diff "$1" "$2"])
 ## Testing syntax.  ##
 ## ---------------- ##
 
-# AT_CHECK_SHELL_SYNTAX(PROGRAM, ALT-COMMAND)
-# -------------------------------------------
+# AT_CHECK_SHELL_SYNTAX(PROGRAM)
+# ------------------------------
 # If the shell handles `-n' well, use it to check the syntax of PROGRAM;
-# otherwise, run ALT-COMMAND.
+# otherwise, do nothing.
 m4_define([AT_CHECK_SHELL_SYNTAX],
-[AS_IF([test x"$ac_cv_sh_n_works" != xno],
-  [AT_CHECK([/bin/sh -n $1], 0)], [$2])])
+[AS_IF([test "$ac_cv_sh_n_works" = yes],
+  [AT_CHECK([/bin/sh -n $1])])])
 
 m4_define([AT_CHECK_PERL_SYNTAX],
 [AT_CHECK([autom4te_perllibdir=$abs_top_srcdir/lib $PERL -c 
$abs_top_builddir/bin/$1],
Index: tests/tools.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/tools.at,v
retrieving revision 1.82
diff -p -u -r1.82 tools.at
--- tests/tools.at      7 Apr 2006 18:25:30 -0000       1.82
+++ tests/tools.at      19 Apr 2006 04:09:11 -0000
@@ -46,17 +46,19 @@ AT_BANNER([Executables (autoheader, auto
 
 AT_SETUP([Syntax of the shell scripts])
 
+AT_CHECK([test "$ac_cv_sh_n_works" = yes || exit 77])
+
 # Specify the absolute name of the tool, as some shells don't honor PATH when
 # running `sh PROG'.
 
-AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/bin/autoconf], exit 77)
-AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/autoconf], exit 77)
-AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/testsuite], exit 77)
+AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/bin/autoconf])
+AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/autoconf])
+AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/testsuite])
 
 # These are not built, they are in the src tree.
-AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/install-sh], exit 77)
-AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/mkinstalldirs], exit 77)
-AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/missing], exit 77)
+AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/install-sh])
+AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/mkinstalldirs])
+AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/missing])
 
 AT_CLEANUP
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]