for review: making bootcheck test new runtime systems

Zoltan Somogyi zs at cs.mu.OZ.AU
Sat Feb 7 19:51:36 AEDT 1998


tools/bootcheck:
	Set things up so that the test suite is not just compiled
	with the stage 2 compiler and libraries, but also with the
	stage 2 header files, runtime system, garbage collector
	and utility programs.

	Add a new option, -T, that tells bootcheck not to create stages
	2 & 3, and instead runs only the test suite. This is now different
	from simply invoking runtests, since that would not set up
	the environment to test stage 2. This option is useful if
	you find a problem with the tests themselves and want to see
	whether a modification you made to them fixes the problem.

Zoltan.

cvs diff: Diffing .
Index: bootcheck
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/bootcheck,v
retrieving revision 1.44
diff -u -u -r1.44 bootcheck
--- bootcheck	1997/12/22 04:04:51	1.44
+++ bootcheck	1998/02/04 06:34:05
@@ -23,6 +23,10 @@
 	-t, --no-test-suite
 		By default, bootcheck will also run the test quite.
 		This option prevents that.
+	-T, --test-suite-only
+		Do not run the bootstrap check; execute the test suite only.
+		This option requires a previous bootstrap check to have left
+		a working stage 2 directory.
 	-s, --sicstus
 		As well as running the normal bootcheck, also build a SICStus
 		Prolog version of the compiler and check it against the
@@ -43,6 +47,7 @@
 mmake_opts="-k"
 outfile=""
 runtests=true
+do_bootcheck=true
 copy_runtime=false
 keep_stage_2=false
 keep_stage_3=false
@@ -77,6 +82,9 @@
 	-t|--no-test-suite)
 		runtests=false ;;
 
+	-T|--test-suite-only)
+		do_bootcheck=false ;;
+
 	-s|--sicstus)
 		test_sicstus=true ;;
 
