[Pkg-erlang-commits] r1718 - in erlang/trunk/debian: . patches

sgolovan at alioth.debian.org sgolovan at alioth.debian.org
Mon Aug 17 11:40:30 UTC 2015


Author: sgolovan
Date: 2015-08-17 11:40:29 +0000 (Mon, 17 Aug 2015)
New Revision: 1718

Added:
   erlang/trunk/debian/patches/reproducible-build.patch
Modified:
   erlang/trunk/debian/changelog
   erlang/trunk/debian/patches/series
Log:
[erlang]
  * Added a patch from Chris Lamb which allows Erlang compiler to put
    a specified timestamp into the compiled binaries instead of the
    current time. This helps with reproducibility of Erlang binaries.


Modified: erlang/trunk/debian/changelog
===================================================================
--- erlang/trunk/debian/changelog	2015-08-04 08:18:16 UTC (rev 1717)
+++ erlang/trunk/debian/changelog	2015-08-17 11:40:29 UTC (rev 1718)
@@ -1,8 +1,10 @@
-erlang (1:18.0-dfsg-2) UNRELEASED; urgency=medium
+erlang (1:18.0-dfsg-2) unstable; urgency=medium
 
-  * NOT RELEASED YET
+  * Added a patch from Chris Lamb which allows Erlang compiler to put
+    a specified timestamp into the compiled binaries instead of the
+    current time. This helps with reproducibility of Erlang binaries.
 
- -- Sergei Golovan <sgolovan at debian.org>  Sat, 27 Jun 2015 14:57:59 +0300
+ -- Sergei Golovan <sgolovan at debian.org>  Mon, 17 Aug 2015 14:39:28 +0300
 
 erlang (1:18.0-dfsg-1) unstable; urgency=medium
 

Added: erlang/trunk/debian/patches/reproducible-build.patch
===================================================================
--- erlang/trunk/debian/patches/reproducible-build.patch	                        (rev 0)
+++ erlang/trunk/debian/patches/reproducible-build.patch	2015-08-17 11:40:29 UTC (rev 1718)
@@ -0,0 +1,23 @@
+Author: Chris Lamb <lamby at debian.org>
+Description: Patch makes erlang compiler honor the SOURCE_DATE_EPOCH
+ environment variable and use its value in build results instead of the
+ current timestamp. The goal is to maintain reproducible builds. More info:
+ https://wiki.debian.org/ReproducibleBuilds
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=795834
+Last-modified: Mon, 17 Aug 2015 14:32:15 +0300
+
+--- a/lib/compiler/src/beam_asm.erl
++++ b/lib/compiler/src/beam_asm.erl
+@@ -226,7 +226,11 @@
+ build_attributes(Opts, SourceFile, Attr, MD5) ->
+     Misc = case member(slim, Opts) of
+ 	       false ->
+-		   {{Y,Mo,D},{H,Mi,S}} = erlang:universaltime(),
++                  {{Y,Mo,D},{H,Mi,S}} = case string:to_integer(os:getenv("SOURCE_DATE_EPOCH")) of
++                       {N,[]} ->calendar:gregorian_seconds_to_datetime(N +
++			    calendar:datetime_to_gregorian_seconds({{1970,1,1},{0,0,0}}));
++                       {_,_} -> erlang:universaltime()
++                  end,
+ 		   [{time,{Y,Mo,D,H,Mi,S}},{source,SourceFile}];
+ 	       true -> []
+ 	   end,

Modified: erlang/trunk/debian/patches/series
===================================================================
--- erlang/trunk/debian/patches/series	2015-08-04 08:18:16 UTC (rev 1717)
+++ erlang/trunk/debian/patches/series	2015-08-17 11:40:29 UTC (rev 1718)
@@ -9,3 +9,4 @@
 javascript.patch
 wx3.0-constants.patch
 beamload.patch
+reproducible-build.patch




More information about the Pkg-erlang-commits mailing list