Accepting request 1179189 from Java:Factory

reproducible jlink for reproducible jmods

OBS-URL: https://build.opensuse.org/request/show/1179189
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/java-22-openjdk?expand=0&rev=3
This commit is contained in:
Ana Guerrero 2024-06-09 18:20:21 +00:00 committed by Git OBS Bridge
commit 8b2248aabb
3 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jun 7 11:24:30 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* reproducible-jlink.patch
+ make the timestamp in jmods reproducible
-------------------------------------------------------------------
Thu Apr 18 14:57:53 UTC 2024 - Fridrich Strba <fstrba@suse.com>

View File

@ -158,6 +158,7 @@ Patch8: zero-ranges.patch
# From icedtea: Increase default memory limits
Patch10: memory-limits.patch
Patch11: reproducible-properties.patch
Patch12: reproducible-jlink.patch
# Fix: implicit-pointer-decl
Patch13: implicit-pointer-decl.patch
Patch15: system-pcsclite.patch
@ -388,6 +389,7 @@ rm -rvf src/java.desktop/share/native/liblcms/lcms2*
%patch -P 8 -p1
%patch -P 10 -p1
%patch -P 11 -p1
%patch -P 12 -p1
%patch -P 13 -p1
%if %{with_system_pcsc}

11
reproducible-jlink.patch Normal file
View File

@ -0,0 +1,11 @@
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java
@@ -837,7 +837,7 @@ private void suggestProviders(JlinkConfiguration config, List<String> args)
private String getSaveOpts() {
StringBuilder sb = new StringBuilder();
- sb.append('#').append(new Date()).append("\n");
+ sb.append('#').append(System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date()).append("\n");
for (String c : optionsHelper.getInputCommand()) {
sb.append(c).append(" ");
}