all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Reproducible build: linux-libre kernel
@ 2016-03-30 17:38 rain1
  2016-03-30 19:23 ` Mark H Weaver
  2016-03-30 21:25 ` Ludovic Courtès
  0 siblings, 2 replies; 10+ messages in thread
From: rain1 @ 2016-03-30 17:38 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 108 bytes --]

Thank you both for looking at the patch and the feedback!

I've put these suggestions into this new version.

[-- Attachment #2: 0001-gnu-linux-libre-Avoid-introducing-timestamps-into-th.patch --]
[-- Type: application/octet-stream, Size: 1538 bytes --]

From 0e10fd8e7790e584c96a42a4c38484316d30bcf7 Mon Sep 17 00:00:00 2001
From: rain1 <rain1@openmailbox.org>
Date: Wed, 30 Mar 2016 13:05:19 +0100
Subject: [PATCH] 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.
---
 gnu/packages/linux.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index fb2b671..1400110 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>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -223,6 +224,10 @@ 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)
+             ;; Avoid introducing timestamps
+             (setenv "KCONFIG_NOTIMESTAMP" "1")
+             (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
+             
              ;; Apply the neat patch.
              (system* "patch" "-p1" "--force"
                       "-i" (assoc-ref inputs "patch/freedo+gnu"))
-- 
2.7.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* Reproducible build: linux-libre kernel
@ 2016-03-30 12:16 rain1
  2016-03-30 15:56 ` Leo Famulari
  2016-03-30 16:42 ` Mark H Weaver
  0 siblings, 2 replies; 10+ messages in thread
From: rain1 @ 2016-03-30 12:16 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

Hello!

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! Would anyone like to test it and see if they do get 
the same build? (On x86_64)

/gnu/store/zbzs26xa68znnlgvgqchm4y7lxbnl4gg-linux-libre-det-4.5

Cheers.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-packages-linux.scm-Added-setenv-calls-to-tune-th.patch --]
[-- Type: text/x-diff; name=0001-gnu-packages-linux.scm-Added-setenv-calls-to-tune-th.patch, Size: 1457 bytes --]

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.

---
 gnu/packages/linux.scm | 7 +++++++
 1 file changed, 7 insertions(+)

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>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -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
+             (setenv "KCONFIG_NOTIMESTAMP" "1")
+             (setenv "KBUILD_BUILD_TIMESTAMP" "0")
+             (setenv "KBUILD_BUILD_USER" "guix")
+             (setenv "KBUILD_BUILD_HOST" "guix")
+             
              ;; Apply the neat patch.
              (system* "patch" "-p1" "--force"
                       "-i" (assoc-ref inputs "patch/freedo+gnu"))
-- 
2.7.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-03-31 21:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-30 17:38 Reproducible build: linux-libre kernel 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
  -- strict thread matches above, loose matches on Subject: below --
2016-03-30 12:16 rain1
2016-03-30 15:56 ` Leo Famulari
2016-03-30 16:42 ` Mark H Weaver

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.