From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73926: 29.4; *-autoloads.el generation not reproducible Date: Mon, 21 Oct 2024 12:26:20 +0300 Message-ID: <86r089hkn7.fsf@gnu.org> References: <87sespvqb5.fsf@debian-hx90.lan> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19762"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73926@debbugs.gnu.org To: Xiyue Deng Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 21 11:28:01 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t2ohk-0004x0-GA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Oct 2024 11:28:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2ohP-0001ui-MN; Mon, 21 Oct 2024 05:27:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2ohN-0001uL-OG for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2024 05:27:38 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t2ohN-0002Qn-FO for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2024 05:27:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=9XsQISQqherRzAkogBH/6khEfTeM2u45T7LmSznXNII=; b=rgfqBipMI5oAV7caS8fXQtNfzVO20TGDzhPUXQ9cBmveY7UuzaEfq9Pwz51DfJyijwkjLbbdFIhf/Gk8Y8V+uo1t6f+pDaTr4bkBPw3nB0Xqt5ws+ARnPkKdKa2Dgrk1o5MYX5vAjpFdOme2UN3mF74I+JjEl9P1l4e67laiZi+n48Ji41VPCqhoRDrFEjW6aODhi8kum9uuNflH/YdDuyptlAYQYuDuoTRM3ocP9KnokINw+iVQEUcwt+EkuegMENU2zt4ps43kCjyA3JxGxX1s1NcI0LOySzm7bFAmyWjOtrpXYQ7uRuE4tXBa8qBGSY2saku66YxyqbPAs/A0Mw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t2ohm-0006yM-MK for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2024 05:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Oct 2024 09:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73926 X-GNU-PR-Package: emacs Original-Received: via spool by 73926-submit@debbugs.gnu.org id=B73926.172950283526732 (code B ref 73926); Mon, 21 Oct 2024 09:28:02 +0000 Original-Received: (at 73926) by debbugs.gnu.org; 21 Oct 2024 09:27:15 +0000 Original-Received: from localhost ([127.0.0.1]:50238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2oh1-0006x4-18 for submit@debbugs.gnu.org; Mon, 21 Oct 2024 05:27:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2ogz-0006wp-1w for 73926@debbugs.gnu.org; Mon, 21 Oct 2024 05:27:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2ogT-0002Ck-5g; Mon, 21 Oct 2024 05:26:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=9XsQISQqherRzAkogBH/6khEfTeM2u45T7LmSznXNII=; b=Odnv8cPAZCAY AK6TMNB0V5w7t64k2L+DFarJ4pMxYz232C+NzajvpcnVi2uE9HOsHNje1dTceRMpOqSTNq4cZ3S2q nl6p7+N+XdUsI9CD18rOPWTyhUvHSNhNFqkGAKICUaSoSE564NvHVcsoyHcoFlEuFgBpyL+3YdTTk ZiulMbwoQL3CJB2BVvKcd8L53IsN+uhxjFzcS1hoqh+VcSsI3vAFJ/wlLjAEC20i+7EIPS8ZmByR7 j5eWAqUivdK2fHzNKrVXJhQM2SNmpvU/AjSbPgdmpd3+pQrlaZNET3fbGaKCLb0ZLsraq4HuR6lUk qZI7zhpIqNpZHljODWKkpw==; In-Reply-To: <87sespvqb5.fsf@debian-hx90.lan> (message from Xiyue Deng on Mon, 21 Oct 2024 01:00:14 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294034 Archived-At: > From: Xiyue Deng > Date: Mon, 21 Oct 2024 01:00:14 -0700 > > I was trying to debug a reproducibility test failure on muse-el in > Debian Salsa CI reprotest[1]. It looks like that the contents of the > generated autoload file depends on the input sequence of files and > directories, and it looks like the `loaddefs-generate' doesn't enforce > such a sequence to be consistent. > > I have provided a patch (attached) to sort the input directories and > files in an attempt to fix this reproducibility issue. Did you time the modified code wrt the original one, especially when generating loaddefs for the entire Emacs tree? If the performance hit is significant, we'd probably want to make this behavior optional, like the other measures in Emacs that are meant to produce more reproducible builds. Also, AFAIK on MS-Windows directory-files produces a sorted list by default (just in the reverse order), so in that case calling 'sort' is not needed in the first place. I also wonder whether this will produce the same order on different operating systems, what with the file-encoding being a factor. > --- a/lisp/emacs-lisp/loaddefs-gen.el > +++ b/lisp/emacs-lisp/loaddefs-gen.el > @@ -596,9 +596,13 @@ instead of just updating them with the new/changed autoloads." > (concat "\\`[^=.].*" (regexp-opt tmp t) "\\'"))) > (files (apply #'nconc > (mapcar (lambda (d) > - (directory-files (expand-file-name d) > - t files-re)) > - (if (consp dir) dir (list dir))))) > + (sort > + (directory-files (expand-file-name d) > + t files-re) > + 'string<)) Isn't string< the default when 'sort' is called to sort strings? Thanks.