GNU bug report logs - #62762
'make' often errors with "Org version mismatch" after pulling a new version of the code

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dmitry <at> gutov.dev>

Date: Mon, 10 Apr 2023 23:10:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Max Nikulin <manikulin <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: yantar92 <at> posteo.net, 62762 <at> debbugs.gnu.org, bzg <at> gnu.org, dmitry <at> gutov.dev, monnier <at> iro.umontreal.ca, acm <at> muc.de
Subject: bug#62762: circular dependencies in elisp files and make
Date: Sat, 13 May 2023 18:21:56 +0700
On 13/05/2023 17:58, Eli Zaretskii wrote:
>> Date: Sat, 13 May 2023 17:25:06 +0700 From: Max Nikulin
>>
>> On 13/05/2023 15:46, Eli Zaretskii wrote:
>>>> Date: Sat, 13 May 2023 14:34:06 +0700 From: Max Nikulin
>>>>
>>>> 1. A script reads dependency files (if they exist) created during
----------^^^^^^^^^^^^^^^^^^^^^^^

>>>> previous build and removes stale .elc files.
>>>
>>> This will break if the updated files have different dependencies.  You
>>> need to recreate the dependencies each build.
>>
>> Let's consider a.el that contains (require 'd) or it autoloads some
>> macro from d.el. If a.el changed then a.elc is removed on this stage, so
>> updated a.elc will be created on the next stage. Dependency on d.elc is
>> known from previous build, so if d.el is changed then both a.elc and
>> d.elc are removed. If new (require 'd-new) is added to a.el then it is
>> not a problem as well. a.elc is removed due to changed a.el. d-new.elc
>> is either up to date or it is removed due to changes in its dependencies
>> or in d-new.el.
> 
> I was talking about dependencies, not about stale files.  They will
> need to be refreshed every build, because, unlike C sources, the *.el
> files change in that aspect much more frequently.

Writing "stale" I mean more than comparison timestamps of a.el and 
a.elc. Dependency files may contain

a.elc: a.el d.elc
d.elc: d.el

the script walks through dependency graph, compares timestamps and when 
it d.el is newer than d.elc, *both* "a.elc" and "d.elc" are removed. It 
is unfortunate that a part of "make" should be implemented in the 
script, but I am unsure if some trick is suitable to leverage "make" 
power for removing of files instead of their creation.

Next compile stage updates dependency files as a side effect and new 
dependencies may appear

d.elc: d.el d-transitive.elc

however absence of d-transitive.elc during dependency removing stage 1 
does not lead to any problem.




This bug report was last modified 1 year and 258 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.