A sandbox system to automate the building of the source tree and

reporting differences in compiler output with the output of the
previous build.
This commit is contained in:
Marc Olzheim 2004-03-23 16:32:45 +00:00
parent 8ed9644253
commit 4a4923f951
26 changed files with 476 additions and 0 deletions

View file

@ -0,0 +1 @@
*

View file

@ -0,0 +1,15 @@
#
# Common functions
#
# $Id$$Source$
#
# Blame it on marcolz
#
err() {
echo "ERROR: $@" >&2
exit 1
}
warn() {
echo "WARNING: $@" >&2
}

View file

@ -0,0 +1,8 @@
SCRIPTDIR=/home/marcolz/src/empire/nightlybuild
BOXDIR=boxes
LOGDIR=logs
SFLOGIN=marcolz
EMPLOGIN=marcolz
EMPTARGET=freebsd
ARCH=amd64
LOCALPATCHDIR=

View file

@ -0,0 +1,8 @@
SCRIPTDIR=/home/marcolz/src/empire/nightlybuild
BOXDIR=boxes
LOGDIR=logs
SFLOGIN=marcolz
EMPLOGIN=marcolz
EMPTARGET=freebsd
ARCH=i386
LOCALPATCHDIR=

View file

@ -0,0 +1,8 @@
SCRIPTDIR=/usr/local/src/empire/nightlybuild
BOXDIR=boxes
LOGDIR=logs
SFLOGIN=marcolz
EMPLOGIN=marcolz
EMPTARGET=interix
ARCH=pc
LOCALPATCHDIR=

View file

@ -0,0 +1,10 @@
SCRIPTDIR=/home/marcolz/src/empire/nightlybuild
BOXDIR=boxes
LOGDIR=logs
SFLOGIN=marcolz
EMPLOGIN=marcolz
EMPTARGET=solaris
ARCH=sparcv7
EXTRASUFFIX=cc
LOCALPATCHDIR=patches/solaris.sparcv7.cc
PATH="/opt/SUNWspro/bin:${PATH}"

View file

@ -0,0 +1,9 @@
SCRIPTDIR=/home/marcolz/src/empire/nightlybuild
BOXDIR=boxes
LOGDIR=logs
SFLOGIN=marcolz
EMPLOGIN=marcolz
EMPTARGET=solaris
ARCH=sparcv7
EXTRASUFFIX=gcc
LOCALPATCHDIR=patches/solaris.sparcv7.gcc

View file

@ -0,0 +1,10 @@
SCRIPTDIR=/home/marcolz/src/empire/nightlybuild
BOXDIR=boxes
LOGDIR=logs
SFLOGIN=marcolz
EMPLOGIN=marcolz
EMPTARGET=solaris
ARCH=sparcv9
EXTRASUFFIX=cc
LOCALPATCHDIR=patches/solaris.sparcv9.cc
PATH="/opt/SUNWspro/bin:${PATH}"

View file

@ -0,0 +1,9 @@
SCRIPTDIR=/home/marcolz/src/empire/nightlybuild
BOXDIR=boxes
LOGDIR=logs
SFLOGIN=marcolz
EMPLOGIN=marcolz
EMPTARGET=solaris
ARCH=sparcv9
EXTRASUFFIX=gcc
LOCALPATCHDIR=patches/solaris.sparcv9.gcc

View file

@ -0,0 +1,4 @@
#!/bin/sh
cd /home/marcolz/src/empire/nightlybuild/
./nightlybuild.sh conf/freebsd.amd64.config
./report.sh conf/freebsd.amd64.config | mutt -s 'empserver freebsd.amd64' empserver-devel@lists.sourceforge.net

View file

@ -0,0 +1,4 @@
#!/bin/sh
cd /home/marcolz/src/empire/nightlybuild/
./nightlybuild.sh conf/freebsd.i386.config
./report.sh conf/freebsd.i386.config | mutt -s 'empserver freebsd.i386' empserver-devel@lists.sourceforge.net

View file