@@ -188,7 +196,6 @@
 		cd runtime
 		ln -s $root/runtime/*.h .
 		ln -s $root/runtime/*.c .
-		ln -s $root/runtime/*.mod .
 		ln -s $root/runtime/*.in .
 		cp $root/runtime/Mmake* .
 		ln -s $root/runtime/machdeps .
@@ -290,277 +297,296 @@
 
 fi
 
-if mmake $mmake_opts MMAKEFLAGS=$jfactor all
+if $do_bootcheck
 then
-	echo "building of stage 1 successful"
-else
-	echo "building of stage 1 not successful"
-	exit 1
-fi
+	if mmake $mmake_opts MMAKEFLAGS=$jfactor all
+	then
+		echo "building of stage 1 successful"
+	else
+		echo "building of stage 1 not successful"
+		exit 1
+	fi
 
-# the stage 1 compiler is copied to allow it to be worked on (slightly)
-# in parallel with the bootcheck itself.
+	# the stage 1 compiler is copied to allow it to be worked on (slightly)
+	# in parallel with the bootcheck itself.
 
-[ -d stage1 ] || mkdir stage1
+	[ -d stage1 ] || mkdir stage1
 
-cp compiler/mercury_compile stage1
-MERCURY_COMPILER=$root/stage1/mercury_compile
-export MERCURY_COMPILER
-MERCURY_INT_DIR=$root/stage2/library
-export MERCURY_INT_DIR
+	cp compiler/mercury_compile stage1
+	MERCURY_COMPILER=$root/stage1/mercury_compile
+	export MERCURY_COMPILER
+	MERCURY_INT_DIR=$root/stage2/library
+	export MERCURY_INT_DIR
 
-[ -d stage2 ] || mkdir stage2
-if $keep_stage_2
-then
-	echo keeping existing stage2
-else
-	# We try to do the removal of the stage 2 directory in parallel
-	# since recursive rm's across NFS can be quite slow ...
-	$RMSTAGECMD $root/stage2/compiler < /dev/null &
-	$RMSTAGECMD $root/stage2/library < /dev/null &
-	wait
-	$RMSTAGECMD $root/stage2/* < /dev/null
-	/bin/rm -fr $root/stage2/* < /dev/null
-fi
+	[ -d stage2 ] || mkdir stage2
+	if $keep_stage_2
+	then
+		echo keeping existing stage2
+	else
+		# We try to do the removal of the stage 2 directory in parallel
+		# since recursive rm's across NFS can be quite slow ...
+		$RMSTAGECMD $root/stage2/compiler < /dev/null &
+		$RMSTAGECMD $root/stage2/library < /dev/null &
+		wait
+		$RMSTAGECMD $root/stage2/* < /dev/null
+		/bin/rm -fr $root/stage2/* < /dev/null
+	fi
 
-set +x
-echo linking stage 2... 1>&2
-cd stage2
-mkdir compiler
-cd compiler
-# Break up the links into several chunks.
-# This is needed to cope with small limits on the size of argument vectors.
-
-ln -s $root/compiler/[a-h]*.m .
-ln -s $root/compiler/[i-s]*.m .
-ln -s $root/compiler/[t-z]*.m .
-cp $root/compiler/Mmake* .
-cd $root/stage2
-mkdir library
-cd library
-ln -s $root/library/library.nu.nl.in .
-ln -s $root/library/[a-l]*.m .
-ln -s $root/library/[m-z]*.m .
-ln -s $root/library/*.nl .
-cp $root/library/Mmake* .
-ln -s $root/library/libmercury.init .
-cd $root/stage2
-if test "$copy_runtime" = "true"
-then
-	mkdir runtime
-	cd runtime
-	ln -s $root/runtime/*.h .
-	ln -s $root/runtime/*.c .
-	ln -s $root/runtime/*.mod .
-	ln -s $root/runtime/*.in .
-	cp $root/runtime/Mmake* .
-	ln -s $root/runtime/machdeps .
+	set +x
+	echo linking stage 2... 1>&2
+	cd stage2
+	mkdir compiler
+	cd compiler
+	# Break up the links into several chunks.
+	# This is needed to cope with small limits
+	# on the size of argument vectors.
+
+	ln -s $root/compiler/[a-h]*.m .
+	ln -s $root/compiler/[i-s]*.m .
+	ln -s $root/compiler/[t-z]*.m .
+	cp $root/compiler/Mmake* .
 	cd $root/stage2
-else
-	ln -s $root/runtime .
-fi
-ln -s $root/boehm_gc .
-ln -s $root/doc .
-ln -s $root/scripts .
-ln -s $root/util .
-ln -s $root/profiler .
-ln -s $root/conf* .
-ln -s $root/VERSION .
-ln -s $root/.README.in .
-ln -s $root/.INSTALL.in .
-rm -f config*.log
-cp $root/Mmake* .
-if test -f $root/Mmake.stage.params
-then
-	/bin/rm -f Mmake.params
-	cp $root/Mmake.stage.params Mmake.params
-fi
-cd $root
+	mkdir library
+	cd library
+	ln -s $root/library/library.nu.nl.in .
+	ln -s $root/library/[a-l]*.m .
+	ln -s $root/library/[m-z]*.m .
+	ln -s $root/library/*.nl .
+	cp $root/library/Mmake* .
+	ln -s $root/library/libmercury.init .
+	cd $root/stage2
+	if test "$copy_runtime" = "true"
+	then
+		mkdir runtime
+		cd runtime
+		ln -s $root/runtime/*.h .
+		ln -s $root/runtime/*.c .
+		ln -s $root/runtime/*.in .
+		cp $root/runtime/Mmake* .
+		ln -s $root/runtime/machdeps .
+		cd $root/stage2
+	else
+		ln -s $root/runtime .
+	fi
+	ln -s $root/boehm_gc .
+	ln -s $root/doc .
+	ln -s $root/scripts .
+	ln -s $root/util .
+	ln -s $root/profiler .
+	ln -s $root/conf* .
+	ln -s $root/VERSION .
+	ln -s $root/.README.in .
+	ln -s $root/.INSTALL.in .
+	rm -f config*.log
+	cp $root/Mmake* .
+	if test -f $root/Mmake.stage.params
+	then
+		/bin/rm -f Mmake.params
+		cp $root/Mmake.stage.params Mmake.params
+	fi
+	cd $root
 
-set -x
+	set -x
 
-if (cd stage2 && mmake $mmake_opts $jfactor runtime)
-then
-	echo "building of stage 2 runtime successful"
-else
-	echo "building of stage 2 runtime not successful"
-	exit 1
-fi
+	if (cd stage2 && mmake $mmake_opts $jfactor runtime)
+	then
+		echo "building of stage 2 runtime successful"
+	else
+		echo "building of stage 2 runtime not successful"
+		exit 1
+	fi
 
-if (cd stage2 && mmake $mmake_opts depend_library depend_compiler)
-then
-	echo "building of stage 2 dependencies successful"
-else
-	echo "building of stage 2 dependencies not successful"
-	exit 1
-fi
+	if (cd stage2 && mmake $mmake_opts depend_library depend_compiler)
+	then
+		echo "building of stage 2 dependencies successful"
+	else
+		echo "building of stage 2 dependencies not successful"
+		exit 1
+	fi
 
-MMAKE_VPATH=.
-export MMAKE_VPATH
-MMAKE_DIR=$root/scripts
-export MMAKE_DIR
+	MMAKE_VPATH=.
+	export MMAKE_VPATH
+	MMAKE_DIR=$root/scripts
+	export MMAKE_DIR
 
-# the `RM_C=:' ensures that the `.c' files do not get deleted
+	# the `RM_C=:' ensures that the `.c' files do not get deleted
 
-if (cd stage2/library && mmake $mmake_opts $jfactor RM_C=: mercury)
-then
-	echo "building of stage 2 library successful"
-else
-	echo "building of stage 2 library not successful"
-	exit 1
-fi
+	if (cd stage2/library && mmake $mmake_opts $jfactor RM_C=: mercury)
+	then
+		echo "building of stage 2 library successful"
+	else
+		echo "building of stage 2 library not successful"
+		exit 1
+	fi
 
-if (cd stage2/compiler && mmake $mmake_opts $jfactor RM_C=: mercury_compile)
-then
-	echo "building of stage 2 compiler successful"
-else
-	echo "building of stage 2 compiler not successful"
-	exit 1
-fi
+	if (cd stage2/compiler && mmake $mmake_opts $jfactor RM_C=: mercury_compile)
+	then
+		echo "building of stage 2 compiler successful"
+	else
+		echo "building of stage 2 compiler not successful"
+		exit 1
+	fi
 
-unset MMAKE_VPATH
-unset MMAKE_DIR
+	unset MMAKE_VPATH
+	unset MMAKE_DIR
 
-if (cd stage2 && mmake $mmake_opts $jfactor all)
-then
-	echo "building of stage 2 successful"
-else
-	echo "building of stage 2 not successful"
-	exit 1
-fi
+	if (cd stage2 && mmake $mmake_opts $jfactor all)
+	then
+		echo "building of stage 2 successful"
+	else
+		echo "building of stage 2 not successful"
+		exit 1
+	fi
 
-MERCURY_COMPILER=$root/stage2/compiler/mercury_compile
-export MERCURY_COMPILER
-MERCURY_INT_DIR=$root/stage3/library
-export MERCURY_INT_DIR
+	MERCURY_COMPILER=$root/stage2/compiler/mercury_compile
+	export MERCURY_COMPILER
+	MERCURY_INT_DIR=$root/stage3/library
+	export MERCURY_INT_DIR
 
-[ -d stage3 ] || mkdir stage3
-if $keep_stage_3
-then
-	echo keeping existing stage3
-else
-	# We try to do the removal of the stage 3 directory in parallel
-	# since recursive rm's across NFS can be quite slow ...
-	$RMSTAGECMD $root/stage3/compiler < /dev/null &
-	$RMSTAGECMD $root/stage3/library < /dev/null &
-	wait
-	$RMSTAGECMD $root/stage3/* < /dev/null
-	/bin/rm -fr $root/stage3/* < /dev/null
-fi
+	[ -d stage3 ] || mkdir stage3
+	if $keep_stage_3
+	then
+		echo keeping existing stage3
+	else
+		# We try to do the removal of the stage 3 directory in parallel
+		# since recursive rm's across NFS can be quite slow ...
+		$RMSTAGECMD $root/stage3/compiler < /dev/null &
+		$RMSTAGECMD $root/stage3/library < /dev/null &
+		wait
+		$RMSTAGECMD $root/stage3/* < /dev/null
+		/bin/rm -fr $root/stage3/* < /dev/null
+	fi
 
-echo linking stage 3... 1>&2
-set +x
-cd stage3
-mkdir compiler
-cd compiler
-# Break up the links into several chunks.
-# This is needed to cope with small limits on the size of argument vectors.
-ln -s $root/compiler/[a-h]*.m .
-ln -s $root/compiler/[i-s]*.m .
-ln -s $root/compiler/[t-z]*.m .
-cp $root/compiler/Mmake* .
-cd $root/stage3
-mkdir library
-cd library
-ln -s $root/library/library.nu.nl.in .
-ln -s $root/library/[a-l]*.m .
-ln -s $root/library/[m-z]*.m .
-ln -s $root/library/*.nl .
-cp $root/library/Mmake* .
-ln -s $root/library/libmercury.init .
-cd $root/stage3
-ln -s $root/boehm_gc .
-ln -s $root/doc .
-ln -s $root/runtime .
-ln -s $root/scripts .
-ln -s $root/util .
-ln -s $root/profiler .
-ln -s $root/conf* .
-ln -s $root/VERSION .
-ln -s $root/.README.in .
-ln -s $root/.INSTALL.in .
-rm -f config*.log
-cp $root/Mmake* .
-if test -f $root/Mmake.stage.params
-then
-	/bin/rm -f Mmake.params
-	ln -s $root/Mmake.stage.params Mmake.params
-fi
-cd $root
-set -x
+	echo linking stage 3... 1>&2
+	set +x
+	cd stage3
+	mkdir compiler
+	cd compiler
+	# Break up the links into several chunks.
+	# This is needed to cope with small limits
+	# on the size of argument vectors.
+	ln -s $root/compiler/[a-h]*.m .
+	ln -s $root/compiler/[i-s]*.m .
+	ln -s $root/compiler/[t-z]*.m .
+	cp $root/compiler/Mmake* .
+	cd $root/stage3
+	mkdir library
+	cd library
+	ln -s $root/library/library.nu.nl.in .
+	ln -s $root/library/[a-l]*.m .
+	ln -s $root/library/[m-z]*.m .
+	ln -s $root/library/*.nl .
+	cp $root/library/Mmake* .
+	ln -s $root/library/libmercury.init .
+	cd $root/stage3
+	ln -s $root/boehm_gc .
+	ln -s $root/doc .
+	ln -s $root/runtime .
+	ln -s $root/scripts .
+	ln -s $root/util .
+	ln -s $root/profiler .
+	ln -s $root/conf* .
+	ln -s $root/VERSION .
+	ln -s $root/.README.in .
+	ln -s $root/.INSTALL.in .
+	rm -f config*.log
+	cp $root/Mmake* .
+	if test -f $root/Mmake.stage.params
+	then
+		/bin/rm -f Mmake.params
+		ln -s $root/Mmake.stage.params Mmake.params
+	fi
+	cd $root
+	set -x
 
-if (cd stage3 && mmake $mmake_opts depend_library depend_compiler)
-then
-	echo "building of stage 3 dependencies successful"
-else
-	echo "building of stage 3 dependencies not successful"
-	exit 1
-fi
+	if (cd stage3 && mmake $mmake_opts depend_library depend_compiler)
+	then
+		echo "building of stage 3 dependencies successful"
+	else
+		echo "building of stage 3 dependencies not successful"
+		exit 1
+	fi
 
-MMAKE_VPATH=.
-export MMAKE_VPATH
-MMAKE_DIR=$root/scripts
-export MMAKE_DIR
+	MMAKE_VPATH=.
+	export MMAKE_VPATH
+	MMAKE_DIR=$root/scripts
+	export MMAKE_DIR
 
-if (cd stage3/library && mmake $mmake_opts $jfactor ints && mmake $mmake_opts $jfactor cs)
-then
-	echo "building of stage 3 library successful"
-else
-	echo "building of stage 3 library not successful"
-	exit 1
-fi
+	if (cd stage3/library && mmake $mmake_opts $jfactor ints && mmake $mmake_opts $jfactor cs)
+	then
+		echo "building of stage 3 library successful"
+	else
+		echo "building of stage 3 library not successful"
+		exit 1
+	fi
 
-if (cd stage3/compiler && mmake $mmake_opts $jfactor cs)
-then
-	echo "building of stage 3 compiler successful"
-else
-	echo "building of stage 3 compiler not successful"
-	exit 1
-fi
+	if (cd stage3/compiler && mmake $mmake_opts $jfactor cs)
+	then
+		echo "building of stage 3 compiler successful"
+	else
+		echo "building of stage 3 compiler not successful"
+		exit 1
+	fi
 
-diff_status=0
+	diff_status=0
 
-exec 3>&1		# save stdout in fd 3
-if [ -n "$outfile" ]
-then
-	exec > "$outfile"	# redirect stdout to $outfile
-fi
+	exec 3>&1		# save stdout in fd 3
+	if [ -n "$outfile" ]
+	then
+		exec > "$outfile"	# redirect stdout to $outfile
+	fi
 
-for dir in library compiler; do
-	for file in stage2/$dir/*.c; do
-		diff -u $file stage3/$dir/`basename $file` || diff_status=1
+	for dir in library compiler; do
+		for file in stage2/$dir/*.c; do
+			diff -u $file stage3/$dir/`basename $file` || diff_status=1
+		done
 	done
-done
 
-exec >&3		# restore stdout from fd 3
-if [ $diff_status -ne 0 ]; then
-	echo "error - stage 2 and stage 3 differ!"
+	exec >&3		# restore stdout from fd 3
+	if [ $diff_status -ne 0 ]; then
+		echo "error - stage 2 and stage 3 differ!"
+	else
+		echo "stage 2 and stage 3 compare ok"
+		echo "removing stage 3..."
+		# We try to do the removal of the stage 3 directory in parallel
+		# since recursive rm's across NFS can be quite slow ...
+		$RMSTAGECMD $root/stage3/compiler < /dev/null &
+		$RMSTAGECMD $root/stage3/library < /dev/null &
+		wait
+		$RMSTAGECMD $root/stage3/* < /dev/null
+		/bin/rm -fr $root/stage3/* < /dev/null
+	fi
+
+	echo "finishing stage3 at `date`"
 else
-	echo "stage 2 and stage 3 compare ok"
-	echo "removing stage 3..."
-	# We try to do the removal of the stage 3 directory in parallel
-	# since recursive rm's across NFS can be quite slow ...
-	$RMSTAGECMD $root/stage3/compiler < /dev/null &
-	$RMSTAGECMD $root/stage3/library < /dev/null &
-	wait
-	$RMSTAGECMD $root/stage3/* < /dev/null
-	/bin/rm -fr $root/stage3/* < /dev/null
+	echo "building of stages 1 and 2 skipped"
 fi
 
-# since we may have removed the stage3 library, use the one in stage2
-MERCURY_INT_DIR=$root/stage2/library
-export MERCURY_INT_DIR
-
 if $runtests
 then
-	echo "finishing stage3 at `date`"
+	# use everything from stage 2
+
+	MERCURY_COMPILER=$root/stage2/compiler/mercury_compile
+	export MERCURY_COMPILER
+
+	MERCURY_INT_DIR=$root/stage2/library
+	export MERCURY_INT_DIR
 
-	# we'll use the stage 2 libraries to link against
 	MERCURY_LIBS="$root/stage2/library/libmercury.a
                 $root/stage2/runtime/libmer.a
-                $root/boehm_gc/libgc.a
+                $root/stage2/boehm_gc/libgc.a
                 -lm"
 	export MERCURY_LIBS
+
+	MERCURY_C_INCL_DIR="$root/stage2/runtime"
+	export MERCURY_C_INCL_DIR
+
+	MERCURY_GC_INCL_DIR="$root/stage2/boehm_gc"
+	export MERCURY_GC_INCL_DIR
+
+		# for mkinit
+	PATH=$root/stage2/util:$PATH
+	export PATH
 
 	if test -d ../tests
 	then



More information about the developers mailing list