Source: myghty
Version: 1.1-6
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps randomness
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], I noticed
that myghty could not be built reproducibly.

 - Use gmtime over localtime

 - Don't create objects in the kwargs - they end up in the documentation
   and then their repr(…) includes a non-deterministic memory address.

Patch attached.


 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build.diff    1970-01-01 01:00:00.000000000 
+0100
--- b/debian/patches/reproducible-build.diff    2016-08-27 20:56:56.242293448 
+0100
@@ -0,0 +1,35 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2016-08-27
+
+--- myghty-1.1.orig/doc/components/section_wrapper.myt
++++ myghty-1.1/doc/components/section_wrapper.myt
+@@ -28,7 +28,7 @@
+ 
+ <div class="docheadertext" ><% title %></div>
+ % if version is not None:
+-<div class="">Version: <% version %>   Last Updated: <% time.strftime('%x 
%X', time.localtime(last_updated)) %></div>
++<div class="">Version: <% version %>   Last Updated: <% time.strftime('%x 
%X', time.gmtime(last_updated)) %></div>
+ %
+ </div>
+ 
+--- myghty-1.1.orig/lib/myghty/interp.py
++++ myghty-1.1/lib/myghty/interp.py
+@@ -45,7 +45,7 @@ class Interpreter:
+             code_cache_size = 16777216,
+             use_auto_handlers = True,
+             use_object_files = True,
+-            debug_file = myghty.buffer.LinePrinter(sys.stderr),
++            debug_file = None,
+             debug_threads = False,
+             debug_elements = [],
+             escapes = {},
+@@ -56,6 +56,8 @@ class Interpreter:
+         method as keyword parameters.  Those parameters that are used 
directly by this Interpreter are
+         consumed.  Remaining arguments are sent off to other constructed 
objects, which include a
+         Compiler, a Resolver, and a Request prototype object."""
++        if debug_file is None:
++            bug_file = myghty.buffer.LinePrinter(sys.stderr)
+         self.global_args = global_args or {}
+         self._attributes = {}
+         if attributes is not None:
--- a/debian/patches/series     2016-08-27 20:37:27.453627497 +0100
--- b/debian/patches/series     2016-08-27 20:40:34.531708742 +0100
@@ -1 +1,2 @@
 import-5th-arg.diff
+reproducible-build.diff
_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to