summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2023-07-31 20:09:15 +0200
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2024-01-21 13:14:23 -0500
commitecab1530e4cf1064d41833276c50bacf9ea5c9f5 (patch)
tree5e6c4b39d2186e82f251b0877f42cec6052e1765
parent8efaf0e6be809f9304c62be23eb752f8fa6e2a2f (diff)
gnu: openjdk11: Make more reproducible.
* gnu/packages/java.scm (openjdk11)[source]: Add patch. [arguments]<#:phases>[remove-timestamping]: Add phase. * gnu/packages/patches/openjdk-11-classlist-reproducibility.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Change-Id: I67f1b7746a2c7016aec32c438b94d24a16bc77b2
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/java.scm21
-rw-r--r--gnu/packages/patches/openjdk-11-classlist-reproducibility.patch11
3 files changed, 30 insertions, 3 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 6697d5f25f..cacac57cf8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1781,6 +1781,7 @@ dist_patch_DATA = \
%D%/packages/patches/openjdk-10-module4-reproducibility.patch \
%D%/packages/patches/openjdk-10-pointer-comparison.patch \
%D%/packages/patches/openjdk-10-setsignalhandler.patch \
+ %D%/packages/patches/openjdk-11-classlist-reproducibility.patch \
%D%/packages/patches/openjdk-15-xcursor-no-dynamic.patch \
%D%/packages/patches/openjdk-21-fix-rpath.patch \
%D%/packages/patches/openmpi-mtl-priorities.patch \
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index d78b8a09d5..9aa316d7e8 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1300,8 +1300,14 @@ new Date();"))
(modules '((guix build utils)))
(snippet
'(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
- (patches (search-patches
- "openjdk-currency-time-bomb2.patch"))))
+ (patches
+ (search-patches "openjdk-10-module3-reproducibility.patch"
+ "openjdk-10-module4-reproducibility.patch"
+ "openjdk-10-char-reproducibility.patch"
+ "openjdk-11-classlist-reproducibility.patch"
+ "openjdk-10-jar-reproducibility.patch"
+ "openjdk-10-jtask-reproducibility.patch"
+ "openjdk-currency-time-bomb2.patch"))))
(build-system gnu-build-system)
(outputs '("out" "jdk" "doc"))
(arguments
@@ -1335,6 +1341,10 @@ new Date();"))
"--with-libjpeg=system"
"--with-libpng=system"
"--with-version-pre="
+ ;; Should be set by SOURCE_DATE_EPOCH handler, but isn't being
+ ;; set; do it manually.
+ "--with-hotspot-build-time=1970-01-01T00:00:01"
+ "--enable-reproducible-build" ; to be sure
;; Allow the build system to locate the system freetype.
(string-append "--with-freetype-include="
#$(this-package-input "freetype") "/include")
@@ -1348,6 +1358,11 @@ new Date();"))
;; this exact first line.
(substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
(("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
+ (add-after 'unpack 'remove-timestamping
+ (lambda _
+ (substitute* "src/hotspot/share/runtime/abstract_vm_version.cpp"
+ (("__DATE__") "")
+ (("__TIME__") ""))))
(add-after 'unpack 'patch-jni-libs
;; Hardcode dynamically loaded libraries.
(lambda _
@@ -1548,7 +1563,7 @@ new Date();"))
libxtst))
(native-inputs
(list autoconf
- bash ; not bash-minimal, needs ulimit
+ bash ; not bash-minimal, needs ulimit
openjdk10
`(,openjdk10 "jdk")
gnu-make-4.2
diff --git a/gnu/packages/patches/openjdk-11-classlist-reproducibility.patch b/gnu/packages/patches/openjdk-11-classlist-reproducibility.patch
new file mode 100644
index 0000000000..2ac7c2b664
--- /dev/null
+++ b/gnu/packages/patches/openjdk-11-classlist-reproducibility.patch
@@ -0,0 +1,11 @@
+--- jdk-11.0.13-ga/make/GenerateLinkOptData.gmk.orig 2022-04-04 17:18:56.801929954 +0200
++++ jdk-11.0.13-ga/make/GenerateLinkOptData.gmk 2022-04-04 17:19:14.962422622 +0200
+@@ -66,7 +66,7 @@
+ -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
+ build.tools.classlist.HelloClasslist \
+ $(LOG_DEBUG) 2>&1 > $(JLI_TRACE_FILE)
+- $(GREP) -v HelloClasslist $@.raw > $@
++ $(GREP) -v HelloClasslist $@.raw |sort > $@
+
+ # The jli trace is created by the same recipe as classlist. By declaring these
+ # dependencies, make will correctly rebuild both jli trace and classlist