Hi !
Konstantin Osipov wrote:
> * Davi Arnaut <davi@stripped> [08/04/28 22:08]:
>> ChangeSet@stripped, 2008-04-28 14:52:20-03:00, davi@stripped +31 -0
>> Bring changes from libevent-1.4.3-stable
>
> OK to push.
>
> Let's resolve build issues, if any, as they come.
For platform-sprecific issues, that may be the only way -
but when a changeset adds new code files (= anything outside the
"mysql-test/" subtree), the correctness can be checked by the developer
locally before pushing.
The critical thing is that a new file must be
- under BK control, so that it is forwarded by push/pull and is taken by
"bk export",
- part of the distribution as created by "make dist".
To check both, please use the attached script.
It does these two steps and so mimics a release build locally on the
developer machine.
If a new file is needed in a local build, this script will catch all
cases where it is missing in the source code tarball.
Regards,
Jörg
--
Joerg Bruehe, MySQL Build Team, joerg@stripped (+49 30) 417 01 487
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Geschaeftsfuehrer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Haering Muenchen: HRB161028
#! /bin/sh
#
# cmd_export_build Mimic a release build as closely as possible
#
# Start from a BK tree "$DIR_BK",
# export to a temporary dirextory "$DIR_EXP",
# roll a source tarball, copy that to a build dir "$DIR_PLAT",
# run "configure" + "make".
usage() {
echo
echo "$0 - Mimic a release build on a local host"
echo
echo "Usage:"
echo
echo " $0 [Options] "
echo
echo "Options:"
echo
echo "--config-option=<option> - passed to 'configure' (cumulative)"
echo "--help - print this help text"
echo "--skip-export - start from an export done previously"
echo " (to use sources which were modified in the exported tree)"
echo "--tree=<bk-tree> - use this BK tree as the source (default: current
directory)"
echo
echo "Export and final build will be done to/in directories 'export' and 'platform'"
echo "having the same parent as '<bk-tree>', any previous contents will be deleted."
echo "Logs will be written into sibling directory 'logs'."
exit 1
}
parse_arguments() {
CONF_OPT=""
for ARG do
case "$ARG" in
--config-option=*) CONF_OPT="$CONF_OPT `echo \"$ARG\" | sed -e 's;--config-option=;;'`"
;;
--help) usage;;
--skip-export) SKIPEXPORT="yes" ;;
--tree=*) DIR_BK=`echo "$ARG" | sed -e "s;--tree=;;"` ;;
*)
echo "Unknown argument '$ARG'"
usage
;;
esac
done
}
##########
DIR_BK=`pwd`
parse_arguments "$@"
if [ -n "$DIR_BK" -a -d "$DIR_BK" -a -d "$DIR_BK/BitKeeper" ]
then :
else echo "'DIR_BK' = '$DIR_BK' is no Bitkeeper tree: ABORT"; usage
fi
DIR_PARENT=`dirname $DIR_BK`
DIR_EXP="$DIR_PARENT/export"
DIR_PLAT="$DIR_PARENT/platform"
DIR_LOG="$DIR_PARENT/logs"
echo "About to start '$0' using these directories:"
echo "BK tree: '$DIR_BK'"
echo "export: '$DIR_EXP'"
echo "platform: '$DIR_PLAT'"
echo "logs: '$DIR_LOG'"
if [ "$SKIPEXPORT" != "yes" ] ; then
echo "Doing a new export from the BK tree."
else
echo "Re-using the previous export from the BK tree."
fi
echo "Configure options: '$CONF_OPT'"
echo "Last chance to abort (10 seconds) - hit Ctrl-C!"
sleep 10
if [ ! -d $DIR_EXP ]
then mkdir $DIR_EXP ; echo "Created '$DIR_EXP'" ; fi
if [ ! -d $DIR_PLAT ]
then mkdir $DIR_PLAT ; echo "Created '$DIR_PLAT'" ; fi
if [ ! -d $DIR_LOG ]
then mkdir $DIR_LOG ; echo "Created '$DIR_LOG'" ; fi
LOGFILE="$DIR_LOG/`basename $DIR_BK`-`date '+%y%m%d-%H%M'`.log"
if [ -f $LOGFILE ]
then echo "Log file '$LOGFILE' exists: ABORT"; exit 1 ; fi
LOGPIPE="$DIR_LOG/pipe.$$"
if [ -e $LOGPIPE ]
then echo "Log pipe '$LOGPIPE' exists: ABORT"; exit 1 ; fi
mkfifo $LOGPIPE
# redirect all following output into the log
# Plain "exec" does not work in a shell pipe, use trick:
tee $LOGFILE <$LOGPIPE &
exec >$LOGPIPE 2>&1
# write summary info into the log file
echo "`date '+%y%m%d-%H%M%S'` Start '$0 $*'" # >$LOGFILE
echo "BK tree: '$DIR_BK'" # >>$LOGFILE
echo "export: '$DIR_EXP'" # >>$LOGFILE
echo "platform: '$DIR_PLAT'" # >>$LOGFILE
echo "logs: '$DIR_LOG'" # >>$LOGFILE
echo "configure: '$CONF_OPT'" # >>$LOGFILE
# remove the pipe - it will be used until the process terminates
rm $LOGPIPE
# for debugging ...
set -x
cd $DIR_PLAT ; rm -fr * .[a-z]*
##########
#
# Mimic the essential actions from "Bootstrap"
#
if [ "$SKIPEXPORT" != "yes" ] ; then
# Cleanup first
cd $DIR_EXP ; rm -fr * .[a-z]*
# Perform a "bk export" as done by the "Bootstrap" tool.
cd $DIR_BK
bk export -w $DIR_EXP
bk changes | head -25 > $DIR_EXP/ChangeLog
fi
# Do the initial build in the "export" directory
cd $DIR_EXP
BUILD/compile-dist
# Produce the source tarball
make dist
##########
#
# Mimic the essential action from "Do-compile-all"
#
cp mysql-[456]*.tar.gz $DIR_PLAT
##########
#
# Mimic the essential actions from "Do-compile" (on the build host)
#
cd $DIR_PLAT
# Unpack the source
tar xzvf mysql-[456]*.tar.gz
cd mysql-[456]*
pwd
./configure $CONF_OPT
make