@ -0,0 +1,4 @@
#!/bin/sh
cd /home/marcolz/src/empire/nightlybuild/
ksh ./nightlybuild.sh conf/solaris.sparcv7.cc.config
ksh ./report.sh conf/solaris.sparcv7.cc.config | mutt -s 'empserver solaris.sparcv7.cc' empserver-devel@lists.sourceforge.net

View file

@ -0,0 +1,4 @@
#!/bin/sh
cd /home/marcolz/src/empire/nightlybuild/
ksh ./nightlybuild.sh conf/solaris.sparcv7.gcc.config
ksh ./report.sh conf/solaris.sparcv7.gcc.config | mutt -s 'empserver solaris.sparcv7.gcc' empserver-devel@lists.sourceforge.net

View file

@ -0,0 +1,4 @@
#!/bin/sh
cd /home/marcolz/src/empire/nightlybuild/
ksh ./nightlybuild.sh conf/solaris.sparcv9.cc.config
ksh ./report.sh conf/solaris.sparcv9.cc.config | mutt -s 'empserver solaris.sparcv9.cc' empserver-devel@lists.sourceforge.net

View file

@ -0,0 +1,4 @@
#!/bin/sh
cd /home/marcolz/src/empire/nightlybuild/
ksh ./nightlybuild.sh conf/solaris.sparcv9.gcc.config
ksh ./report.sh conf/solaris.sparcv9.gcc.config | mutt -s 'empserver solaris.sparcv9.gcc' empserver-devel@lists.sourceforge.net

View file

