Commit c7b79a59 authored by Rich Prohaska's avatar Rich Prohaska

build mysql from github

parent 1d80daf1
...@@ -4,12 +4,12 @@ shopt -s compat31 2> /dev/null ...@@ -4,12 +4,12 @@ shopt -s compat31 2> /dev/null
function usage() { function usage() {
echo "make.mysql.bash - build mysql with the fractal tree" echo "make.mysql.bash - build mysql with the fractal tree"
echo "[--branch=$branch] [--revision=$revision] [--suffix=$suffix]" echo "--git_tag=$git_tag --git_server=$git_server"
echo "[--mysql=$mysql]" echo "--mysql=$mysql"
echo "[--tokudb=$tokudb] [--tokudbengine=$tokudbengine]" echo "--build_type=$build_type --cmake_build_type=$cmake_build_type"
echo "[--jemalloc=$jemalloc]" echo "--cc=$cc --cxx=$cxx"
echo "[--cc=$cc --cxx=$cxx] [--ftcc=$ftcc --ftcxx=$ftcxx] [--debugbuild=$debugbuild] [--staticft=$staticft]" echo "--build_debug=$build_debug --build_tgz=$build_tgz --build_rpm=$build_rpm"
echo "[--rpm=$rpm] [--do_s3=$do_s3] [--do_make_check=$do_make_check]" echo "--do_s3=$do_s3 --do_make_check=$do_make_check"
return 1 return 1
} }
...@@ -31,6 +31,50 @@ function retry() { ...@@ -31,6 +31,50 @@ function retry() {
test $exitcode = 0 test $exitcode = 0
} }
function github_download() {
repo=$1; shift
rev=$1; shift
dest=$1; shift
mkdir $dest
if [ ! -z $github_token ] ; then
retry curl \
--header "Authorization:\\ token\\ $github_token" \
--location https://api.github.com/repos/$repo/tarball/$rev \
--output $dest.tar.gz
tar --extract \
--gzip \
--directory=$dest \
--strip-components=1 \
--file $dest.tar.gz
rm -f $dest.tar.gz
elif [ ! -z $github_user ] ; then
retry curl \
--user $github_user \
--location https://api.github.com/repos/$repo/tarball/$rev \
--output $dest.tar.gz
tar --extract \
--gzip \
--directory=$dest \
--strip-components=1 \
--file $dest.tar.gz
rm -f $dest.tar.gz
else
tempdir=$(mktemp -d -p $PWD)
retry git clone git@github.com:${repo}.git $tempdir
# export the right branch or tag
(cd $tempdir ;
git archive \
--format=tar \
$rev) | \
tar --extract \
--directory $dest
rm -rf $tempdir
fi
}
function get_ncpus() { function get_ncpus() {
if [ -f /proc/cpuinfo ]; then if [ -f /proc/cpuinfo ]; then
grep bogomips /proc/cpuinfo | wc -l grep bogomips /proc/cpuinfo | wc -l
...@@ -41,139 +85,103 @@ function get_ncpus() { ...@@ -41,139 +85,103 @@ function get_ncpus() {
fi fi
} }
function get_branchrevision() {
local branch=$1; local revision=$2; local suffix=$3
local branchrevision
if [ $branch != "." ] ; then
branchrevision=$(basename $branch)-$revision
else
branchrevision=$revision
fi
if [ "$suffix" != "." ] ; then
branchrevision=$branchrevision-$suffix
fi
echo $branchrevision
}
function mysql_version() {
local mysql=$1
if [[ $mysql =~ (mysql|mysqlcom|mariadb)-(.*) ]] ; then
echo ${BASH_REMATCH[2]}
fi
}
function build_jemalloc() { function build_jemalloc() {
local jemalloc=$1; local branch=$2; local revision=$3; local branchrevision=$4 if [ ! -d jemalloc ] ; then
# get the jemalloc repo jemalloc
if [ ! -d $jemalloc ] ; then github_download Tokutek/jemalloc $git_tag jemalloc
retry svn export -q -r $revision $svnserver/$branch/$jemalloc $jemalloc
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
pushd jemalloc
pushd $jemalloc if [ $? != 0 ] ; then exit 1; fi
if [ $? = 0 ] ; then CC=$cc ./configure --with-private-namespace=jemalloc_
CC=$cc ./configure --with-private-namespace=jemalloc_ if [ $? != 0 ] ; then exit 1; fi
if [ $? != 0 ] ; then exit 1; fi make
make if [ $? != 0 ] ; then exit 1; fi
if [ $? != 0 ] ; then exit 1; fi popd
popd
fi
fi fi
} }
# check out the fractal tree source from subversion, build it, and make the fractal tree tarballs # check out the fractal tree source from subversion, build it, and make the fractal tree tarballs
function build_fractal_tree() { function build_fractal_tree() {
if [ ! -d $tokufractaltreedir ] ; then if [ ! -d ft-index ] ; then
mkdir $tokufractaltreedir
if [ $branch = "." ] ; then tokudb_branch=toku; else tokudb_branch=$branch; fi # get the ft-index repo
retry svn export -q -r $revision $svnserver/$tokudb_branch/$tokudb github_download Tokutek/ft-index $git_tag ft-index
exitcode=$?; if [ $exitcode != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
if [[ $ftcc =~ icc ]] ; then pushd ft-index
if [ -d /opt/intel/bin ] ; then if [ $? != 0 ] ; then exit 1; fi
export PATH=$PATH:/opt/intel/bin
. /opt/intel/bin/compilervars.sh intel64
fi
fi
retry svn export -q -r $revision $svnserver/$branch/$xz echo `date` make $tokudb $cc $($cc --version)
exitcode=$?; if [ $exitcode != 0 ] ; then exit 1; fi
pushd $tokudb local ft_build_type=""
local use_valgrind=""
local debug_paranoid=""
if [[ $build_debug = 1 ]]; then
ft_build_type=Debug
use_valgrind="ON"
debug_paranoid="ON"
else
ft_build_type=Release
use_valgrind="OFF"
debug_paranoid="OFF"
fi
echo `date` make $tokudb $ftcc $($ftcc --version) mkdir -p build
local intel_cc="" pushd build
if [[ $ftcc = "icc" ]]; then if [ $? != 0 ] ; then exit 1; fi
intel_cc="ON"
cmake_env="" CC=$cc CXX=$cxx cmake \
else -D LIBTOKUDB=$tokufractaltree \
intel_cc="OFF" -D LIBTOKUPORTABILITY=$tokuportability \
cmake_env="CC=$ftcc CXX=$ftcxx" -D CMAKE_TOKUDB_REVISION=0 \
fi -D CMAKE_BUILD_TYPE=$ft_build_type \
local use_valgrind="" -D TOKU_SVNROOT=$basedir \
local debug_paranoid="" -D JEMALLOC_SOURCE_DIR=../../jemalloc \
if [[ $debugbuild = 1 ]]; then -D CMAKE_INSTALL_PREFIX=../../$tokufractaltreedir \
use_valgrind="ON" -D BUILD_TESTING=OFF \
debug_paranoid="ON" -D USE_GTAGS=OFF \
else -D USE_CTAGS=OFF \
use_valgrind="OFF" -D USE_ETAGS=OFF \
debug_paranoid="OFF" -D USE_CSCOPE=OFF \
fi -D USE_VALGRIND=$use_valgrind \
-D TOKU_DEBUG_PARANOID=$debug_paranoid \
..
make install -j$makejobs
if [ $? != 0 ] ; then exit 1; fi
mkdir -p build popd # build
cd build
popd # ft-index
# only use FT Release or Debug build types
local ft_build_type=$build_type
if [ $ft_build_type = RelWithDebInfo ] ; then ft_build_type=Release; fi
eval $cmake_env cmake \
-D LIBTOKUDB=$tokufractaltree \
-D LIBTOKUPORTABILITY=$tokuportability \
-D CMAKE_TOKUDB_REVISION=$revision \
-D CMAKE_BUILD_TYPE=$ft_build_type \
-D TOKU_SVNROOT=$basedir \
-D JEMALLOC_SOURCE_DIR=../../$jemalloc \
-D CMAKE_INSTALL_PREFIX=../../$tokufractaltreedir \
-D BUILD_TESTING=OFF \
-D USE_GTAGS=OFF \
-D USE_CTAGS=OFF \
-D USE_ETAGS=OFF \
-D USE_CSCOPE=OFF \
-D USE_VALGRIND=$use_valgrind \
-D TOKU_DEBUG_PARANOID=$debug_paranoid \
..
make install -j$makejobs
exitcode=$?; if [ $exitcode != 0 ] ; then exit 1; fi
popd
pushd $tokufractaltreedir/examples pushd $tokufractaltreedir/examples
# test the examples if [ $? != 0 ] ; then exit 1; fi
sed -ie "s/LIBTOKUDB = tokudb/LIBTOKUDB = $tokufractaltree/" Makefile
sed -ie "s/LIBTOKUPORTABILITY = tokuportability/LIBTOKUPORTABILITY = $tokuportability/" Makefile # test the examples
if [ $system = darwin ] ; then sed -ie "s/LIBTOKUDB = tokudb/LIBTOKUDB = $tokufractaltree/" Makefile
DYLD_LIBRARY_PATH=$PWD/../lib:$DYLD_LIBRARY_PATH make check CC=$ftcc sed -ie "s/LIBTOKUPORTABILITY = tokuportability/LIBTOKUPORTABILITY = $tokuportability/" Makefile
if [ $system = darwin ] ; then
DYLD_LIBRARY_PATH=$PWD/../lib:$DYLD_LIBRARY_PATH make check CC=$cc
exitcode=$?
else
if [ $do_make_check != 0 ] ; then
make check CC=$cc
exitcode=$? exitcode=$?
else else
if [ $do_make_check != 0 ] ; then exitcode=0
make check CC=$ftcc
exitcode=$?
else
exitcode=0
fi
fi fi
echo `date` make check examples $tokufractaltree $exitcode fi
if [ $exitcode != 0 ] ; then exit 1; fi echo `date` make check examples $tokufractaltree $exitcode
make clean if [ $exitcode != 0 ] ; then exit 1; fi
make clean
popd popd
# add jemalloc.so # add jemalloc.so
if [ $system = darwin ] ; then if [ $system = linux ] ; then
cp $jemalloc/lib/libjemalloc.1.dylib $tokufractaltreedir/lib/lib$jemalloc-$branchrevision.dylib cp jemalloc/lib/libjemalloc.so.1 $tokufractaltreedir/lib
else elif [ $system = darwin ] ; then
cp $jemalloc/lib/libjemalloc.so.1 $tokufractaltreedir/lib/lib$jemalloc-$branchrevision.so cp jemalloc/lib/libjemalloc.1.dylib $tokufractaltreedir/lib
fi fi
cp $jemalloc/lib/libjemalloc.a $tokufractaltreedir/lib/libjemalloc.a cp jemalloc/lib/libjemalloc.a $tokufractaltreedir/lib/libjemalloc.a
# make tarballs # make tarballs
tar czf $tokufractaltreedir.tar.gz $tokufractaltreedir tar czf $tokufractaltreedir.tar.gz $tokufractaltreedir
...@@ -187,7 +195,7 @@ function generate_cmake_cmd() { ...@@ -187,7 +195,7 @@ function generate_cmake_cmd() {
local extra_flags=$* local extra_flags=$*
if [[ $mysqlsrc =~ ^Percona ]] ; then extra_flags=-DWITH_EMBEDDED_SERVER=OFF; fi if [[ $mysqlsrc =~ ^Percona ]] ; then extra_flags=-DWITH_EMBEDDED_SERVER=OFF; fi
echo -n cmake .. $extra_flags -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=$build_type echo -n cmake .. $extra_flags -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=$cmake_build_type
if [ $system = linux ] ; then if [ $system = linux ] ; then
echo -n " " \ echo -n " " \
-DCMAKE_EXE_LINKER_FLAGS=\"-Wl,--whole-archive \$TOKUFRACTALTREE/lib/libjemalloc.a -Wl,-no-whole-archive\" -DCMAKE_EXE_LINKER_FLAGS=\"-Wl,--whole-archive \$TOKUFRACTALTREE/lib/libjemalloc.a -Wl,-no-whole-archive\"
...@@ -198,7 +206,7 @@ function generate_cmake_cmd() { ...@@ -198,7 +206,7 @@ function generate_cmake_cmd() {
else else
exit 1 exit 1
fi fi
if [ $link_enterprise_hot_backup != 0 ] ; then if [ $build_type = enterprise ] ; then
echo -n " " -DCOMPILATION_COMMENT=\"TokuDB Enterprise Server \(GPL\)\" echo -n " " -DCOMPILATION_COMMENT=\"TokuDB Enterprise Server \(GPL\)\"
fi fi
echo echo
...@@ -206,7 +214,7 @@ function generate_cmake_cmd() { ...@@ -206,7 +214,7 @@ function generate_cmake_cmd() {
# generate a script that builds from the mysql src tarball and the fractal tree tarball # generate a script that builds from the mysql src tarball and the fractal tree tarball
function generate_build_from_src() { function generate_build_from_src() {
local tokumysqldir=$1; local mysqlsrc=$2; local tokufractaltreedir=$3 local mysqlsrc=$1; local tokufractaltreedir=$2
pushd $mysqlsrc >/dev/null 2>&1 pushd $mysqlsrc >/dev/null 2>&1
if [ $? = 0 ] ; then if [ $? = 0 ] ; then
echo '#/usr/bin/env bash' echo '#/usr/bin/env bash'
...@@ -242,16 +250,11 @@ function generate_build_from_src() { ...@@ -242,16 +250,11 @@ function generate_build_from_src() {
echo fi echo fi
# setup environment variables # setup environment variables
echo export TOKUDB_VERSION=$branchrevision echo export TOKUDB_VERSION=$tokudb_version
echo export TOKUFRACTALTREE='$PWD'/$tokufractaltreedir echo export TOKUFRACTALTREE='$PWD'/$tokufractaltreedir
echo export TOKUDB_PATCHES=$tokudb_patches echo export TOKUDB_PATCHES=$tokudb_patches
if [ $staticft != 0 ] ; then echo export TOKUFRACTALTREE_LIBNAME=${tokufractaltree}_static
echo export TOKUFRACTALTREE_LIBNAME=${tokufractaltree}_static echo export TOKUPORTABILITY_LIBNAME=${tokuportability}_static
echo export TOKUPORTABILITY_LIBNAME=${tokuportability}_static
else
echo export TOKUFRACTALTREE_LIBNAME=${tokufractaltree}
echo export TOKUPORTABILITY_LIBNAME=${tokuportability}
fi
echo 'export CC=$cc; export CXX=$cxx' echo 'export CC=$cc; export CXX=$cxx'
echo "pushd $mysqlsrc" echo "pushd $mysqlsrc"
...@@ -259,8 +262,8 @@ function generate_build_from_src() { ...@@ -259,8 +262,8 @@ function generate_build_from_src() {
if [ ! -f CMakeLists.txt ] ; then exit 1; fi if [ ! -f CMakeLists.txt ] ; then exit 1; fi
if [ $build_tarball != 0 ] ; then if [ $build_tgz != 0 ] ; then
echo "mkdir build.$build_type; pushd build.$build_type" echo "mkdir build.$cmake_build_type; pushd build.$cmake_build_type"
echo 'if [ $? != 0 ] ; then exit 1; fi' echo 'if [ $? != 0 ] ; then exit 1; fi'
cmd=$(generate_cmake_cmd $mysqlsrc) cmd=$(generate_cmake_cmd $mysqlsrc)
...@@ -285,25 +288,10 @@ function generate_build_from_src() { ...@@ -285,25 +288,10 @@ function generate_build_from_src() {
# add ft files to the mysql tarball # add ft files to the mysql tarball
echo tar xzf $mysqldir.tar.gz echo tar xzf $mysqldir.tar.gz
echo 'if [ $? != 0 ] ; then exit 1; fi' echo 'if [ $? != 0 ] ; then exit 1; fi'
if [ $staticft = 0 ] ; then
# add fractal tree libs to the mysql tarball only if we are linking to shared libs
echo "if [ -d $mysqldir/lib/mysql ] ; then"
echo " cp ../../$tokufractaltreedir/lib/lib* $mysqldir/lib/mysql"
echo else
echo " cp ../../$tokufractaltreedir/lib/lib* $mysqldir/lib"
echo fi
echo 'if [ $? != 0 ] ; then exit 1; fi'
fi
# add ftdump to mysql tarball # add ftdump to mysql tarball
echo "cp ../../$tokufractaltreedir/bin/ftdump $mysqldir/bin/tokuftdump" echo "cp ../../$tokufractaltreedir/bin/ftdump $mysqldir/bin/tokuftdump"
echo 'if [ $? != 0 ] ; then exit 1; fi' echo 'if [ $? != 0 ] ; then exit 1; fi'
# add tokustat to the mysql tarball
echo "cp ../../$mysqlsrc/scripts/tokustat.py $mysqldir/bin"
echo 'if [ $? != 0 ] ; then exit 1; fi'
# add tokufilecheck to the mysql tarball
echo "cp ../../$mysqlsrc/scripts/tokufilecheck.py $mysqldir/bin"
echo 'if [ $? != 0 ] ; then exit 1; fi'
# cleanup # cleanup
echo rm $mysqldir.tar.gz echo rm $mysqldir.tar.gz
echo 'if [ $? != 0 ] ; then exit 1; fi' echo 'if [ $? != 0 ] ; then exit 1; fi'
...@@ -320,8 +308,8 @@ function generate_build_from_src() { ...@@ -320,8 +308,8 @@ function generate_build_from_src() {
fi fi
# make RPMs # make RPMs
if [ $system = linux -a $rpm != 0 ]; then if [ $system = linux -a $build_rpm != 0 ]; then
echo "mkdir build.${build_type}.rpms; pushd build.${build_type}.rpms" echo "mkdir build.${cmake_build_type}.rpms; pushd build.${cmake_build_type}.rpms"
echo 'if [ $? != 0 ] ; then exit 1; fi' echo 'if [ $? != 0 ] ; then exit 1; fi'
if [[ $mysqlsrc =~ ^mariadb ]] ; then if [[ $mysqlsrc =~ ^mariadb ]] ; then
...@@ -382,6 +370,11 @@ function generate_build_from_src() { ...@@ -382,6 +370,11 @@ function generate_build_from_src() {
echo 'mv *.rpm ../..' echo 'mv *.rpm ../..'
echo 'if [ $? != 0 ] ; then exit 1; fi' echo 'if [ $? != 0 ] ; then exit 1; fi'
echo 'popd' echo 'popd'
echo 'pushd SRPMS'
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo 'mv *.rpm ..'
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo 'popd'
fi fi
# generate the md5 file # generate the md5 file
...@@ -400,63 +393,60 @@ function generate_build_from_src() { ...@@ -400,63 +393,60 @@ function generate_build_from_src() {
fi fi
} }
# checkout the mysql source from subversion, generate a build script, and make the mysql source tarball # checkout the mysql source, generate a build script, and make the mysql source tarball
function build_mysql_src() { function build_mysql_src() {
if [ ! -d $mysqlsrc ] ; then if [ ! -d $mysqlsrc ] ; then
# get the mysql source # get the mysql repo
if [ $branch = "." ] ; then mysql_branch=mysql.com; else mysql_branch=$branch; fi if [ ! -d $mysql_repo ] ; then
github_download Tokutek/$mysql_repo $git_tag $mysqlsrc
retry svn export -q -r $revision $svnserver/$mysql_branch/$mysql $mysqlsrc
if [ $? != 0 ] ; then exit 1; fi
# get the tokudb handlerton source
if [ $branch = "." ] ; then tokumysql_branch=mysql; else tokumysql_branch=$branch/mysql; fi
pushd $mysqlsrc/storage
retry svn export -q -r $revision $svnserver/$tokumysql_branch/tokudb-engine/$tokudbengine tokudb
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
popd fi
pushd $mysqlsrc/scripts
retry svn export -q -r $revision $svnserver/$tokumysql_branch/scripts/tokustat.py tokustat.py # get the hot backup source
if [ ! -d backup-$build_type ] ; then
github_download Tokutek/backup-$build_type $git_tag backup-$build_type
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
popd fi
pushd $mysqlsrc/scripts
retry svn export -q -r $revision $svnserver/$tokumysql_branch/scripts/tokufilecheck.py tokufilecheck.py # get the ft-engine repo
if [ ! -d ft-engine ] ; then
github_download Tokutek/ft-engine $git_tag ft-engine
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
popd fi
# append the tokudb version to the MYSQL_VERSION_EXTRA variable in the VERSION file # append the tokudb version to the MYSQL_VERSION_EXTRA variable in the VERSION file
pushd $mysqlsrc sed -i "" -e"s/^MYSQL_VERSION_EXTRA=.*/&-tokudb-${tokudb_version}/" $mysqlsrc/VERSION
if [ $? = 0 ] ; then
sed -i "" -e"s/^MYSQL_VERSION_EXTRA=.*/&-tokudb-${branchrevision}/" VERSION # add the backup source
popd mkdir $mysqlsrc/toku_backup
fi pushd backup-$build_type/backup
if [ $? != 0 ] ; then exit 1; fi
copy_files=$(ls CMakeLists.txt *.h *.cc *.cmake export.map)
cp $copy_files ../../$mysqlsrc/toku_backup
if [ $? != 0 ] ; then exit 1; fi
popd
# add the tokudb storage engine source
mkdir -p $mysqlsrc/storage/tokudb
pushd ft-engine/storage/tokudb
if [ $? != 0 ] ; then exit 1; fi
copy_files=$(ls CMakeLists.txt *.h *.cc)
cp $copy_files ../../../$mysqlsrc/storage/tokudb
if [ $? != 0 ] ; then exit 1; fi
popd
# merge the common mysql tests into the source # merge the common mysql tests into the source
pushd $mysqlsrc/mysql-test mv $mysqlsrc/mysql-test $mysqlsrc/mysql-test-save
if [ $? = 0 ] ; then cp -r ft-engine/mysql-test $mysqlsrc
mkdir ../mysql-test-save cp -r $mysqlsrc/mysql-test-save/* $mysqlsrc/mysql-test
mv * ../mysql-test-save rm -rf $mysqlsrc/mysql-test-save
retry svn export -q -r $revision $svnserver/$tokumysql_branch/tests/mysql-test
mv mysql-test/* .
rmdir mysql-test
cp -r ../mysql-test-save/* .
rm -rf ../mysql-test-save
popd
fi
# get the hot backup source # add the common scripts into the source
pushd $mysqlsrc cp -r ft-engine/scripts $mysqlsrc
if [ $? = 0 ] ; then
if [ $link_enterprise_hot_backup != 0 ] ; then # generate the tokudb.build.bash script from the mysql src and the fractal tree tarballs
retry svn export -q -r $revision $svnserver/backup-restore/backup/ toku_backup generate_build_from_src $mysqlsrc $tokufractaltreedir >$mysqlsrc/scripts/tokudb.build.bash
else
retry svn export -q -r $revision $svnserver/backup-restore/backup-community/ toku_backup
fi
fi
popd
generate_build_from_src $tokumysql_branch $mysqlsrc $tokufractaltreedir >$mysqlsrc/scripts/tokudb.build.bash
# make the mysql src tarball # make the mysql src tarball
tar czf $mysqlsrc.tar.gz $mysqlsrc tar czf $mysqlsrc.tar.gz $mysqlsrc
...@@ -492,13 +482,13 @@ function build_mysql_release() { ...@@ -492,13 +482,13 @@ function build_mysql_release() {
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
# move the build files # move the build files
pushd $mysqlsrc/build.${build_type} pushd $mysqlsrc/build.${cmake_build_type}
if [ $? = 0 ] ; then if [ $? = 0 ] ; then
cp $mysqldir.tar.gz* $basedir; if [ $? != 0 ] ; then exit 1; fi cp $mysqldir.tar.gz* $basedir; if [ $? != 0 ] ; then exit 1; fi
popd popd
fi fi
if [ $rpm != 0 ] ; then if [ $build_rpm != 0 ] ; then
pushd $mysqlsrc/build.${build_type}.rpms pushd $mysqlsrc/build.${cmake_build_type}.rpms
if [ $? = 0 ] ; then if [ $? = 0 ] ; then
rpmfiles=$(ls *.rpm *.rpm.md5) rpmfiles=$(ls *.rpm *.rpm.md5)
for x in $rpmfiles; do cp $x $basedir; if [ $? != 0 ] ; then exit 1; fi; done for x in $rpmfiles; do cp $x $basedir; if [ $? != 0 ] ; then exit 1; fi; done
...@@ -512,31 +502,24 @@ function build_mysql_release() { ...@@ -512,31 +502,24 @@ function build_mysql_release() {
PATH=$HOME/bin:$PATH PATH=$HOME/bin:$PATH
branch=. git_server=git@github.com
revision=0 git_tag=
suffix=. mysql=mysql-5.5.30
mysql=mysql-5.5.28
tokudb=tokudb tokudb=tokudb
tokudbengine=tokudb-engine
link_enterprise_hot_backup=0
do_s3=1 do_s3=1
do_make_check=1 do_make_check=1
cc=gcc47 cc=gcc47
cxx=g++47 cxx=g++47
ftcc=gcc47
ftcxx=g++47
system=`uname -s | tr '[:upper:]' '[:lower:]'` system=`uname -s | tr '[:upper:]' '[:lower:]'`
arch=`uname -m | tr '[:upper:]' '[:lower:]'` arch=`uname -m | tr '[:upper:]' '[:lower:]'`
svnserver=https://svn.tokutek.com/tokudb svnserver=https://svn.tokutek.com/tokudb
jemalloc=jemalloc-3.3.0
xz=xz-4.999.9beta
makejobs=$(get_ncpus) makejobs=$(get_ncpus)
debugbuild=0 build_debug=0
staticft=1 build_type=community
tokudb_patches=1 tokudb_patches=1
build_type=RelWithDebInfo cmake_build_type=RelWithDebInfo
build_tarball=1 build_tgz=1
rpm=0 build_rpm=0
while [ $# -gt 0 ] ; do while [ $# -gt 0 ] ; do
arg=$1; shift arg=$1; shift
...@@ -549,35 +532,49 @@ while [ $# -gt 0 ] ; do ...@@ -549,35 +532,49 @@ while [ $# -gt 0 ] ; do
fi fi
done done
if [ $debugbuild != 0 ] ; then if [ -z $git_tag ] ; then exit 1; fi
if [ $build_type = RelWithDebInfo ] ; then build_type=Debug; fi
if [ $suffix = "." ] ; then suffix=debug; fi # set tokudb version
if [[ $git_tag =~ tokudb-(.*) ]] ; then
tokudb_version=${BASH_REMATCH[1]}
else
tokudb_version=$git_tag
fi
if [ $build_debug != 0 ] ; then
if [ $cmake_build_type = RelWithDebInfo ] ; then cmake_build_type=Debug; fi
tokudb_version=$tokudb_version-debug
fi
if [ $build_type == enterprise ] ; then
tokudb_version=$tokudb_version-e
fi fi
if [ $link_enterprise_hot_backup != 0 ] ; then # split mysql into mysql_repo and mysql_version
if [ $suffix = "." ] ; then suffix="e"; else suffix="$suffix-e"; fi if [[ $mysql =~ ^(mysql|mariadb)-(.*)$ ]] ; then
mysql_repo=${BASH_REMATCH[1]}
mysql_version=${BASH_REMATCH[2]}
else
exit 1
fi fi
branchrevision=$(get_branchrevision $branch $revision $suffix) # set build dir
builddir=build-$tokudb-$branchrevision builddir=build-$tokudb-$tokudb_version
if [ ! -d $builddir ] ; then mkdir $builddir; fi if [ ! -d $builddir ] ; then mkdir $builddir; fi
pushd $builddir pushd $builddir
basedir=$PWD basedir=$PWD
# build the jemalloc library # build the jemalloc library
build_jemalloc $jemalloc $branch $revision $branchrevision build_jemalloc
# build the fractal tree tarball # build the fractal tree tarball
tokufractaltree=tokufractaltreeindex-$branchrevision tokufractaltree=tokufractaltreeindex-$tokudb_version
tokuportability=tokuportability-$branchrevision tokuportability=tokuportability-$tokudb_version
tokufractaltreedir=$tokufractaltree-$system-$arch tokufractaltreedir=$tokufractaltree-$system-$arch
build_fractal_tree build_fractal_tree
# build the mysql source tarball # build the mysql source tarball
mysqlversion=$(mysql_version $mysql) mysqldir=$mysql-tokudb-$tokudb_version-$system-$arch
mysqldir=$mysql-tokudb-$branchrevision-$system-$arch mysqlsrc=$mysql-tokudb-$tokudb_version
mysqlsrc=$mysql-tokudb-$branchrevision
build_mysql_src build_mysql_src
# build the mysql release tarball # build the mysql release tarball
...@@ -599,16 +596,15 @@ if [ $do_s3 != 0 ] ; then ...@@ -599,16 +596,15 @@ if [ $do_s3 != 0 ] ; then
exitcode=$? exitcode=$?
echo `date` s3put tokutek-mysql-build-date $d/$f $exitcode echo `date` s3put tokutek-mysql-build-date $d/$f $exitcode
done done
if [ $branch != '.' ] ; then if [ ! -z $git_tag ] ; then
branch=$(basename $branch) s3mkbucket tokutek-mysql-$git_tag
s3mkbucket tokutek-mysql-$branch
if [ $? = 0 ] ; then if [ $? = 0 ] ; then
files=$(ls $tokufractaltreedir.tar.gz* $mysqldir.tar.gz* $mysqlsrc.tar.gz* *.rpm*) files=$(ls $tokufractaltreedir.tar.gz* $mysqldir.tar.gz* $mysqlsrc.tar.gz* *.rpm*)
for f in $files; do for f in $files; do
echo `date` s3copykey $branch $f echo `date` s3copykey $git_tag $f
s3copykey tokutek-mysql-$branch $f tokutek-mysql-build $f s3copykey tokutek-mysql-$git_tag $f tokutek-mysql-build $f
exitcode=$? exitcode=$?
echo `date` s3copykey $branch $f $exitcode echo `date` s3copykey $git_tag $f $exitcode
done done
fi fi
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment