Your message dated Wed, 23 Mar 2016 21:51:55 +0000
with message-id <[email protected]>
and subject line Bug#818128: fixed in nethack 3.6.0-2
has caused the Debian Bug report #818128,
regarding nethack: please make the build reproducible
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
818128: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818128
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: nethack
Version: 3.6.0-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: timestamps locale cpu
X-Debbugs-Cc: [email protected]

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that nethack could not be built reproducibly.

There are three issues that prevent building it reproducibly:
- the nhdat file is not reproducible, because the order of archive
  members varies depending on the locale. Setting LC_ALL to C expands
  the files in DATDLB always in the same way.
- makedefs uses the current date/time for the build date that gets
  embedded. By using $SOURCE_DATE_EPOCH, the date from the latest
  changelog entry is used instead.
- parallel building causes that src/objects.o and src/monst.o are build
  either from within src/ or from util/ (as those files are used by
  nethack and by makedefs), which results in a different build path
  embedded into the binary. This is solved by building makedefs
  explicitely before nethack.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/patches/0025-reproducible-build.patch b/debian/patches/0025-reproducible-build.patch
new file mode 100644
index 0000000..50f959f
--- /dev/null
+++ b/debian/patches/0025-reproducible-build.patch
@@ -0,0 +1,50 @@
+Author: Reiner Herrmann <[email protected]>
+Description: enable reproducible building
+ - set LC_ALL to C so the shell sorts files in DATDLB after
+   wildcard expansion independent of the configured locale
+ - read timestamp for the build date from environment.
+   https://reproducible-builds.org/specs/source-date-epoch/
+
+--- a/sys/unix/Makefile.top
++++ b/sys/unix/Makefile.top
+@@ -186,7 +186,7 @@
+ 
+ dlb:
+ 	( cd util ; $(MAKE) dlb )
+-	( cd dat ; ../util/dlb cf nhdat $(DATDLB) )
++	( cd dat ; LC_ALL=C ; ../util/dlb cf nhdat $(DATDLB) )
+ 
+ # recover can be used when INSURANCE is defined in include/config.h
+ # and the checkpoint option is true
+--- a/util/makedefs.c
++++ b/util/makedefs.c
+@@ -1222,7 +1222,7 @@
+ #else
+     time_t clocktim = 0;
+ #endif
+-    char *c, cbuf[60], buf[BUFSZ];
++    char *c, cbuf[60], buf[BUFSZ], *source_date_epoch;
+     const char *ul_sfx;
+ 
+     /* before creating date.h, make sure that xxx_GRAPHICS and
+@@ -1244,7 +1244,10 @@
+     Fprintf(ofp, "%s", Dont_Edit_Code);
+ 
+     (void) time(&clocktim);
+-    Strcpy(cbuf, ctime(&clocktim));
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch)
++        clocktim = strtoull(source_date_epoch, NULL, 10);
++    Strcpy(cbuf, asctime(gmtime(&clocktim)));
+ 
+     for (c = cbuf; *c; c++)
+         if (*c == '\n')
+@@ -1281,7 +1284,7 @@
+     Fprintf(ofp, "\n");
+ #ifdef AMIGA
+     {
+-        struct tm *tm = localtime((time_t *) &clocktim);
++        struct tm *tm = asctime(gmtime((time_t *) &clocktim));
+         Fprintf(ofp, "#define AMIGA_VERSION_STRING ");
+         Fprintf(ofp, "\"\\0$VER: NetHack %d.%d.%d (%d.%d.%d)\"\n",
+                 VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, tm->tm_mday,
diff --git a/debian/patches/series b/debian/patches/series
index ea58e42..4a93708 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -14,3 +14,4 @@
 0021-fix-kfreebsd-ftbfs.patch
 0023-gcc-warning-fixes.patch
 0024-lisp-3.6.patch
+0025-reproducible-build.patch
diff --git a/debian/rules b/debian/rules
index 18f4b05..b7251c2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -30,6 +30,7 @@ define build_target
 	$(MAKE) clean
 	touch include/config.h
 	sleep 2
+	$(MAKE) LFLAGS='$(LFLAGS)' CFLAGS='$(CFLAGS)' LINK='$$(CC)' -C util makedefs
 	$(MAKE) LFLAGS='$(LFLAGS)' CFLAGS='$(CFLAGS) $(EXTRACPP_$1)' \
 		WINSRC='$(SRC_$1)' WINOBJ='$(OBJ_$1)' WINLIB='$(LIB_$1)' \
 		LINK='$$(CC)' $(EXTRA_$1) GAME='nethack-$1' \

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: nethack
Source-Version: 3.6.0-2

We believe that the bug you reported is fixed in the latest version of
nethack, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
James Cowgill <[email protected]> (supplier of updated nethack package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 21 Mar 2016 14:51:35 +0000
Source: nethack
Binary: nethack-common nethack-console nethack-lisp nethack-x11
Architecture: source
Version: 3.6.0-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Games Team <[email protected]>
Changed-By: James Cowgill <[email protected]>
Description:
 nethack-common - dungeon crawl game - common files
 nethack-console - dungeon crawl game - text-based interface
 nethack-lisp - dungeon crawl game - Lisp interface
 nethack-x11 - dungeon crawl game - X11 interface
Closes: 817972 818051 818128
Changes:
 nethack (3.6.0-2) unstable; urgency=medium
 .
   [ James Cowgill ]
   * Remove more remnants of the curses interface from d/rules.
   * Remove obsolete $(EXTRA_$1) argument from d/rules.
   * Install symbols data file. (Closes: #817972)
   * Add semicolon to the end of lists in the desktop files to fix validation
     errors.
   * Add StartupWMClass to nethack-x11.desktop to fix grouping in some DEs.
 .
   [ Reiner Herrmann ]
   * Add patch to enable reproducible building. (Closes: #818128)
   * Manually build makedefs before the rest of the game to avoid a race
     confition in the build system.
 .
   [ Mo Jun ]
   * Fix abnormal behavior in the HP monitor patch. (Closes: #818051)
Checksums-Sha1:
 f07e9a35b5bd4f2551470d365773ef786d503aab 2286 nethack_3.6.0-2.dsc
 c2c1d6b35bd15f768d9a904e23a2508e1c40666a 68432 nethack_3.6.0-2.debian.tar.xz
Checksums-Sha256:
 e586f82e6fb37e526f161d51068e0cffeec7c7f026c34b676504d3cee91289f2 2286 
nethack_3.6.0-2.dsc
 45ee3e36dc4560e8f4ec2dbeb9c3e485074ab3cb5492fbb680480b4d52f8bcae 68432 
nethack_3.6.0-2.debian.tar.xz
Files:
 1d3d404a8c009544cb690fdf96d7720b 2286 games optional nethack_3.6.0-2.dsc
 027ecd1ef61d30a51c1dc236716eb8dc 68432 games optional 
nethack_3.6.0-2.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJW8v93AAoJEMfxZ23qLQHv1gEQAK4zrQ3bZQ7DFlcHJx3uH8MK
1eAZMHSXxdUw8xJ5AATuAgmO5Q9XKrPfqUYkv/CqUXGYm6QGdnKxspDrGSSW4XdJ
uviB7rgjks5GoI/NzKClmkiKhMyQZvhz7dmfKBOmgIUhpWkZ3MFIAkiWiFeEm+W8
qwv7NwO+BpQDpULUcKi8HVa1p9pNodhArpYKecuQCplhQVBUupgFnp7lqp/OSDcG
a18oXpPWMzXi6CCAVX6wRL92HxUjvtfhgMN9N05bn31si81GPsGucK1rA9K/1KG0
2YHBonRpqhW9Ah7DF48VnR1tOyAkk7QvReucZa2s2kGJ2PKCmzDKy1MfPsX9FQ/K
hmPvv7jIHgwUgOYJjGDQRDjtH/GAMGFtyAFF7AXhk3EMaOp2eGJXOG0aFvTCSOpD
Ywo0/OLdryo1tzmpPN4DG/StJJydOj/Kar3d3FNquKtFZ/Yt0oWx78s4WvurXNm2
FO+cw+RUIfvvTY4tLkax5EEzSexKtM1j2gX/v+/pke/VuUdirvFNMEGXhGabYcit
SSll7Hv6PzLfmvYYsGBKJUPYoRvbDcrilWCgeb7fbbIYifDX6n2VIBg+XupwEBEx
p1lfpJGT1b0aGB1nCJcsuYayjJGN47c6SZ+errsN+LI77fsPKjbxpCR6yhbtI6Wo
yOmvzyyS5MYKZkQJo9xD
=yfZj
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to