unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Cc: acm@muc.de, 74382@debbugs.gnu.org
Subject: bug#74382: `compile-first` Make rule is no longer using `load-prefer-newer`
Date: Sat, 16 Nov 2024 16:53:42 +0000	[thread overview]
Message-ID: <ZzjOFqIed5BSXKsH@MAC.fritz.box> (raw)
In-Reply-To: <6bc3a410f0857c3e3433070ac19deaf7eae88c63.camel@yandex.ru>

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).





  parent reply	other threads:[~2024-11-16 16:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-16 15:11 bug#74382: `compile-first` Make rule is no longer using `load-prefer-newer` Konstantin Kharlamov
2024-11-16 16:27 ` Eli Zaretskii
2024-11-16 16:53 ` Alan Mackenzie [this message]
2024-11-16 17:45   ` Konstantin Kharlamov
2024-11-16 18:38     ` Eli Zaretskii
2024-11-16 18:43       ` Konstantin Kharlamov
2024-11-16 20:00         ` Eli Zaretskii
2024-11-16 22:54           ` Konstantin Kharlamov
2024-11-17  6:44             ` Eli Zaretskii
2024-11-17 15:31               ` Konstantin Kharlamov
2024-11-17  7:25     ` Gerd Möllmann
2024-11-17 15:21       ` Konstantin Kharlamov
2024-11-17 15:37         ` Eli Zaretskii
2024-11-17 15:43           ` Konstantin Kharlamov
2024-11-17 15:53             ` Eli Zaretskii
2024-11-17 16:04               ` Konstantin Kharlamov
2024-11-17 16:29                 ` Eli Zaretskii
2024-11-17 16:46                   ` Konstantin Kharlamov
2024-11-17 17:09                     ` Eli Zaretskii
2024-11-17 17:24                       ` Konstantin Kharlamov
2024-11-18  4:06                 ` Gerd Möllmann
2024-11-18  6:19                   ` Konstantin Kharlamov
2024-11-18 10:05                   ` Konstantin Kharlamov
2024-11-18 12:59                     ` Eli Zaretskii
2024-11-18 13:12                       ` Konstantin Kharlamov
2024-11-18 13:38                         ` Eli Zaretskii
2024-11-17 15:43         ` Gerd Möllmann

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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=ZzjOFqIed5BSXKsH@MAC.fritz.box \
    --to=acm@muc.de \
    --cc=74382@debbugs.gnu.org \
    --cc=Hi-Angel@yandex.ru \
    /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/emacs.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).