djcb / mu

maildir indexer/searcher + emacs mail client + guile bindings
http://www.djcbsoftware.nl/code/mu
GNU General Public License v3.0
1.61k stars 390 forks source link

[mu4e bug] "Recursive load" error while bytecompiling .elc #2565

Closed ahttraga closed 1 year ago

ahttraga commented 1 year ago

Bug Description Compile fails with "Recursive load" error during bytecompile of emacslisp files using developmental emacs v30.0.50

How to Reproduce During standard ninja compile, byte compilation of .el files gives the following error:

/Users/cog/bin/emacs --no-init-file --batch --directory /Users/cog/src/mu/build/mu4e --directory /Users/cog/src/mu/mu4e --eval '(setq load-prefer-newer t)' --eval '(setq byte-compile-warnings '"'"'(not obsolete))' --eval '(setq byte-compile-dest-file-function(lambda(_) "/Users/cog/src/mu/build/mu4e/mu4e-draft.elc"))' --funcall batch-byte-compile ../mu4e/mu4e-draft.el
>>Error occurred processing ../mu4e/mu4e-draft.el: error (("Recursive load" "/Applications/Emacs.app/Contents/Resources/lisp/jka-compr.el.gz" "/Applications/Emacs.app/Contents/Resources/lisp/jka-compr.el.gz" "/Applications/Emacs.app/Contents/Resources/lisp/jka-compr.el.gz" "/Applications/Emacs.app/Contents/Resources/lisp/jka-compr.el.gz" "/Applications/Emacs.app/Contents/Resources/lisp/jka-compr.el.gz" "/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/icons.el.gz" "/Users/cog/.emacs.d/eln-cache/30_0_50-528dc109/warnings-28e75f4d-9f48f568.eln"))

Workaround This error may be due to use of (setq load-prefer-newer t) flag when compiling, which is known to produce recursive load errors with jka-compr:

Uncompressing jka-compr.el.gz in the Emacs lisp directory allows compilation to succeed.

Environment MacOS, emacs development branch 30.0.50

Checklist

Please make sure you all items in the checklist are set/met before filing the ticket. Thank you!

djcb commented 1 year ago

Seems like an emacs bug... but I think I can work around it; simply removing load-prefer-newer is not enough, since it yields byte-compiler warnings.