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: Alan Mackenzie <acm <at> muc.de>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: 62762 <at> debbugs.gnu.org, bzg <at> gnu.org, dmitry <at> gutov.dev, Stefan Monnier <monnier <at> iro.umontreal.ca>, Eli Zaretskii <eliz <at> gnu.org>, Max Nikulin <manikulin <at> gmail.com>
Subject: bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code
Date: Wed, 3 May 2023 21:37:11 +0000
Hello, Ihor.

It occurs to me that perhaps the CC Mode solution to the original
problem might be useful.  It was written by my predecessor at CC Mode,
Martin Stjernholm.  In ~20 years of using it, I've never had problems
with using incorrect versions of macros, or anything like that.

To quote part of the commentary from lisp/progmodes/cc-bytecomp.el:

;; This file is used to ensure that the CC Mode files are correctly
;; compiled regardless the environment (e.g. if an older CC Mode with
;; outdated macros are loaded during compilation).  It also provides
;; features to defeat the compiler warnings for selected symbols.

It works by pushing the correct directories onto load-path at the start
of each compilation, and popping them off again at the end.

Feel free to consider using this approach!

-- 
Alan Mackenzie (Nuremberg, Germany).



On Wed, May 03, 2023 at 10:30:55 +0000, Ihor Radchenko wrote:
> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> >> This looks interesting, if we replace all the requires in Org with
> >> `my-require-with-shadow-check'.
> >
> > If we make it signal an error, then I think we only need it for the
> > requires that load "the one first file" (which you suggest could be
> > `org-macs.el`).

> This might work.

> Max, do you see any obvious downsides in Stefan's idea about consulting
> `load-history' vs. `load-path'?

> >> Although, AFAIU, it does not address the problem with stale .elc files
> >> kept from the previous Org version in the same folder (AFAIR, it is what
> >> often happens in ELPA builds).
> >
> > I don't understand what you mean here: when `package.el` compiles the
> > files of the Org package, that package has just been untarred into
> > a fresh new directory, so there should never be any stale `.elc` files
> > in there.

> I am referring to https://orgmode.org/list/jwvsfkv5s7l.fsf-monnier+emacs <at> gnu.org

> >> And we somehow need to make sure that `my-require-with-shadow-check' is
> >> available for all its users.
> >
> > Ah, the fun of bootstrapping :-)

> I guess that the cleanest way could be putting
> `require-with-shadow-check' into a new file. Then, we have no chance of
> this file being loaded by old Org version.

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






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.