Merge lp:~ignacio-nin/percona-server/percona-server-5.5 into lp:percona-server/5.5

Proposed by Ignacio Nin
Status: Rejected
Rejected by: Ignacio Nin
Proposed branch: lp:~ignacio-nin/percona-server/percona-server-5.5
Merge into: lp:percona-server/5.5
Diff against target: 186 lines (+180/-0) (has conflicts)
1 file modified
build/build-binary.sh (+180/-0)
Conflict adding files to build.  Created directory.
Conflict because build is not versioned, but has versioned children.  Versioned directory.
Conflict adding file build.  Moved existing file to build.moved.
To merge this branch: bzr merge lp:~ignacio-nin/percona-server/percona-server-5.5
Reviewer Review Type Date Requested Status
Stewart Smith (community) Needs Fixing
Review via email: mp+124960@code.launchpad.net

Description of the change

Add a --debug parameter to the binary builder.

Out-of-source binary build.

To post a comment you must log in.
Revision history for this message
Stewart Smith (stewart) wrote :

Please redo on top of trunk... build/ (and most of files under it) have same file-ids as 5.1, so this is why there's conflicts here.

review: Needs Fixing
Revision history for this message
Ignacio Nin (ignacio-nin) wrote :

Unmerged revisions

299. By Ignacio Nin

Build out of source (binary builder)

Instead of building in the source for the binary builder, export to
another directory and build there.

298. By Ignacio Nin

Add a --debug flag to the binary builder

