From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: bug#25414: gdk-pixbuf@2.34.0 does not build deterministically Date: Wed, 11 Jan 2017 00:33:15 +0100 Message-ID: <20170111003315.357249c5@scratchpost.org> References: <87eg0ay0ot.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cR5va-0001wA-Rp for bug-guix@gnu.org; Tue, 10 Jan 2017 18:34:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cR5vW-0001vK-PG for bug-guix@gnu.org; Tue, 10 Jan 2017 18:34:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:33815) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cR5vW-0001v9-Lt for bug-guix@gnu.org; Tue, 10 Jan 2017 18:34:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cR5vW-0003I2-An for bug-guix@gnu.org; Tue, 10 Jan 2017 18:34:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87eg0ay0ot.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 25414@debbugs.gnu.org On Wed, 11 Jan 2017 00:06:42 +0100 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Presumably =E2=80=98gdk-pixbuf-query-loaders=E2=80=99, which generates = =E2=80=98loaders.cache=E2=80=99, > 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-di= r-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 @@ =20 dir =3D g_dir_open (path, 0, NULL); if (dir) { + GList *entries =3D NULL; const char *dent; =20 while ((dent =3D g_dir_read_name (dir))) { gint len =3D strlen (dent); if (len > SOEXT_LEN && strcmp (dent + len - SOEXT_LEN, SOEXT)= =3D=3D 0) { - query_module (contents, path, dent= ); + entries =3D g_list_append (entries= , g_strdup (dent)); } } g_dir_close (dir); + entries =3D g_list_sort (entries, strcmp); + GList *xentries; + for (xentries =3D entries; xentries; xentries =3D = g_list_next(xentries)) { + dent =3D xentries->data; + query_module (contents, path, dent); + g_free (xentries->data); + } + g_list_free(entries); } #else g_string_append_printf (contents, "# dynamic loading of mo= dules not supported\n");