[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#62762: 'make' often errors with "Org version mismatch" after pulling
From: |
Stefan Monnier |
Subject: |
bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code |
Date: |
Mon, 01 May 2023 12:49:04 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
> 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
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code, Ihor Radchenko, 2023/05/01
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code,
Stefan Monnier <=
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code, Ihor Radchenko, 2023/05/02
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code, Stefan Monnier, 2023/05/02
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code, Ihor Radchenko, 2023/05/03
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code, Alan Mackenzie, 2023/05/03
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code, Eli Zaretskii, 2023/05/04
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code, Alan Mackenzie, 2023/05/04
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code, Eli Zaretskii, 2023/05/04
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code, Max Nikulin, 2023/05/04
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code, Stefan Monnier, 2023/05/04
- bug#62762: 'make' often errors with "Org version mismatch" after pulling a new version of the code, Max Nikulin, 2023/05/05