Add a --debug flag that will create a build with the debug-enabled
binaries. Also add -debug to the binary tarball and directory, as well
as the comment, in case it is a debug build.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'build'
=== renamed directory 'build' => 'build.moved'
=== added file 'build/build-binary.sh'
--- build/build-binary.sh 1970-01-01 00:00:00 +0000
+++ build/build-binary.sh 2012-09-18 15:43:36 +0000
@@ -0,0 +1,180 @@
1#!/bin/sh
2#
3# Execute this tool to setup the environment and build binary releases
4# for Percona-Server starting from a fresh tree.
5#
6# Usage: build-binary.sh [target dir]
7# The default target directory is the current directory. If it is not
8# supplied and the current directory is not empty, it will issue an error in
9# order to avoid polluting the current directory after a test run.
10#
11
12# Bail out on errors, be strict
13set -ue
14
15# Examine parameters
16TARGET="$(uname -m)"
17TARGET_CFLAGS=''
18QUIET='VERBOSE=1'
19CMAKE_BUILD_TYPE='RelWithDebInfo'
20DEBUG_COMMENT=''
21
22# Some programs that may be overriden
23TAR=${TAR:-tar}
24
25# Check if we have a functional getopt(1)
26if ! getopt --test
27then
28 go_out="$(getopt --options="iqd" --longoptions=i686,quiet,debug \
29 --name="$(basename "$0")" -- "$@")"
30 test $? -eq 0 || exit 1
31 eval set -- $go_out
32fi
33
34for arg
35do
36 case "$arg" in
37 -- ) shift; break;;
38 -i | --i686 )
39 shift
40 TARGET="i686"
41 TARGET_CFLAGS="-m32 -march=i686"
42 ;;
43 -d | --debug )
44 shift
45 CMAKE_BUILD_TYPE='Debug'
46 DEBUG_COMMENT='-debug'
47 ;;
48 -q | --quiet )
49 shift
50 QUIET=''
51 ;;
52 esac
53done
54
55# Working directory
56if test "$#" -eq 0
57then
58 WORKDIR="$(pwd)"
59
60 # Check that the current directory is not empty
61 if test "x$(echo *)" != "x*"
62 then
63 echo >&2 \
64 "Current directory is not empty. Use $0 . to force build in ."
65 exit 1
66 fi
67
68elif test "$#" -eq 1
69then
70 WORKDIR="$1"
71
72 # Check that the provided directory exists and is a directory
73 if ! test -d "$WORKDIR"
74 then
75 echo >&2 "$WORKDIR is not a directory"
76 exit 1
77 fi
78
79else
80 echo >&2 "Usage: $0 [target dir]"
81 exit 1
82
83fi
84
85WORKDIR_ABS="$(cd "$WORKDIR"; pwd)"
86
87SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)"
88test -e "$SOURCEDIR/Makefile" || exit 2
89
90# Extract version from the Makefile
91MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \
92 | cut -d = -f 2)"
93PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \
94 "$SOURCEDIR/Makefile" | cut -d = -f 2)"
95PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
96
97# Build information
98REVISION="$(cd "$SOURCEDIR"; bzr log -r-1 | grep ^revno: | cut -d ' ' -f 2)"
99PRODUCT_FULL="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
100PRODUCT_FULL="$PRODUCT_FULL-$REVISION$DEBUG_COMMENT.$(uname -s).$TARGET"
101COMMENT="Percona Server with XtraDB (GPL), Release $PERCONA_SERVER_VERSION"
102COMMENT="$COMMENT, Revision $REVISION$DEBUG_COMMENT"
103
104# Compilation flags
105export CC=${CC:-gcc}
106export CXX=${CXX:-gcc}
107export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CFLAGS:-}"
108export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CXXFLAGS:-}"
109export MAKE_JFLAG=-j4
110
111# Create a temporary working directory
112TEMPDIR="$(cd "$WORKDIR" && TMPDIR="$WORKDIR_ABS" mktemp -d percona-build.XXXXXX)"
113TEMPDIR="$WORKDIR_ABS/$TEMPDIR" # Make it absolute
114EXPORTDIR="$TEMPDIR/source"
115INSTALLDIR="$TEMPDIR/install"
116
117# Build
118(
119 cd "$SOURCEDIR"
120
121 # Export a clean copy to the workdir
122 bzr export "$EXPORTDIR/"
123
124 cd "$EXPORTDIR/"
125 # Prepare source
126 make clean all
127
128 cd "$PRODUCT"
129 cmake . -DBUILD_CONFIG=mysql_release \
130 -DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
131 -DWITH_EMBEDDED_SERVER=OFF \
132 -DFEATURE_SET=community \
133 -DCMAKE_INSTALL_PREFIX="/usr/local/$PRODUCT_FULL" \
134 -DMYSQL_DATADIR="/usr/local/$PRODUCT_FULL/data" \
135 -DMYSQL_SERVER_SUFFIX="-$PERCONA_SERVER_VERSION" \
136 -DCOMPILATION_COMMENT="$COMMENT"
137
138 make $MAKE_JFLAG $QUIET
139 make DESTDIR="$INSTALLDIR" install
140
141 # Build HandlerSocket
142 (
143 cd "storage/HandlerSocket-Plugin-for-MySQL"
144 ./autogen.sh
145 CXX=${HS_CXX:-g++} ./configure \
146 --with-mysql-source="$EXPORTDIR/$PRODUCT" \
147 --with-mysql-bindir="$EXPORTDIR/$PRODUCT/scripts" \
148 --with-mysql-plugindir="/usr/local/$PRODUCT_FULL/lib/mysql/plugin" \
149 --libdir="/usr/local/$PRODUCT_FULL/lib/mysql/plugin" \
150 --prefix="/usr/local/$PRODUCT_FULL"
151 make
152 make DESTDIR="$INSTALLDIR" install
153
154 )
155
156 # Build UDF
157 (
158 cd "UDF"
159 CXX=${UDF_CXX:-g++} ./configure \
160 --includedir="$EXPORTDIR/$PRODUCT/include" \
161 --libdir="/usr/local/$PRODUCT_FULL/mysql/plugin"
162 make
163 make DESTDIR="$INSTALLDIR" install
164
165 )
166
167)
168
169# Package the archive
170(
171 cd "$INSTALLDIR/usr/local/"
172
173 $TAR czf "$WORKDIR_ABS/$PRODUCT_FULL.tar.gz" \
174 --owner=0 --group=0 "$PRODUCT_FULL/"
175
176)
177
178# Clean up
179rm -rf "$TEMPDIR"
180

Subscribers

People subscribed via source and target branches