Merge lp:~ignacio-nin/percona-server/5.1-binary-out-of-source into lp:percona-server/5.1

Proposed by Ignacio Nin
Status: Work in progress
Proposed branch: lp:~ignacio-nin/percona-server/5.1-binary-out-of-source
Merge into: lp:percona-server/5.1
Diff against target: 55 lines (+15/-7)
1 file modified
build/build-binary.sh (+15/-7)
To merge this branch: bzr merge lp:~ignacio-nin/percona-server/5.1-binary-out-of-source
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Needs Fixing
Laurynas Biveinis (community) Approve
Review via email: mp+126528@code.launchpad.net

This proposal supersedes a proposal from 2012-09-24.

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal

Perhaps "make clean" is not required then, is it?

review: Needs Information
Revision history for this message
Ignacio Nin (ignacio-nin) wrote : Posted in a previous version of this proposal

make clean is not required indeed, as the branch has been just exported. Resubmitting without it.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Using "bzr export" means it will be impossible to use build-binary.sh when the source directory is not a bazaar branch, e.g. has been unpacked from a source tarball.

I don't understand why we need that.

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

> Using "bzr export" means it will be impossible to use build-binary.sh when the
> source directory is not a bazaar branch, e.g. has been unpacked from a source
> tarball.

Indeed, however these scripts convenience scripts meant for using with the full branch when we're building the packages (or a sample), not for the exported source. For an exported source a standard configure/make procedure should be used (and only the Percona-Server/ subdirectory).

Please notice that bzr(1) and a .bzr/ directory was already a requirement for the script since we use bzr revno for adding the revision number to the binary name.

Revision history for this message
Stewart Smith (stewart) wrote :

Alexey Kopytov <email address hidden> writes:
> Using "bzr export" means it will be impossible to use build-binary.sh
> when the source directory is not a bazaar branch, e.g. has been
> unpacked from a source tarball.
>
> I don't understand why we need that.

I'm of the idea that we should actually produce source tarball and then
build from it... this would ensure that our source tarball can be used
to build every binary we ship....

Perhaps build-binary.sh needs to check for .bzr and if so, call a (newly
created) build-source-tarball.sh which is basically just bzr export?

--
Stewart Smith

Revision history for this message
Alexey Kopytov (akopytov) wrote :

As discussed on IRC, we can fix build scripts to work when the source is
from a tarball by adding a REVNO file to the top-level directory in
tarballs. So the build scripts can use it, if it is available and resort
to bzr if it is not (or creating a tarball first, then using it to
build).

Revision history for this message
Alexey Kopytov (akopytov) :
review: Needs Fixing

Unmerged revisions

482. 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.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build/build-binary.sh'
2--- build/build-binary.sh 2013-03-25 17:49:38 +0000
3+++ build/build-binary.sh 2013-04-19 15:30:42 +0000
4@@ -101,14 +101,20 @@
5 export MAKE_JFLAG=-j4
6
7 # Create a temporary working directory
8-INSTALLDIR="$(cd "$WORKDIR" && TMPDIR="$WORKDIR_ABS" mktemp -d percona-build.XXXXXX)"
9-INSTALLDIR="$WORKDIR_ABS/$INSTALLDIR" # Make it absolute
10+TEMPDIR="$(cd "$WORKDIR" && TMPDIR="$WORKDIR_ABS" mktemp -d percona-build.XXXXXX)"
11+TEMPDIR="$WORKDIR_ABS/$TEMPDIR" # Make it absolute
12+EXPORTDIR="$TEMPDIR/source"
13+INSTALLDIR="$TEMPDIR/install"
14
15 # Build
16 (
17 cd "$SOURCEDIR"
18
19- # Execute clean and download mysql, apply patches
20+ # Export a clean copy to the workdir
21+ bzr export "$EXPORTDIR/"
22+
23+ cd "$EXPORTDIR/"
24+ # Prepare source
25 make clean all
26
27 cd "$PRODUCT"
28@@ -137,8 +143,9 @@
29 (
30 cd "storage/HandlerSocket-Plugin-for-MySQL"
31 ./autogen.sh
32- CXX=${HS_CXX:-g++} ./configure --with-mysql-source="$SOURCEDIR/$PRODUCT" \
33- --with-mysql-bindir="$SOURCEDIR/$PRODUCT/scripts" \
34+ CXX=${HS_CXX:-g++} ./configure \
35+ --with-mysql-source="$EXPORTDIR/$PRODUCT" \
36+ --with-mysql-bindir="$EXPORTDIR/$PRODUCT/scripts" \
37 --with-mysql-plugindir="/usr/local/$PRODUCT_FULL/lib/mysql/plugin" \
38 --libdir="/usr/local/$PRODUCT_FULL/lib/mysql/plugin" \
39 --prefix="/usr/local/$PRODUCT_FULL"
40@@ -150,7 +157,8 @@
41 # Build UDF
42 (
43 cd "UDF"
44- CXX=${UDF_CXX:-g++} ./configure --includedir="$SOURCEDIR/$PRODUCT/include" \
45+ CXX=${UDF_CXX:-g++} ./configure \
46+ --includedir="$EXPORTDIR/$PRODUCT/include" \
47 --libdir="/usr/local/$PRODUCT_FULL/mysql/plugin"
48 make
49 make DESTDIR="$INSTALLDIR" install
50@@ -169,5 +177,5 @@
51 )
52
53 # Clean up
54-rm -rf "$INSTALLDIR"
55+rm -rf "$TEMPDIR"
56

Subscribers

People subscribed via source and target branches