diff mbox

[1/1] UBUNTU: reduce disk usage during buildd builds

Message ID 1285679905-29131-2-git-send-email-apw@canonical.com
State Accepted
Delegated to: Leann Ogasawara
Headers show

Commit Message

Andy Whitcroft Sept. 28, 2010, 1:18 p.m. UTC
BugLink: http://bugs.launchpad.net/bugs/645653

For each flavour build we keep all of intermediate trees intact.
This allows simple incremental updates in a development environment but
leads to very large disk footprints on the build.  For Maverick with three
flavours we are seeing 19GB for i386 and 25GB for amd64.  Anything over
15GB is likely to run the buildds out of disk and fail the build.

When building on a buildd (in full_build=true mode) clean out
the main build tree and the package tree for the debugging deb.
This reduces consumption to more like 10GB maximum regardless of
the flavour count.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 debian/rules.d/2-binary-arch.mk |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Comments

Stefan Bader Sept. 28, 2010, 1:57 p.m. UTC | #1
Yeah looks reasonable.

On 09/28/2010 03:18 PM, Andy Whitcroft wrote:
> BugLink: http://bugs.launchpad.net/bugs/645653
> 
> For each flavour build we keep all of intermediate trees intact.
> This allows simple incremental updates in a development environment but
> leads to very large disk footprints on the build.  For Maverick with three
> flavours we are seeing 19GB for i386 and 25GB for amd64.  Anything over
> 15GB is likely to run the buildds out of disk and fail the build.
> 
> When building on a buildd (in full_build=true mode) clean out
> the main build tree and the package tree for the debugging deb.
> This reduces consumption to more like 10GB maximum regardless of
> the flavour count.
> 
> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  debian/rules.d/2-binary-arch.mk |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index 1d26496..c66973d 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -267,6 +267,7 @@ endif
>  binary-%: pkgimg = $(bin_pkg_name)-$*
>  binary-%: pkghdr = $(hdrs_pkg_name)-$*
>  binary-%: dbgpkg = $(bin_pkg_name)-$*-dbgsym
> +binary-%: dbgpkgdir = $(CURDIR)/debian/$(bin_pkg_name)-$*-dbgsym
>  binary-%: install-%
>  	dh_testdir
>  	dh_testroot
> @@ -334,6 +335,12 @@ ifneq ($(skipdbg),true)
>  	# Now, the package wont get into the archive, but it will get put
>  	# into the debug system.
>  endif
> +ifneq ($(full_build),false)
> +	# Clean out this flavours build directory.
> +	rm -rf $(builddir)/build-$*
> +	# Clean out the debugging package source directory.
> +	rm -rf $(dbgpkgdir)
> +endif
>  
>  $(stampdir)/stamp-flavours:
>  	@echo $(flavours) > $@
diff mbox

Patch

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 1d26496..c66973d 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -267,6 +267,7 @@  endif
 binary-%: pkgimg = $(bin_pkg_name)-$*
 binary-%: pkghdr = $(hdrs_pkg_name)-$*
 binary-%: dbgpkg = $(bin_pkg_name)-$*-dbgsym
+binary-%: dbgpkgdir = $(CURDIR)/debian/$(bin_pkg_name)-$*-dbgsym
 binary-%: install-%
 	dh_testdir
 	dh_testroot
@@ -334,6 +335,12 @@  ifneq ($(skipdbg),true)
 	# Now, the package wont get into the archive, but it will get put
 	# into the debug system.
 endif
+ifneq ($(full_build),false)
+	# Clean out this flavours build directory.
+	rm -rf $(builddir)/build-$*
+	# Clean out the debugging package source directory.
+	rm -rf $(dbgpkgdir)
+endif
 
 $(stampdir)/stamp-flavours:
 	@echo $(flavours) > $@