[bug#55751,v2,7/7] gnu: openjdk15: Make reproducible.
Commit Message
* gnu/packages/java.scm (openjdk15)[source]: Add patch.
---
gnu/packages/java.scm | 3 +-
.../openjdk-15-jtask-reproducibility.patch | 40 +++++++++++++++++++
2 files changed, 42 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/openjdk-15-jtask-reproducibility.patch
Comments
Hello!
Danny Milosavljevic <dannym@scratchpost.org> writes:
> * gnu/packages/java.scm (openjdk15)[source]: Add patch.
> ---
> gnu/packages/java.scm | 3 +-
> .../openjdk-15-jtask-reproducibility.patch | 40 +++++++++++++++++++
> 2 files changed, 42 insertions(+), 1 deletion(-)
> create mode 100644 gnu/packages/patches/openjdk-15-jtask-reproducibility.patch
I've queued your work for core-updates. Thank you!
On 2024-01-21, Maxim Cournoyer wrote:
> Danny Milosavljevic <dannym@scratchpost.org> writes:
>
>> * gnu/packages/java.scm (openjdk15)[source]: Add patch.
>> ---
>> gnu/packages/java.scm | 3 +-
>> .../openjdk-15-jtask-reproducibility.patch | 40 +++++++++++++++++++
>> 2 files changed, 42 insertions(+), 1 deletion(-)
>> create mode 100644 gnu/packages/patches/openjdk-15-jtask-reproducibility.patch
>
> I've queued your work for core-updates. Thank you!
This series appears to be present in guix master as:
3c8ca6b26bee110c4bcfbc6aaa7d4805b1915fc8 gnu: openjdk15: Make reproducible.
dbce2fc28728721c0ac81929799d55deae6b0ab5 gnu: openjdk14: Make reproducible.
5996fb5b0c7ce7ca6b1552308199effa66cbcf6a gnu: openjdk13: Make reproducible.
d109a7322c0597b4f265df93061886984fca9037 gnu: openjdk12: Make reproducible.
edf8fc9a485298e9bdb3793221c75d0a4a18177d gnu: openjdk11: Make more reproducible.
48ea1a2b3b8bc4c8b2247972401ab5a6f7f4ecc7 gnu: openjdk10: Make more reproducible.
2f1daa35746c896cd59882383c236ee97a3cbad7 gnu: openjdk9: Make build reproducible.
Marking as done!
live well,
vagrant
@@ -1568,7 +1568,8 @@ (define-public openjdk15
(modules '())
(snippet #f)
(patches
- (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
+ (search-patches "openjdk-15-jtask-reproducibility.patch"
+ "openjdk-15-xcursor-no-dynamic.patch"))))
(inputs
(modify-inputs (package-inputs base)
(append libxcursor))) ;for our patch to work
new file mode 100644
@@ -0,0 +1,40 @@
+--- 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java.orig 2022-04-04 10:57:40.346312924 +0200
++++ 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java 2022-04-04 11:01:38.480751902 +0200
+@@ -82,6 +82,7 @@
+ import jdk.internal.module.ModuleTarget;
+ import jdk.internal.module.Resources;
+ import jdk.tools.jlink.internal.Utils;
++import java.util.TreeSet;
+
+ import static java.util.stream.Collectors.joining;
+
+@@ -750,6 +751,7 @@
+ void processSection(JmodOutputStream out, Section section, Path path)
+ throws IOException
+ {
++ TreeSet<Path> paths = new TreeSet<>();
+ Files.walkFileTree(path, Set.of(FileVisitOption.FOLLOW_LINKS),
+ Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
+ @Override
+@@ -765,14 +767,18 @@
+ if (out.contains(section, name)) {
+ warning("warn.ignore.duplicate.entry", name, section);
+ } else {
+- try (InputStream in = Files.newInputStream(file)) {
+- out.writeEntry(in, section, name);
+- }
++ paths.add(file);
+ }
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ });
++
++ for (Path file : paths) {
++ try (InputStream in = Files.newInputStream(file)) {
++ out.writeEntry(in, section, path.relativize(file).toString());
++ }
++ }
+ }
+
+ boolean matches(Path path, List<PathMatcher> matchers) {