unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 25414@debbugs.gnu.org
Subject: bug#25414: gdk-pixbuf@2.34.0 does not build deterministically
Date: Wed, 11 Jan 2017 00:33:15 +0100	[thread overview]
Message-ID: <20170111003315.357249c5@scratchpost.org> (raw)
In-Reply-To: <87eg0ay0ot.fsf@gnu.org>

On Wed, 11 Jan 2017 00:06:42 +0100
ludo@gnu.org (Ludovic Courtès) wrote:

> Presumably ‘gdk-pixbuf-query-loaders’, which generates ‘loaders.cache’,
> does not sort the entries returned by readdir(2).

Yep.

gdk-pixbuf/queryloaders.c line 355 uses g_dir_open.

Docs: https://developer.gnome.org/glib/stable/glib-File-Utilities.html#g-dir-open "Note that the ordering is not defined."

One could use g_list_append to append it to a list and then g_list_sort and then g_list_free. Like below (untested! Seriously!):

--- gdk-pixbuf/queryloaders.c.orig      2017-01-11 00:17:32.865843062 +0100
+++ gdk-pixbuf/queryloaders.c   2017-01-11 00:31:29.428372177 +0100
@@ -354,16 +354,25 @@
 
                 dir = g_dir_open (path, 0, NULL);
                 if (dir) {
+                        GList *entries = NULL;
                         const char *dent;
 
                         while ((dent = g_dir_read_name (dir))) {
                                 gint len = strlen (dent);
                                 if (len > SOEXT_LEN &&
                                     strcmp (dent + len - SOEXT_LEN, SOEXT) == 0) {
-                                        query_module (contents, path, dent);
+                                        entries = g_list_append (entries, g_strdup (dent));
                                 }
                         }
                         g_dir_close (dir);
+                        entries = g_list_sort (entries, strcmp);
+                        GList *xentries;
+                        for (xentries = entries; xentries; xentries = g_list_next(xentries)) {
+                                dent = xentries->data;
+                                query_module (contents, path, dent);
+                                g_free (xentries->data);
+                        }
+                        g_list_free(entries);
                 }
 #else
                 g_string_append_printf (contents, "# dynamic loading of modules not supported\n");

  reply	other threads:[~2017-01-10 23:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 23:06 bug#25414: gdk-pixbuf@2.34.0 does not build deterministically Ludovic Courtès
2017-01-10 23:33 ` Danny Milosavljevic [this message]
2017-01-11 21:16   ` Ludovic Courtès
2017-01-11 22:13     ` Danny Milosavljevic
2017-01-12 13:14       ` Ludovic Courtès
2017-01-14  9:21         ` Danny Milosavljevic
2017-01-15  1:22           ` bug#25414: [PATCH] gnu: gdk-pixbuf: Make it reproducible Danny Milosavljevic
     [not found]           ` <20170115012207.2604-1-dannym@scratchpost.org>
2017-01-16 13:44             ` Ludovic Courtès
     [not found]             ` <874m0zyva3.fsf@gnu.org>
2017-01-16 15:48               ` Danny Milosavljevic
2017-06-05  4:53 ` Danny Milosavljevic
2017-06-05 20:43   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170111003315.357249c5@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=25414@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).