GNU bug report logs -
#62762
'make' often errors with "Org version mismatch" after pulling a new version of the code
Previous Next
Full log
Message #110 received at 62762 <at> debbugs.gnu.org (full text, mbox):
> May you provide an approximate code for that function?
Something like (guaranteed 100% untested):
(defun my-require-with-shadow-check (feature &optional reload)
(if (not (featurep feature))
(require feature)
(let ((file (locate-file (symbol-name feature)
load-path (get-load-suffixes))))
(if (assoc file load-history)
;; The desired file is already loaded, we're clear!
nil
;; The feature is already provided, but from some other file
;; than expected. Presumably because `load-path` has been
;; changed since the file was loaded. This is likely a sign
;; that we're loading a mix of files from different versions.
;; That can spell trouble.
(if reload
;; Try and fix the situation by force-reloading the file
;; This may fix the problem but only if that file doesn't
;; `require` any other affected file, or if it also
;; uses `my-require-with-shadow-check` to similarly reload
;; any other affected file.
(load file nil t t)
;; We could try and find the "other/older" file in `load-history`
;; to provide better feedback to the user.
(error "Mixed versions!!"))))))
-- Stefan
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.