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: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Ihor Radchenko <yantar92 <at> posteo.net>, 62762 <at> debbugs.gnu.org, bzg <at> gnu.org, dmitry <at> gutov.dev, Alan Mackenzie <acm <at> muc.de>, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code
Date: Sun, 7 May 2023 23:23:15 +0700
On 06/05/2023 20:02, Stefan Monnier wrote:
> AFAIU there are 2 main situations:
> 
> A) recompilation (i.e. `git pull; make`).
>     This can happen either in Org's repository or in Emacs's repository.
...
Are there brave enough developers and users who do not restart emacs 
after rebuild of emacs? Some Org users hope that `org-reload' works and 
they can update Org without restarting Emacs.

> B) mixed versions from different directories.
> 
> AFAICT `my-require-with-shadow-check` should be able to catch most/all
> problems for (B),

Agree.

> without impacting (A), and more reliably than
> `org-assert-version` (and in an arguably less ad-hoc way).

Sorry, but `org-assert-version' should catch loading from the same 
directory a file compiled for new version since loaded earlier 
org-version.el defined old version that does not match `org-version' 
inscribed into new .elc files. I assume either combination of "make 
clean" and "make" or proper incremental build. That is why I disagree 
with "without impacting (A)".

> So, to me, (assuming the above is true) the remaining question is what
> Org developers want to do about `git pull; make` in Org's own repository.

Perhaps `org-assert-directory' may be added to `org-assert-version'

By the way, if just org-macs should be checked then would not be it more 
efficient in respect to load time to define a variable containing the 
directory and to check in other files if they are loaded from the same 
directory? With such approach there is no need in walking through the 
`load-history' list.

==> tst-macs.el <==

(defun tst-get-load-dir ()
  (file-name-directory
   (or load-file-name
       ;; For `eval-buffer'.
       (buffer-file-name (buffer-base-buffer)))))

(defvar tst-load-dir (tst-get-load-dir))

(defun tst-assert-load-dir ()
  (let ((dir (tst-get-load-dir))
	(url "https://orgmode.org/worg/org-faq.html#mixed-install"))
    (unless (equal tst-load-dir dir)
      (error "Path shadowing detected, see <%s>. %s vs %s"
	     url dir tst-load-dir))))

(provide 'tst-macs)


==> tst-main.el <==

(require 'tst-macs)

(eval-and-compile
  (if (fboundp 'tst-assert-load-dir)
    (tst-assert-load-dir)
   (error "Path shadowing detected, see 
<https://orgmode.org/worg/org-faq.html#mixed-install>")))

(provide 'tst-main)





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.