@ -0,0 +1,37 @@
#!/bin/sh
#
# $Id$$Source$
#
# Check differences between the last two logs
#
# Blame it on marcolz
#
PROGNAME="$0"
usage() {
echo "Usage: ${PROGNAME} <configfile>" >&2;
exit 1;
}
[ $# -lt 1 ] && usage
[ -f "$1" ] || usage
# Source config file
case "$1"
in
*/*)
. "$1"
;;
*)
. ./"$1"
;;
esac
[ -f "${SCRIPTDIR}/common.sh" ] || { echo "Broken config ?" >&2; exit 1; }
. "${SCRIPTDIR}"/common.sh
cd "${LOGDIR}" || err "Could not cd to ${LOGDIR}"
diff -u $(ls "${EMPTARGET}.${ARCH}."* | tail -2)

View file

@ -0,0 +1 @@
*

View file

@ -0,0 +1,175 @@
#!/bin/sh
#
# $Id$$Source$
#
#
# Blame it on marcolz
#
# For some reason, solaris sh exits as soon as both stderr and stdout
# are redirected to file at the exec, so if we run on solaris, use ksh
# for this script.
#
INTERPRETER="$_"
case "$INTERPRETER"
in
*/ksh|ksh)
;;
*)
if [ "`uname`" = "SunOS" ]
then
exec ksh "$0" "$@"
fi
;;
esac
PROGNAME="$0"
CVS_RSH=ssh
export CVS_RSH
usage() {
echo "Usage: ${PROGNAME} <configfile>" >&2;
exit 1;
}
[ $# -lt 1 ] && usage
[ -f "$1" ] || usage
# Source config file
case "$1"
in
*/*)
. "$1"
;;
*)
. ./"$1"
;;
esac
[ -f "${SCRIPTDIR}/common.sh" ] || { echo "Broken config ?" >&2; exit 1; }
. "${SCRIPTDIR}"/common.sh
STAMP="`date +%Y%m%d%H%M%S`"
WORKDIR="${EMPTARGET}.${ARCH}"
[ -n "${EXTRASUFFIX}" ] && WORKDIR="${WORKDIR}.${EXTRASUFFIX}"
LOGFILE="${LOGDIR}/${WORKDIR}.${STAMP}"
# Log everything
exec > "${LOGFILE}"
exec 2>&1
case "${BOXDIR}"
in
/*)
;;
*)
BOXDIR="${SCRIPTDIR}/${BOXDIR}"
;;
esac
cd "${BOXDIR}" || err "Could not chdir to ${BOXDIR}"
echo "Nightly build starting at `date`"
# Make sandbox
mkdir "${WORKDIR}" || warn "Could not create ${BOXDIR}/${WORKDIR}"
cd "${WORKDIR}" || err "Could not cd to ${BOXDIR}/${WORKDIR}"
echo "Getting source from CVS:"
# Extract source
RETR=0
while ! cvs -z3 -d:ext:"${SFLOGIN}"@cvs.sourceforge.net:/cvsroot/empserver co empserver >/dev/null
do
sleep "`expr 5 + ${RETR}`"
RETR="`expr 1 + ${RETR}`"
[ "${RETR}" -gt 100 ] && err "CVS Timeout after ${RETR} retres."
done
echo "Done (CVS)."
echo ""
# Run local patches ${LOCALPATCHDIR}/*.patch
case "${LOCALPATCHDIR}"
in
/*)
;;
*)
LOCALPATCHDIR="${SCRIPTDIR}/${LOCALPATCHDIR}"
;;
esac
if [ -n "${LOCALPATCHDIR}" -a -d "${LOCALPATCHDIR}/." ]
then
echo "Applying local patches from ${LOCALPATCHDIR}:"
for i in "${LOCALPATCHDIR}"/*.patch
do
if patch -Np0 < "${i}" >/dev/null
then
echo "${i}: OK"
else
echo "========== ${i}: NOT OK! ${?} =========="
fi
done
echo "Done (patch)."
echo ""
fi
cd empserver || err "Could not cd to ${BOXDIR}/${WORKDIR}/empserver."
# Prep build.conf
echo "Preparing build.conf"
sed -e "s,^USERNAME = .*$,USERNAME = ${EMPLOGIN}," \
-e "s,^HOSTNAME = .*$,HOSTNAME = localhost," \
-e "s,^IPADDR = .*$,IPADDR = 127.0.0.1," \
-e "s,^EMPDIR = .*$,EMPDIR = ${BOXDIR}/${WORKDIR}/emp4," \
< build.conf > build.conf.new && \
mv build.conf.new build.conf || \
err "Could not prep build.conf"
echo "Done (build.conf)."
echo ""
# TODO: this should be fixed another way...
echo "Generating empty Makedepends."
touch src/client/Makedepend src/doconfig/Makedepend src/lib/as/Makedepend src/lib/commands/Makedepend src/lib/common/Makedepend src/lib/empthread/Makedepend src/lib/gen/Makedepend src/lib/global/Makedepend src/lib/lwp/Makedepend src/lib/player/Makedepend src/lib/subs/Makedepend src/lib/update/Makedepend src/server/Makedepend src/util/Makedepend || err "Could tot touch Makedepends"
echo "Done (touch)."
echo ""
# Start the build
echo "Building server"
if make "${EMPTARGET}" >/dev/null
then
warn "make did not return 0."
fi
echo "Done (make)."
echo ""
# Try to run startup utilities
if [ -d ../emp4 -a -d ../emp4/bin -a -d ../emp4/data ]
then
cd ../emp4/bin || err "Could not cd to ../emp4/bin"
echo "Determining type of files in bindir"
file *
echo "Done (file *)."
echo ""
echo "Running files and fairland"
echo y | ./files || warn "Error running files"
./fairland 10 30 >/dev/null || warn "Error running fairland"
echo "Done (files & fairland)."
echo ""
fi
# Clean sandbox
echo "Cleaning sandbox"
cd "${BOXDIR}" || err "Could not cd back to sanbox root !"
rm -r "${WORKDIR}" || warn "Directory ${WORKDIR} could not be cleanly removed !"
rm -rf "${WORKDIR}" || warn "Directory ${WORKDIR} could not be forcibly removed !"
[ -d "${WORKDIR}/." ] && warn "Directory ${WORKDIR} still present"
echo "Done (cleaning)."
echo "Nightly build finished at `date`"
exit 0

View file

@ -0,0 +1,12 @@
Index: empserver/build.conf
--- empserver/build.conf Thu Feb 12 17:50:48 2004
+++ empserver/build.conf Sat Mar 6 14:45:21 2004
@@ -40,7 +40,7 @@
# Please enter the C-compiler you are using (full path is allowed):
# (For NT builds using MSVC, use "CC = CL")
-CC = gcc
+CC = cc
# Please enter the linker you are using (full path is allowed):
# (For NT builds using MSVC, using "LD = ld" works fine.)

View file

@ -0,0 +1,12 @@
Index: empserver/Make.sysdefs
--- empserver/Make.sysdefs Sat Mar 6 13:50:20 2004
+++ empserver/Make.sysdefs Sat Mar 6 13:50:02 2004
@@ -96,7 +96,7 @@
RTPCLFLAGS =
RTPCMASTER = GLOBALCFLAGS="$(RTPCCFLAGS)" GLOBALLFLAGS="$(RTPCLFLAGS)"
-SOLCFLAGS = -g -DSVR4 -DRel4 -DUCONTEXT -DPOSIXSIGNALS -Dsolaris
+SOLCFLAGS = -g -DSVR4 -DRel4 -DUCONTEXT -DPOSIXSIGNALS -Dsolaris $(GCCWARNFLAGS) -Wno-char-subscripts
SOLLFLAGS = -lnsl -lsocket -lthread
SOLMASTER = GLOBALCFLAGS="$(SOLCFLAGS)" GLOBALLFLAGS="$(SOLLFLAGS)"

View file

@ -0,0 +1,12 @@
Index: empserver/build.conf
--- empserver/build.conf Thu Feb 12 17:50:48 2004
+++ empserver/build.conf Sat Mar 6 15:36:39 2004
@@ -44,7 +44,7 @@
# Please enter the linker you are using (full path is allowed):
# (For NT builds using MSVC, using "LD = ld" works fine.)
-LD = ld
+LD = gcc
# Please enter the maximum number of countries you want:
MAXNOC = 99

View file

@ -0,0 +1,14 @@
Index: empserver/Make.sysdefs
--- empserver/Make.sysdefs Sat Mar 6 13:50:20 2004
+++ empserver/Make.sysdefs Sat Mar 6 14:53:03 2004
@@ -96,8 +96,8 @@
RTPCLFLAGS =
RTPCMASTER = GLOBALCFLAGS="$(RTPCCFLAGS)" GLOBALLFLAGS="$(RTPCLFLAGS)"
-SOLCFLAGS = -g -DSVR4 -DRel4 -DUCONTEXT -DPOSIXSIGNALS -Dsolaris
-SOLLFLAGS = -lnsl -lsocket -lthread
+SOLCFLAGS = -g -DSVR4 -DRel4 -DUCONTEXT -DPOSIXSIGNALS -Dsolaris -xarch=v9
+SOLLFLAGS = -lnsl -lsocket -lthread -xarch=v9
SOLMASTER = GLOBALCFLAGS="$(SOLCFLAGS)" GLOBALLFLAGS="$(SOLLFLAGS)"
SEQCFLAGS = -O -DALLYHARBOR -DSHOWPLANE -DDROPANY -DREJECTS -DBMAP -DAUTONAV -DSCUTTLE -DCONVASAT -DORBIT -DABM -DGRIND -DPINPOINTMISSILE -DFALLOUT -DSAIL -DLOWSTARTMOB -DFIXREALMS -DBUYTAX -DNUKEFAILDETONATE -DMISSINGMISSILES

View file

@ -0,0 +1,12 @@
Index: empserver/build.conf
--- empserver/build.conf Thu Feb 12 17:50:48 2004
+++ empserver/build.conf Sat Mar 6 14:45:21 2004
@@ -40,7 +40,7 @@
# Please enter the C-compiler you are using (full path is allowed):
# (For NT builds using MSVC, use "CC = CL")
-CC = gcc
+CC = cc
# Please enter the linker you are using (full path is allowed):
# (For NT builds using MSVC, using "LD = ld" works fine.)

View file

@ -0,0 +1,14 @@
Index: empserver/Make.sysdefs
--- empserver/Make.sysdefs Sat Mar 6 13:50:20 2004
+++ empserver/Make.sysdefs Sat Mar 6 13:52:31 2004
@@ -96,8 +96,8 @@
RTPCLFLAGS =
RTPCMASTER = GLOBALCFLAGS="$(RTPCCFLAGS)" GLOBALLFLAGS="$(RTPCLFLAGS)"
-SOLCFLAGS = -g -DSVR4 -DRel4 -DUCONTEXT -DPOSIXSIGNALS -Dsolaris
-SOLLFLAGS = -lnsl -lsocket -lthread
+SOLCFLAGS = -g -DSVR4 -DRel4 -DUCONTEXT -DPOSIXSIGNALS -Dsolaris $(GCCWARNFLAGS) -m64 -Wno-char-subscripts
+SOLLFLAGS = -lnsl -lsocket -lthread -m64
SOLMASTER = GLOBALCFLAGS="$(SOLCFLAGS)" GLOBALLFLAGS="$(SOLLFLAGS)"
SEQCFLAGS = -O -DALLYHARBOR -DSHOWPLANE -DDROPANY -DREJECTS -DBMAP -DAUTONAV -DSCUTTLE -DCONVASAT -DORBIT -DABM -DGRIND -DPINPOINTMISSILE -DFALLOUT -DSAIL -DLOWSTARTMOB -DFIXREALMS -DBUYTAX -DNUKEFAILDETONATE -DMISSINGMISSILES

View file

@ -0,0 +1,12 @@
Index: empserver/build.conf
--- empserver/build.conf Thu Feb 12 17:50:48 2004
+++ empserver/build.conf Sat Mar 6 15:36:39 2004
@@ -44,7 +44,7 @@
# Please enter the linker you are using (full path is allowed):
# (For NT builds using MSVC, using "LD = ld" works fine.)
-LD = ld
+LD = gcc
# Please enter the maximum number of countries you want:
MAXNOC = 99

73
src/scripts/nightly/report.sh Executable file
View file

@ -0,0 +1,73 @@
#!/bin/sh
#
# $Id$$Source$
#
# Generate report from the last two build logs
#
# Blame it on marcolz
#
INTERPRETER="$_"
case "$INTERPRETER"
in
*/ksh|ksh)
;;
*)
if [ "`uname`" = "SunOS" ]
then
exec ksh "$0" "$@"
fi
;;
esac
PROGNAME="$0"
usage() {
echo "Usage: ${PROGNAME} <configfile>" >&2;
exit 1;
}
[ $# -lt 1 ] && usage
[ -f "$1" ] || usage
# Source config file
case "$1"
in
*/*)
. "$1"
;;
*)
. ./"$1"
;;
esac
[ -f "${SCRIPTDIR}/common.sh" ] || { echo "Broken config ?" >&2; exit 1; }
. "${SCRIPTDIR}"/common.sh
cd "${LOGDIR}" || err "Could not cd to ${LOGDIR}"
BUILDTYPE="${EMPTARGET}.${ARCH}"
[ -n "${EXTRASUFFIX}" ] && BUILDTYPE="${BUILDTYPE}.${EXTRASUFFIX}"
echo "This was generated using: ${0} ${1}"
echo ""
echo "Sections: <diff> <full>"
echo ""
echo "Environment:"
echo "uname -a: $(uname -a)"
echo "gcc -v: $(gcc -v 2>&1)"
echo ""
echo "========================================="
echo "===== Differences since last build: ====="
echo "========================================="
echo ""
diff -u `ls "${BUILDTYPE}."* | tail -2`
echo ""
echo "========================================="
echo "================ Full log: =============="
echo "========================================="
echo ""
cat `ls "${BUILDTYPE}."* | tail -1`