[Reproducible-builds] Patches for sbuild reproducible builds

Vagrant Cascadian vagrant at debian.org
Sat Feb 14 08:24:58 UTC 2015


Prompted by the announcement of reproducible builds status, I took a
look at a few of my packages and started testing with sbuild... which
apparently needs a few patches to get reproducible builds working...

I've got a couple brief proof-of-concept patches.

One patch sets the build dir to a static location based on the package
version, rather than a tempdir with a random string.

The other patch ignores .buildinfo files in the .changes when displaying
package contents. Without it, the build status gets set to "attempted"
and is treated as a failed build:

  dpkg-deb: error: `/«CHROOT»/«BUILDDIR»/ltsp_5.5.4-4~20150213~1_amd64.buildinfo' is not a debian format archive

Both patches can surely be improved upon.


commit 8468411099b8ec28641df015742784b63b98b573
Author: Vagrant Cascadian <vagrant at debian.org>
Date:   Fri Feb 13 23:51:11 2015 -0800

    Ignore .buildinfo files produced by reproducible builds.

diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index 5149a8a..f15e94a 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -1768,6 +1768,8 @@ sub build {
 	foreach (@debcfiles) {
 	    my $deb = "$build_dir/$_";
 	    next if $deb !~ /(\Q$host_arch\E|all)\.[\w\d.-]*$/;
+	    # ignore .buildinfo files produced by reproducible builds.
+    	    next if $deb =~ /\.*buildinfo$/;
 
 	    $self->log_subsubsection("$_");
 	    if (!open( PIPE, "dpkg --info $deb 2>&1 |" )) {

commit 15b77405a67faaea7bc3974a4e7a3862620d0b42
Author: Vagrant Cascadian <vagrant at debian.org>
Date:   Fri Feb 13 23:18:23 2015 -0800

    Make predictible build dir location based on the package version.

diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index 155e4fc..5149a8a 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -396,8 +396,8 @@ sub run_chroot_session {
 	# TODO: Don't hack the build location in; add a means to customise
 	# the chroot directly.  i.e. allow changing of /build location.
 	$self->set('Chroot Build Dir',
-		   tempdir($self->get('Package') . '-XXXXXX',
-			   DIR =>  $session->get('Location') . "/build"));
+		   $session->get('Location') . "/build/" . $self->get('Package') . "-" . $self->get('Version'));
+	mkdir $self->get('Chroot Build Dir');
 
 	$self->set('Build Dir', $session->strip_chroot_path($self->get('Chroot Build Dir')));
 

Thanks for your work towards reproducibility!

live well,
  vagrant

p.s. not (yet) subscribed to list, so if you need me to respond, please
CC me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20150214/01d295cf/attachment.sig>


More information about the Reproducible-builds mailing list