Building pg_xlogdump reproducibly - Mailing list pgsql-hackers

From Christoph Berg
Subject Building pg_xlogdump reproducibly
Date
Msg-id 20160104145945.GD17503@dg-i.net
Whole thread Raw
Responses Re: Building pg_xlogdump reproducibly  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
The list of objects used to link pg_xlogdump is coming from
$(wildcard *desc.c) which returns them in filesystem order. This makes
the build result depend on this ordering, yielding different
compilation results.

This patch fixes the reproducibility issue:

--- a/src/bin/pg_xlogdump/Makefile
+++ b/src/bin/pg_xlogdump/Makefile
@@ -12,7 +12,7 @@ OBJS = pg_xlogdump.o compat.o xlogreaderoverride CPPFLAGS := -DFRONTEND $(CPPFLAGS)
-RMGRDESCSOURCES = $(notdir $(wildcard $(top_srcdir)/src/backend/access/rmgrdesc/*desc.c))
+RMGRDESCSOURCES = $(sort $(notdir $(wildcard $(top_srcdir)/src/backend/access/rmgrdesc/*desc.c)))RMGRDESCOBJS =
$(patsubst%.c,%.o,$(RMGRDESCSOURCES))
 

Spotted by Debian's reproducible builds project:
https://wiki.debian.org/ReproducibleBuilds
https://reproducible-builds.org/

Christoph



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [PATCH] Refactoring of LWLock tranches
Next
From: Stephen Frost
Date:
Subject: Re: Rationalizing Query.withCheckOptions