Bug#875700: gtk+3.0: please make the immodules.cache files reproducible

Chris Lamb lamby at debian.org
Wed Sep 13 18:42:02 UTC 2017


Source: gtk+3.0
Version: 3.22.21-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: toolchain filesystemordering
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that gtk+3.0's queryimmodules generates non-reproducible output
as it iterates over the filesystem without sorting.

(NB. This is the GTK3 version of #872729. It was found whilst testing
the Tails [1] ISO for reproducibility issues.)

Patch attached.

 [0] https://reproducible-builds.org/
 [1] https://tails.boum.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
diff --git a/gtk/queryimmodules.c b/gtk/queryimmodules.c
index e9978fd..96b64c7 100644
--- a/gtk/queryimmodules.c
+++ b/gtk/queryimmodules.c
@@ -200,13 +200,19 @@ G_GNUC_END_IGNORE_DEPRECATIONS
             if (dir)
               {
                 const char *dent;
+                GList *list = NULL, *iterator = NULL;
 
                 while ((dent = g_dir_read_name (dir)))
+                  list = g_list_prepend (list, g_strdup (dent));
+
+                list = g_list_sort (list, (GCompareFunc) strcmp);
+                for (iterator = list; iterator; iterator = iterator->next)
                   {
-                    if (g_str_has_suffix (dent, SOEXT))
-                      error |= query_module (dirs[i], dent, contents);
+                    if (g_str_has_suffix (iterator->data, SOEXT))
+                      error |= query_module (dirs[i], iterator->data, contents);
                   }
 
+                g_list_free_full (list, g_free);
                 g_dir_close (dir);
               }
 


More information about the pkg-gnome-maintainers mailing list