From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#74382: `compile-first` Make rule is no longer using `load-prefer-newer` Date: Sat, 16 Nov 2024 16:53:42 +0000 Message-ID: References: <6bc3a410f0857c3e3433070ac19deaf7eae88c63.camel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38893"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 74382@debbugs.gnu.org To: Konstantin Kharlamov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 16 17:54:14 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 1tCM3q-0009z0-In for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Nov 2024 17:54:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCM3h-0007OC-3P; Sat, 16 Nov 2024 11:54:05 -0500 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 1tCM3f-0007Nq-Un for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 11:54:03 -0500 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 1tCM3f-0005jR-Lf for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 11:54:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:In-Reply-To:MIME-Version:References:Date:To:Subject; bh=XSzkrXLVq+ibRwJdCZZjtCKwrSmoc8QFtSIBoXMSW2k=; b=pN2mab7YOMg+YzjpQfSO8CK7z5PhiW19rTiq/piPuZDcRXMOvfFmZrsnPy3MKIlcZSaYadWajPCUdyoHRrkwV9VM2e76zWt84pZi4z8YmlZBU0202wVaqZcrVXWbs2cvxxdgsASS1U9IKEKx7TdXhCmQomvNSaZEPo0BErFpZ24KKBGUH+oJMR7sISa2xhI6F6mKyKlaKGMJK5dqYXxzOzLXwwXxMxpUcj7w01DtmggDOZ+k3uZTaqbi0pIfKAcdL2vIlwO8lpGftIca4g2prM9TMP+lSX/vGHIXMXfkAgv5ipxVC6I3P9db0HyeAukUsElTIg5P5Vidk1eJWVrIrQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tCM3e-0004R6-GE for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 11:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2024 16:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74382 X-GNU-PR-Package: emacs Original-Received: via spool by 74382-submit@debbugs.gnu.org id=B74382.173177603317037 (code B ref 74382); Sat, 16 Nov 2024 16:54:02 +0000 Original-Received: (at 74382) by debbugs.gnu.org; 16 Nov 2024 16:53:53 +0000 Original-Received: from localhost ([127.0.0.1]:54573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCM3U-0004Qj-PN for submit@debbugs.gnu.org; Sat, 16 Nov 2024 11:53:53 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:31610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCM3S-0004QU-9W for 74382@debbugs.gnu.org; Sat, 16 Nov 2024 11:53:51 -0500 Original-Received: (qmail 45405 invoked by uid 3782); 16 Nov 2024 17:53:43 +0100 Original-Received: from muc.de (p4fe151f0.dip0.t-ipconnect.de [79.225.81.240]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 16 Nov 2024 17:53:43 +0100 Original-Received: (qmail 10848 invoked by uid 1000); 16 Nov 2024 16:53:42 -0000 Content-Disposition: inline In-Reply-To: <6bc3a410f0857c3e3433070ac19deaf7eae88c63.camel@yandex.ru> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:295476 Archived-At: Hello, Konstantin. On Sat, Nov 16, 2024 at 18:11:01 +0300, Konstantin Kharlamov wrote: > CC: Alan Mackenzie, author of the change in 10083e788f7349fa363d100687dc3d94bea88f57 > I've seen for a long time Emacs master builds fail from time to time in spectacular > ways after updating the repo, sometimes so badly that `make clean` doesn't help. > I never dug into that though, but I'm attributing this to the occasional build > messages similar to: > Source file ‘/home/constantine/Projects/emacs/lisp/emacs-lisp/comp.el’ newer than byte-compiled file; using older file > Source file ‘/home/constantine/Projects/emacs/lisp/emacs-lisp/bytecomp.el’ newer than byte-compiled file; using older file > Source file ‘/home/constantine/Projects/emacs/lisp/emacs-lisp/comp-cstr.el’ newer than byte-compiled file; using older file > …which makes sense, because if the repo changed `comp.el` API and Emacs during the > build of newer files is trying to make use of older `.elc` file and hence the older > API, it may result in failure. The idea is that the byte compiler is first built from .el files, giving ..elc files. The .elc byte compiler is then used for all the other files, since it's much faster. > Got some spare time today, dug into one of the messages. From what I understand it's > caused by this line `lisp/Makefile.in`: > # ... but we must prefer .elc files for those in the early bootstrap. > compile-first: BYTE_COMPILE_FLAGS = $(BYTE_COMPILE_EXTRA_FLAGS) > >From what I understand, this rewrites BYTE_COMPILE_FLAGS to be an empty variable, > which results in `(setq load-prefer-newer t)` being stripped off of the build. Yes, this is to prefer the faster .elc byte compiler, whose file dates have been set back to the epoch (1970-01-01:00:00:00 UTC). I think this was to ensure that when we come to native compilation, the .el source files of the compiler will be newer than the .elc files, hence triggering a native compilation of them. I honestly don't believe that this mechanism for speeding up the early build is the cause of the spectacular failures in some of your builds, but I could be wrong. > The straightforward solution is to remove this line. But since the line's commentary > opposes to such solution, I'm starting up a discussion what exactly should be the > behavior here 😊 Perhaps if you could be more specific about the failures you see, we might be able to be of more help. -- Alan Mackenzie (Nuremberg, Germany).