All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: use more fixed strings to build the hypervisor
@ 2014-11-18 16:26 Olaf Hering
  2014-11-18 16:36 ` Ian Jackson
  0 siblings, 1 reply; 4+ messages in thread
From: Olaf Hering @ 2014-11-18 16:26 UTC (permalink / raw
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, Ian Campbell, Tim Deegan, Ian Jackson,
	Jan Beulich

It is expected that repeated builds of identical sources results in
identical binaries on different hosts at different build times. This
fails for xen.gz and xen.efi because unstable strings are included in
the binaries.

In addition to existing variables use XEN_BUILD_DATE, XEN_BUILD_TIME and
XEN_BUILD_HOST to specify fixed strings during build.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
---
 xen/Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 72c1313..47f003c 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -8,6 +8,9 @@ export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 
 export XEN_WHOAMI	?= $(USER)
 export XEN_DOMAIN	?= $(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))
+export XEN_BUILD_DATE	?= $(shell LC_ALL=C date)
+export XEN_BUILD_TIME	?= $(shell LC_ALL=C date +%T)
+export XEN_BUILD_HOST	?= $(shell hostname)
 
 export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
@@ -126,11 +129,11 @@ delete-unfresh-files:
 
 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
 include/xen/compile.h: include/xen/compile.h.in .banner
-	@sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
-	    -e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
+	@sed -e 's/@@date@@/$(XEN_BUILD_DATE)/g' \
+	    -e 's/@@time@@/$(XEN_BUILD_TIME)/g' \
 	    -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
 	    -e 's/@@domain@@/$(XEN_DOMAIN)/g' \
-	    -e 's/@@hostname@@/$(shell hostname)/g' \
+	    -e 's/@@hostname@@/$(XEN_BUILD_HOST)/g' \
 	    -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) --version 2>&1 | head -1)!g' \
 	    -e 's/@@version@@/$(XEN_VERSION)/g' \
 	    -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \

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

* Re: [PATCH] xen: use more fixed strings to build the hypervisor
  2014-11-18 16:26 [PATCH] xen: use more fixed strings to build the hypervisor Olaf Hering
@ 2014-11-18 16:36 ` Ian Jackson
  2014-11-19  7:35   ` Olaf Hering
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Jackson @ 2014-11-18 16:36 UTC (permalink / raw
  To: Olaf Hering
  Cc: Keir Fraser, Ian Campbell, Ian Jackson, Tim Deegan, xen-devel,
	Jan Beulich

Olaf Hering writes ("[PATCH] xen: use more fixed strings to build the hypervisor"):
> It is expected that repeated builds of identical sources results in
> identical binaries on different hosts at different build times. This
> fails for xen.gz and xen.efi because unstable strings are included in
> the binaries.

I like the idea of making our builds more reproducible.  And your
patch looks correct (although I haven't tested it).

> In addition to existing variables use XEN_BUILD_DATE, XEN_BUILD_TIME and
> XEN_BUILD_HOST to specify fixed strings during build.

But your commit message is rather odd.

The first paragrah describes an expectation which as far as I can tell
is not fulfilled by your patch.  Your patch just makes it easier to
fulfil.

And the second paragraph seems to have an English grammar issue.  "Use
[blah] to specify fixed strings during build" means, when found in a
commit message "this commit uses [blah] to specify ...".  But your
commit doesn't.  It merely provides a facility for others to do so.

How about

   It should be possible to repeatedly build identical sources
   and get identical binaries, even on different hosts at different
   build times.  This fails [etc. etc. ...]

   Provide variables XEN_BUILD_DATE, XEN_BUILD_TIME and XEN_BUILD_HOST
   which the build environment can set to fixed strings to get a
   reproducible build.

or some such.

Ian.

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

* Re: [PATCH] xen: use more fixed strings to build the hypervisor
  2014-11-18 16:36 ` Ian Jackson
@ 2014-11-19  7:35   ` Olaf Hering
  2014-11-20 11:17     ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Olaf Hering @ 2014-11-19  7:35 UTC (permalink / raw
  To: Ian Jackson; +Cc: Tim Deegan, Keir Fraser, Ian Campbell, Jan Beulich, xen-devel

On Tue, Nov 18, Ian Jackson wrote:

> How about
> 
>    It should be possible to repeatedly build identical sources
>    and get identical binaries, even on different hosts at different
>    build times.  This fails [etc. etc. ...]
> 
>    Provide variables XEN_BUILD_DATE, XEN_BUILD_TIME and XEN_BUILD_HOST
>    which the build environment can set to fixed strings to get a
>    reproducible build.
> 
> or some such.

Thanks. Do you want me to resend with this updated changelog, or will it
be used while applying?

Olaf

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

* Re: [PATCH] xen: use more fixed strings to build the hypervisor
  2014-11-19  7:35   ` Olaf Hering
@ 2014-11-20 11:17     ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2014-11-20 11:17 UTC (permalink / raw
  To: Olaf Hering; +Cc: Keir Fraser, Tim Deegan, Ian Jackson, Ian Campbell, xen-devel

>>> On 19.11.14 at 08:35, <olaf@aepfle.de> wrote:
> On Tue, Nov 18, Ian Jackson wrote:
> 
>> How about
>> 
>>    It should be possible to repeatedly build identical sources
>>    and get identical binaries, even on different hosts at different
>>    build times.  This fails [etc. etc. ...]
>> 
>>    Provide variables XEN_BUILD_DATE, XEN_BUILD_TIME and XEN_BUILD_HOST
>>    which the build environment can set to fixed strings to get a
>>    reproducible build.
>> 
>> or some such.
> 
> Thanks. Do you want me to resend with this updated changelog, or will it
> be used while applying?

Please resend.

Thanks, Jan

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

end of thread, other threads:[~2014-11-20 11:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-18 16:26 [PATCH] xen: use more fixed strings to build the hypervisor Olaf Hering
2014-11-18 16:36 ` Ian Jackson
2014-11-19  7:35   ` Olaf Hering
2014-11-20 11:17     ` Jan Beulich

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.