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 on 2012-09-11

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 on 2012-09-11

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

Subscribers

People subscribed via source and target branches