all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: rain1@openmailbox.org
Cc: guix-devel@gnu.org
Subject: Re: Reproducible build: linux-libre kernel
Date: Wed, 30 Mar 2016 12:42:14 -0400	[thread overview]
Message-ID: <871t6r3ok9.fsf@netris.org> (raw)
In-Reply-To: <0d3d04dd006e640ed0fd201e6ec73fb1@openmailbox.org> (rain1@openmailbox.org's message of "Wed, 30 Mar 2016 13:16:13 +0100")

rain1@openmailbox.org writes:

> I noticed that the linux-libre package we have is not a reproducible
> build using the command: guix build linux-libre --check
> --no-substitutes
>
> I did a bit of research into this these posts and blogs were helpful,
> as well as the mempo project:
> * <https://lwn.net/Articles/437864/>
> * <https://abraithwaite.net/2014/08/11/deterministic-kernel-builds/>
> *
> <https://github.com/rfree/mempo-kernel/blob/master/kernel-build/linux-mempo/build.sh#L95>
>
> So I've added these tweaks, performed the build twice and it seems to
> be reproducible now!

That's great news, thank you!  Please see below for comments.

> From 713017b65c9d5a03dcf709bb231113d2152558e1 Mon Sep 17 00:00:00 2001
> From: rain1 <rain1@openmailbox.org>
> Date: Wed, 30 Mar 2016 13:05:19 +0100
> Subject: [PATCH] * gnu/packages/linux.scm: Added setenv calls to tune the
>  build towards reproducibility.

Your commit message is missing the initial summary line, and needs some
other changes as well to conform with our conventions.

Also, it turns out that our build container already ensures that the
build user and host are deterministic, so the timestamps were the only
issue.

So, how about something like this for the commit message:

--8<---------------cut here---------------start------------->8---
gnu: linux-libre: Avoid introducing timestamps into the build.

* gnu/packages/linux.scm (linux-libre)[build-phase]: Set the
KCONFIG_NOTIMESTAMP and KBUILD_BUILD_TIMESTAMP environment variables to
avoid introducing timestamps into the build outputs.
--8<---------------cut here---------------end--------------->8---

> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index fb2b671..34403ae 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -9,6 +9,7 @@
>  ;;; Copyright ?? 2016 Christopher Allan Webber <cwebber@dustycloud.org>
>  ;;; Copyright ?? 2016 Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>
>  ;;; Copyright ?? 2016 Alex Kost <alezost@gmail.com>
> +;;; Copyright ?? 2016 Raymond Nicholson <rain1@openmailbox.org>

Your mail client doesn't seem to realize that this patch uses the UTF-8
encoding, so it's not including a header saying so, and the non-ASCII
copyright symbols are getting munged into two separate bytes.  When
trying to reply, my mail client is complaining about them.

> @@ -223,6 +224,12 @@ for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
>    (let* ((version "4.5")
>           (build-phase
>            '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
> +             ;; Tuning for a reproducible build

How about changing the comment to:

                ;; Avoid introducing timestamps
> +             (setenv "KCONFIG_NOTIMESTAMP" "1")
> +             (setenv "KBUILD_BUILD_TIMESTAMP" "0")

Also, Leo's suggestion to use SOURCE_DATE_EPOCH is a good one.

The following two settings can be dropped.

> +             (setenv "KBUILD_BUILD_USER" "guix")
> +             (setenv "KBUILD_BUILD_HOST" "guix")

What do you think?  Can you send an updated patch?

    Thank you!
       Mark

  parent reply	other threads:[~2016-03-30 16:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30 12:16 Reproducible build: linux-libre kernel rain1
2016-03-30 15:56 ` Leo Famulari
2016-03-30 16:42 ` Mark H Weaver [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-03-30 17:38 rain1
2016-03-30 19:23 ` Mark H Weaver
2016-03-30 21:25 ` Ludovic Courtès
2016-03-30 22:58   ` Leo Famulari
2016-03-31  8:26     ` Ludovic Courtès
2016-03-31 19:08       ` Leo Famulari
2016-03-31 21:26         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871t6r3ok9.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=guix-devel@gnu.org \
    --cc=rain1@openmailbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.