Max Nikulin writes: >> I think we can try to do the following: >> >> 1. Use the load-dir test, warn, and try to re-load >> 2. Use org-assert-version, but downgrade error to simple warning > > Ihor, final decision is up to you. > I think, `org-reload' may be recommended in a warning message. I am > unsure if `org-reload' called from the assertion while an Org component > is loaded may not cause a more severe issue. My special concern is > reloading when new Org is being compiled: is it safe or reloading should > be suppressed completely? I am thinking about the following: 1. Use `org-reload' instead of load-dir test. This will re-load all the currently loaded Org libraries, forcing them to be consistent. This is necessary because Org does not only rely upon explicit (require ...) statements - we have way too many `declare-function' expecting other libraries to be loaded by other means. 2. Run `org-reload' _after_ loading current file. Because (equal (org-release) ,(org-release)) will only ever trigger during compilation when we (require 'already-compiled-library), running `org-reload' after loading 'already-compiled-library will also ensure consistent Org state after (require 'already-compiled-library) is finished. > I believe, during creation of .elc files, assert macro should signal an > error since a warning is not enough to prevent loading mixed compilation > result to next Emacs session. I do not like that currently during > compiling with old Org loaded, `org-assert-version' causes just a > warning. Users have difficulties with clean recompiling. > > While loading, non-fatal error may be a better option when versions do > not differ too much. I do not think that we should throw and error. `org-reload' approach should hopefully solve the problem with mixed versions. If not, not throwing an error is still better because mixed compilation actually works relatively fine in many cases - much better than throwing a hard error from user perspective. And we will still notify the user that something is wrong and that random failures are expected. See the attached tentative patch for bugfix. P.S. I am not sure how to approach this patch in a view of the Emacs release process. This is a critical bug, so we aim for bugfix Org release, but we do not want to make life harder for Emacs devs as well.