Bug#862183: libjgroups-java: please make the build reproducible

Chris Lamb lamby at debian.org
Tue May 9 14:37:13 UTC 2017


Source: libjgroups-java
Version: 2.12.2.Final-4
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that libjgroups-java could not be built reproducibly due to it
outputing results by iterating over a non-deterministic data
structure.

Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/02_reproducible_build.patch	1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/02_reproducible_build.patch	2017-05-09 15:33:46.683278749 +0100
@@ -0,0 +1,39 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2017-05-09
+
+--- libjgroups-java-2.12.2.Final.orig/src/org/jgroups/util/XMLSchemaGenerator.java
++++ libjgroups-java-2.12.2.Final/src/org/jgroups/util/XMLSchemaGenerator.java
+@@ -7,8 +7,8 @@ import java.lang.reflect.Field;
+ import java.lang.reflect.Method;
+ import java.lang.reflect.Modifier;
+ import java.net.URL;
+-import java.util.HashSet;
+-import java.util.Set;
++import java.util.TreeSet;
++import java.util.SortedSet;
+ 
+ import javax.xml.parsers.DocumentBuilder;
+ import javax.xml.parsers.DocumentBuilderFactory;
+@@ -74,7 +74,7 @@ public class XMLSchemaGenerator {
+          allType.setAttribute("maxOccurs", "unbounded");
+          complexType.appendChild(allType);
+ 
+-         Set<Class<?>> classes = getClasses("org.jgroups.protocols", Protocol.class);
++         SortedSet<Class<?>> classes = getClasses("org.jgroups.protocols", Protocol.class);
+          for (Class<?> clazz : classes) {
+             classToXML(xmldoc, allType, clazz, "");
+          }
+@@ -99,10 +99,10 @@ public class XMLSchemaGenerator {
+       }
+    }
+ 
+-   private static Set<Class<?>> getClasses(String packageName, Class<?> assignableFrom)
++   private static SortedSet<Class<?>> getClasses(String packageName, Class<?> assignableFrom)
+             throws IOException, ClassNotFoundException {
+       ClassLoader loader = Thread.currentThread().getContextClassLoader();
+-      Set<Class<?>> classes = new HashSet<Class<?>>();
++      SortedSet<Class<?>> classes = new TreeSet<Class<?>>();
+       String path = packageName.replace('.', '/');
+       URL resource = loader.getResource(path);
+       if (resource != null) {
--- a/debian/patches/series	2017-05-09 14:57:00.438646581 +0100
--- b/debian/patches/series	2017-05-09 15:17:54.003369976 +0100
@@ -1 +1,2 @@
 01_disable_diagnostics.patch
+02_reproducible_build.patch


More information about the pkg-java-maintainers mailing list