From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Xiyue Deng Newsgroups: gmane.emacs.bugs Subject: bug#73926: 29.4; *-autoloads.el generation not reproducible Date: Mon, 21 Oct 2024 14:31:06 -0700 Message-ID: <87msixuorp.fsf@debian-hx90.lan> References: <87sespvqb5.fsf@debian-hx90.lan> <86r089hkn7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23448"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.38.3 (https://notmuchmail.org) Emacs/29.4 (x86_64-pc-linux-gnu) Cc: 73926-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 21 23:33:42 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 1t301y-0005q2-Qa for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Oct 2024 23:33:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t301I-0003ku-WE; Mon, 21 Oct 2024 17:32:57 -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 1t3011-0003Xn-0f for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2024 17:32:39 -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 1t300x-0004nS-M0 for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2024 17:32:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=DeDTUOEC1BOLKoirIksDJ64JsmTBZ/OD0Tod8/XXvkQ=; b=nGWbtOREBMlUSerzXXes/Fd5Ym33MMMCCC5vbVr4BNHKLKp7U2NerjVU0xvBxgOPjQUvQf+cGsipvcLYIieXYxFs5HBDg2BHXhVT7aTpVWTLACoGsWU8QeWPgAUO+v8FkKGe8iA18j5jyPHixCGVij1hbYiu0mBm2/GEi8KX3diCE/a3OwYJzdR8IS57koHwFEs+WKwP0dA6k9Wyp08xMOVaDkqjcavdhwCqnNniLFDgC451LsYGcarHZ4m9/o4U1b1NJZCKalhJApfndaQvdnNvQd5YLupvzyu95cMS6t9WpWP8PUxMZQbcllhtn4oLx/rTylool9o34rk1eNF3Tg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t301O-0007jq-K8 for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2024 17:33:02 -0400 Resent-From: Xiyue Deng Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Oct 2024 21:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 73926 X-GNU-PR-Package: emacs Mail-Followup-To: 73926@debbugs.gnu.org, manphiz@gmail.com, manphiz@gmail.com Original-Received: via spool by 73926-done@debbugs.gnu.org id=D73926.172954636029699 (code D ref 73926); Mon, 21 Oct 2024 21:33:02 +0000 Original-Received: (at 73926-done) by debbugs.gnu.org; 21 Oct 2024 21:32:40 +0000 Original-Received: from localhost ([127.0.0.1]:53782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3011-0007ix-OV for submit@debbugs.gnu.org; Mon, 21 Oct 2024 17:32:40 -0400 Original-Received: from mail-pf1-f173.google.com ([209.85.210.173]:51201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3010-0007ip-08 for 73926-done@debbugs.gnu.org; Mon, 21 Oct 2024 17:32:38 -0400 Original-Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-71e52582cf8so3422082b3a.2 for <73926-done@debbugs.gnu.org>; Mon, 21 Oct 2024 14:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729546270; x=1730151070; darn=debbugs.gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=DeDTUOEC1BOLKoirIksDJ64JsmTBZ/OD0Tod8/XXvkQ=; b=FhfovKScyrKVdj0e1pHdpoT3moB/iiejP+aYnUvoAbD4B9nu4jY+weNw4mZN/X5XuW EvQ6DBedKkRKZkW/iFKSVehoOPPvgRweAZebcZDl1WXa/NqXiiq6niTj2YFBtJjZzvO0 IlYCo0pbWy9VYUWu0K5RIE3XK01vao7RswaI/W/FffcAXBO9WgMPJXLLwK7o0DceclsM QBK62VzgeEgbQWcwkypXXiOWDfDrZot5hzl1bp4zvjYNmdt+Qd/9wPT5A9d5XOt3h6Ur MCZ6imNkxjQA8pZxtd0qACyStGsUBrWilQoNPELr5j7iXACpnNczdkgn1v3OASIqKEGS ok4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729546270; x=1730151070; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DeDTUOEC1BOLKoirIksDJ64JsmTBZ/OD0Tod8/XXvkQ=; b=H19whyC9ToAda5jOcO8oUAg+aOj3ytNWljHj6Iu5GIRqRCCUlibGO6Zz6fEsjYAhVm JaesH8ceE+e3kskiWttq4eSNfAnahE63egaT16Qbc7mqempNjmXUETxN2X/jRbApJCph ERRDfVfVFAQSB37zWNFfu4xsMOQB9B0wGkqt7U5I3hz9H6hqpKp55RDiCQDSvVGHeaL9 m3Ib+joy9SVOyGHZr/HQOoPu45dZT78vepr/fbNQ0cZJhQIlZut5H0It3vj8bX6fpCEt wFlgkdK7McAG6vsSq71+tjfo2AbbEiad9mbX+375QwtDp0szyewiWNIm1hW2b10E/i+n /ENg== X-Gm-Message-State: AOJu0YyDEPbs+TPxhWlejvjCLvVb8r1UMuugD37kvue0poxnANDiIZzf 0z40hxU0OBS8tsZuVV2k7A0ihL0Hk/4wAFisqlIvENmtsd0lGqZZr7LhDbTwRhE= X-Google-Smtp-Source: AGHT+IGI9UnEFDTop/DDC5uyaG/qWbS5sqk6kGNChBXiBocpOj8aCRWjVDEc62/BNVT1Q5NhWPOzEA== X-Received: by 2002:a62:f250:0:b0:71e:374c:b9aa with SMTP id d2e1a72fcca58-71ea323c111mr13186773b3a.27.1729546269668; Mon, 21 Oct 2024 14:31:09 -0700 (PDT) Original-Received: from debian-hx90 (syn-076-094-249-045.res.spectrum.com. [76.94.249.45]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec13eb0d3sm3366883b3a.180.2024.10.21.14.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 14:31:09 -0700 (PDT) In-Reply-To: <86r089hkn7.fsf@gnu.org> 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:294086 Archived-At: Hi Eli, Eli Zaretskii writes: >> 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. > It looks like my previous test was actually incorrect and turned out this patch on Emacs didn't actually fix the specific issue for muse-el. So I'd like to drop this for now until I have a real fix for muse-el first. >> --- 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? > Yes, actually `directory-files' should have already sorted the results using 'string-lessp as the documentation pointed out, so this sort is not necessary. The one with the dir may worth considering, but will test more before resubmitting. > Thanks. -- Regards, Xiyue Deng