Skip to contentSkip to conversation

xen: use more fixed strings to build the hypervisor

PATCH Superseded Olaf Hering 3 participants 4 messages Nov 18, 2014 – Nov 20, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

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

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Keir Fraser <[email protected]>
Cc Tim Deegan <[email protected]>
---
 xen/Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
xen/Makefile +6 -3
index 72c1313..47f003c 100644
@@ -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' \
#1 lore raw

Olaf Hering writes ("[PATCH] xen: use more fixed strings to build the hypervisor"):

Quoted 4 lines

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).

Quoted 2 lines

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.

#2 lore raw
Quoted 11 lines · Ian Jackson

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

#3 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 19.11.14 at 08:35, <[email protected]> wrote:
Quoted 6 lines · Ian Jackson

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. ...]

Quoted 8 lines
Quoted 5 lines

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