From: Andrea Corallo Date: Wed, 18 Nov 2020 16:50:03 +0000 (+0100) Subject: * Fix eln file hasing for symlink paths (bug#44701) X-Git-Tag: emacs-28.0.90~2727^2~309 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3ae309bd59c608b4262209e225b963a8f73450e6;p=emacs.git * Fix eln file hasing for symlink paths (bug#44701) * src/comp.c (Fcomp_el_to_eln_filename): Call `file-truename' in place of `expand-file-name' when available. --- diff --git a/src/comp.c b/src/comp.c index 5b0f58b1a4a..292f0e7e707 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4037,7 +4037,15 @@ If BASE-DIR is nil use the first entry in `comp-eln-load-path'. */) { CHECK_STRING (filename); - filename = Fexpand_file_name (filename, Qnil); + /* Use `file-truename' or fall back to `expand-file-name' when the + first is not available (bug#44701). + + `file-truename' is not available only for a short phases of the + bootstrap before file.el is loaded, given we do not symlink + inside the build directory this should work. */ + filename = NILP (Ffboundp (intern_c_string ("file-truename"))) + ? Fexpand_file_name (filename, Qnil) + : CALL1I (file-truename, filename); if (NILP (Ffile_exists_p (filename))) xsignal1 (Qfile_missing, filename);