Accepting request 1179188 from Java:Factory

reproducible jlink for reproducible jmods

OBS-URL: https://build.opensuse.org/request/show/1179188
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/java-17-openjdk?expand=0&rev=34
This commit is contained in:
Ana Guerrero 2024-06-07 13:05:39 +00:00 committed by Git OBS Bridge
commit 70fdfe3cd2
3 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jun 6 17:02:14 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* reproducible-jlink.patch
+ make the timestamp in jmods reproducible
-------------------------------------------------------------------
Thu Apr 18 14:19:16 UTC 2024 - Fridrich Strba <fstrba@suse.com>

View File

@ -165,6 +165,7 @@ Patch13: implicit-pointer-decl.patch
Patch14: reproducible-properties.patch
Patch15: system-pcsclite.patch
Patch16: fips.patch
Patch17: reproducible-jlink.patch
#
Patch20: loadAssistiveTechnologies.patch
#
@ -409,6 +410,7 @@ rm -rvf src/java.desktop/share/native/liblcms/lcms2*
%endif
%patch -P 16 -p1
%patch -P 17 -p1
%patch -P 20 -p1

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
@@ -776,7 +776,7 @@ public class JlinkTask {
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(" ");
}