Bug#861608: sbt: please make the build reproducible
Chris Lamb
lamby at debian.org
Mon May 1 12:46:50 UTC 2017
Source: sbt
Version: 0.13.13-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org
Hi,
Whilst working on the Reproducible Builds effort [0], we noticed
that sbt could not be built reproducibly.
Patch attached.
[0] https://reproducible-builds.org/
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
--- a/debian/patches/reproducible_build.patch 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible_build.patch 2017-05-01 13:31:44.909639506 +0100
@@ -0,0 +1,17 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2017-05-01
+
+--- sbt-0.13.13.orig/project/Util.scala
++++ sbt-0.13.13/project/Util.scala
+@@ -62,7 +62,9 @@ object Util {
+ import java.util.{ Date, TimeZone }
+ val formatter = new java.text.SimpleDateFormat("yyyyMMdd'T'HHmmss")
+ formatter.setTimeZone(TimeZone.getTimeZone("GMT"))
+- val timestamp = formatter.format(new Date)
++ var timestamp = formatter.format(new Date)
++ try { timestamp = formatter.format(new Date(sys.env("SOURCE_DATE_EPOCH").toLong * 1000L)) }
++ catch { case e: Exception => s.log.warn("Could not read SOURCE_DATE_EPOCH"); Nil }
+ val content = versionLine(version) + "\ntimestamp=" + timestamp
+ val f = dir / "xsbt.version.properties"
+ if (!f.exists || f.lastModified < lastCompilationTime(analysis) || !containsVersion(f, version)) {
--- a/debian/patches/series 2017-05-01 13:31:30.973574029 +0100
--- b/debian/patches/series 2017-05-01 13:31:44.909639506 +0100
@@ -4,3 +4,4 @@
#add-default-local-debian-resolver.patch
add-local-debian-maven-repo.patch
base-on-scala211.patch
+reproducible_build.patch
More information about the pkg-java-maintainers
mailing list