[m-rev.] diff: make nightly tests more portable
Fergus Henderson
fjh at cs.mu.OZ.AU
Tue Sep 24 03:20:50 AEST 2002
Estimated hours taken: 1
Branches: main
tools/run_all_tests_from_cron:
tools/test_mercury:
Some changes to make the tests work on machines that are not part
of the Mercury network (i.e. that don't NFS-mount /home/mercury):
- Use $HOME/public rather than /home/mercury/public if the latter
doesn't exist.
- Don't make files group-writable unless /home/mercury/public
exists.
- Remove some obsolete directories (gcc-2.7.2, egcs, nu-prolog,
sicstus3) from the PATH.
- Simplify the logic for which bootstrap compiler to use.
- Avoid hard-coding the list of hosts and their architectures,
grades, etc.
Mmakefile:
Add `echo_libgrades' target, for use by tools/test_mercury.
Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmakefile,v
retrieving revision 1.86
diff -u -r1.86 Mmakefile
--- Mmakefile 27 Aug 2002 08:18:33 -0000 1.86
+++ Mmakefile 23 Sep 2002 17:17:38 -0000
@@ -327,6 +327,10 @@
fullarch:
@echo $(FULLARCH)
+.PHONY: echo_libgrades
+echo_libgrades:
+ @echo $(LIBGRADES)
+
#-----------------------------------------------------------------------------#
.PHONY: install
Index: tools/run_all_tests_from_cron
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/run_all_tests_from_cron,v
retrieving revision 1.53
diff -u -r1.53 run_all_tests_from_cron
--- tools/run_all_tests_from_cron 15 Sep 2002 11:22:40 -0000 1.53
+++ tools/run_all_tests_from_cron 23 Sep 2002 17:17:38 -0000
@@ -31,49 +31,38 @@
*) echo "Usage: $0 host [c-compiler] [branch]" 1>&2; exit 1 ;;
esac
-case $HOST in
- munta) ARCH=sgi FULLARCH=mips-sgi-irix5.2 ;;
- muse) ARCH=sgi FULLARCH=mips-sgi-irix5.3 ;;
- kryten) ARCH=sparc FULLARCH=sparc-sun-solaris2.5 ;;
- taifun) ARCH=sparc FULLARCH=sparc-sun-solaris2.7 ;;
- mundroo) ARCH=i686 FULLARCH=i386-pc-solaris2.8 ;;
- murlibobo) ARCH=alpha FULLARCH=alphaev5-dec-osf5.1 ;;
- mundook) ARCH=alpha FULLARCH=alpha-dec-osf3.2 ;;
- quicksilver) ARCH=i586 FULLARCH=i586-pc-linux-gnu ;;
- hg) ARCH=i686 FULLARCH=i686-pc-linux-gnu ;;
- hydra) ARCH=i686 FULLARCH=i686-pc-linux-gnu ;;
- ender) ARCH=i686 FULLARCH=i686-pc-linux-gnu ;;
- roy) ARCH=i686 FULLARCH=i686-pc-linux-gnu ;;
- venus) ARCH=i686 FULLARCH=i686-pc-linux-gnu ;;
- earth) ARCH=i686 FULLARCH=i686-pc-linux-gnu ;;
- mars) ARCH=i686 FULLARCH=i686-pc-linux-gnu ;;
- ceres) ARCH=i686 FULLARCH=i686-pc-linux-gnu ;;
- *) echo "$0: unknown HOST $HOST" 1>&2; exit 1 ;;
-esac
-
#-----------------------------------------------------------------------------#
-PATH="$HOME/bin/$ARCH`awk '/^[^#]/{printf ":%s",$0;}' /home/mercury/public/cron/.path`"
-PATH="/home/mercury/public/mercury-latest/$FULLARCH/bin:$PATH"
-PATH="/home/mercury/public/nuprolog/$FULLARCH/bin:$PATH"
-PATH="/home/mercury/public/gcc-2.7.2/$FULLARCH/bin:$PATH"
-PATH="/home/mercury/public/egcs-1.1b/$FULLARCH/bin:$PATH"
-PATH="/home/mercury/public/autoconf-2.4/$FULLARCH/bin:$PATH"
-PATH="/home/mercury/public/sicstus3/$HOST:$PATH"
-PATH="/home/mercury/public/$HOST:$PATH"
+if [ -d /home/mercury/public/. ]; then
+ TOPDIR=/home/mercury/public
+ PATH="$HOME/bin/$ARCH`awk '/^[^#]/{printf ":%s",$0;}' $TOPDIR/cron/.path`"
+else
+ TOPDIR=$HOME/public
+fi
+PATH="$TOPDIR/mercury-latest/$FULLARCH/bin:$PATH"
+PATH="$TOPDIR/$HOST:$PATH"
+PATH="$HOME/bin:$PATH"
export PATH
CVSROOT=/home/mercury1/repository
+if [ -d $CVSROOT/. ]; then
+ :
+else
+ CVSROOT=:pserver:guest at cvs.mercury.cs.mu.oz.au:$CVSROOT
+fi
export CVSROOT
+FULLARCH="`config.guess`"
+ARCH="`expr $FULLARCH : '\([^-]*\)-.*' `"
+
#-----------------------------------------------------------------------------#
# Redirect all output to $tmpfile to stop cron mailing
# content-free messages to mercury at cs.mu.oz.au.
{
-tm_dir=/home/mercury/public/test_mercury
+tm_dir=$TOPDIR/test_mercury
-cd /home/mercury/public/test_mercury/scripts;
+cd $TOPDIR/test_mercury/scripts;
cvs checkout mercury/tools/test_mercury
cp mercury/tools/test_mercury $tmpscript
Index: tools/test_mercury
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/test_mercury,v
retrieving revision 1.199
diff -u -r1.199 test_mercury
--- tools/test_mercury 22 Sep 2002 13:40:27 -0000 1.199
+++ tools/test_mercury 23 Sep 2002 17:17:38 -0000
@@ -15,28 +15,45 @@
*) echo "Usage: $0 host arch fullarch branch c_compiler" 1>&2; exit 1 ;;
esac
-PATH="$HOME/bin/$ARCH`awk '/^[^#]/{printf ":%s",$0;}' /home/mercury/public/cron/.path`"
-PATH="/home/mercury/public/mercury-latest/$FULLARCH/bin:$PATH"
-PATH="/home/$HOST/public/mercury-latest/$FULLARCH/bin:$PATH"
-PATH="/home/mercury/public/gcc-2.7.2/$FULLARCH/bin:$PATH"
-PATH="/home/mercury/public/egcs-1.1b/$FULLARCH/bin:$PATH"
-PATH="/home/mercury/public/autoconf-2.13/$FULLARCH/bin:$PATH"
-PATH="/home/mercury/public/autoconf-2.52/$FULLARCH/bin:$PATH"
-PATH="/home/mercury/public/$FULLARCH:$PATH"
-PATH="/home/mercury/public/$HOST:$PATH"
-# generate_index_html needs to be in our PATH too
-PATH="`pwd`:$PATH"
+if [ -d /home/mercury/public/. ]; then
+ TOPDIR=/home/mercury/public
+ PATH="$HOME/bin/$ARCH`awk '/^[^#]/{printf ":%s",$0;}' $TOPDIR/cron/.path`"
+ PATH="$TOPDIR/mercury-latest/$FULLARCH/bin:$PATH"
+ PATH="/home/$HOST/public/mercury-latest/$FULLARCH/bin:$PATH"
+ PATH="$TOPDIR/autoconf-2.13/$FULLARCH/bin:$PATH"
+ PATH="$TOPDIR/autoconf-2.52/$FULLARCH/bin:$PATH"
+ PATH="$TOPDIR/$FULLARCH:$PATH"
+ PATH="$TOPDIR/$HOST:$PATH"
+ # generate_index_html needs to be in our PATH too
+ PATH="$TOPDIR/test_mercury/scripts:$PATH"
+else
+ TOPDIR=$HOME/public
+ PATH=$TOPDIR/mercury-latest/$FULLARCH/bin:$PATH
+ PATH="$TOPDIR/$FULLARCH:$PATH"
+ PATH="$TOPDIR/$HOST:$PATH"
+fi
export PATH
+# Use NFS if we can, otherwise use anonymous cvs (pserver).
CVSROOT=/home/mercury1/repository
+if [ -d $CVSROOT/. ]; then
+ :
+else
+ CVSROOT=":pserver:guest at cvs.mercury.cs.mu.oz.au:$CVSROOT"
+fi
export CVSROOT
-# tell gcc to use /tmp, not /usr/tmp
+# Tell gcc to use /tmp, not /usr/tmp
TMPDIR=/tmp
export TMPDIR
# Make the files writable by group mercury.
-umask 002
+# But only do this for machines on the Mercury network.
+if [ d /home/mercury/public/. ]; then
+ umask 002
+else
+ umask 022
+fi
# Stop looping tests after 5 minutes of CPU time.
ulimit -S -t 300
@@ -49,7 +66,7 @@
# directories to use
-TESTDIR=/home/mercury/public/test_mercury
+TESTDIR=$TOPDIR/test_mercury
HOSTDIR=$TESTDIR/test_dirs/$HOST
DIR=$HOSTDIR/build.$BRANCH.$C_COMPILER
@@ -222,7 +239,7 @@
hg|ender|roy|venus|earth|mars|ceres)
INSTALL_DIR=/home/$HOST/public/$INSTALL_DIR_NAME/$FULLARCH ;;
*)
- INSTALL_DIR=/home/mercury/public/$INSTALL_DIR_NAME/$FULLARCH ;;
+ INSTALL_DIR=$TOPDIR/$INSTALL_DIR_NAME/$FULLARCH ;;
esac
case "$C_COMPILER" in
gcc) ;;
@@ -237,16 +254,17 @@
STABLE=$HOSTDIR/$INSTALL_DIR_NAME-stable
UNSTABLE=$HOSTDIR/$INSTALL_DIR_NAME-unstable
+# XXX This probably isn't needed anymore. -fjh.
case $ARCH in
alpha)
# due to a bug in the DEC loader, INSTALL_DIR should be
# as short as possible, to avoid overflow of fixed length
# buffers for -rpath options. The above definition is too long.
case $BRANCH in
- latest) INSTALL_DIR=/home/mercury/public/.a ;;
- 0.8) INSTALL_DIR=/home/mercury/public/.b ;;
- 0.9) INSTALL_DIR=/home/mercury/public/.c ;;
- 0.10) INSTALL_DIR=/home/mercury/public/.d ;;
+ latest) INSTALL_DIR=$TOPDIR/.a ;;
+ 0.8) INSTALL_DIR=$TOPDIR/.b ;;
+ 0.9) INSTALL_DIR=$TOPDIR/.c ;;
+ 0.10) INSTALL_DIR=$TOPDIR/.d ;;
*)
echo "unknown BRANCH \`$BRANCH'!"
exit 1
@@ -276,15 +294,18 @@
*) PARALLEL= ;;
esac
-# version of the mercury compiler to use for bootstrapping
-case $HOST in
- hg|ender|roy|venus|earth|ceres)
- BOOTSTRAP_MERCURY_COMPILER=/home/$HOST/public/$INSTALL_DIR_NAME/$FULLARCH/lib/mercury/bin/$FULLARCH/mercury_compile
- ;;
- *)
- BOOTSTRAP_MERCURY_COMPILER=/home/mercury/public/$INSTALL_DIR_NAME/$FULLARCH/lib/mercury/bin/$FULLARCH/mercury_compile
- ;;
-esac
+# Version of the mercury compiler to use for bootstrapping
+# Normally we use the compiler from same location that we will install in.
+# But occaisionally this setting will get overridden below.
+BOOTSTRAP_MERCURY_COMPILER=$INSTALL_DIR/lib/mercury/bin/$FULLARCH/mercury_compile
+
+# The following can be edited and uncommented if you need to use
+# a different bootstrap compiler to re-bootstrap a host which
+# has gotten too out-of-date.
+#case $HOST in mars)
+# BOOTSTRAP_MERCURY_COMPILER=$TOPDIR/$INSTALL_DIR_NAME/$FULLARCH/lib/mercury/bin/$FULLARCH/mercury_compile
+# ;;
+#esac
# df (disk free) command
DF=df
@@ -425,7 +446,7 @@
# The deep profiler needs to be included in the source distribution.
case $HOST in $ROTD_HOST)
CONFIG_OPTS="$CONFIG_OPTS \
- --enable-deep-profiler=/home/mercury/public/installed_w3/cgi-bin"
+ --enable-deep-profiler=$TOPDIR/installed_w3/cgi-bin"
;;
esac
@@ -886,6 +907,9 @@
# Don't bother with these, otherwise it would take forever...
# asm_fast.gc.prof asm_fast.prof
# asm_fast.gc.memprof asm_fast.gc.tr"
+ ;;
+ *)
+ GRADES="`mmake echo_libgrades`"
;;
esac
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list