Subject: bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code

From: Ihor Radchenko <[email-masked]>
Date: Tue, 11 Apr 2023 18:59:17 +0000

Eli Zaretskii <[email-masked]> writes:

>> Note that the reported issue will only happen when Org version string
>> changes between the builds.
>
> Which happened twice during the last week or two, AFAIR.  Moreover, it
> happens on almost every branch, and if someone builds several branches
> routinely (I do), the annoyance happens several times in a row.

Fair point.

>> What we might do to work around the problem is detecting Emacs compilation
>> and disable the check. Is there a way to detect that Emacs source is
>> being compiled from Elisp?
>
> Not sure I understand: the byte compiler is a Lisp program, so every
> compilation is "from Lisp", no?  Or what am I missing?

I mean, can we detect when the compiler is invoked from "make" in Emacs
source?

>> > Also, how about the alternative of including the version string in
>> > every Org Lisp file that needs to be recompiled when the version
>> > changes (or the macros change)?  Then recompilation will happen
>> > automatically, and this problem will go away.  Does this make sense?
>> 
>> No. We will not be able to maintain this manually.
>
> I guess it means we are on our own, sigh...

You are not. In the worst case, we may add some flag into Org sources
that are inside Emacs tree. Something like `org-version-built-in-p' that
will be set to t only in the Emacs' version of Org.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>