From 3ae309bd59c608b4262209e225b963a8f73450e6 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Wed, 18 Nov 2020 17:50:03 +0100 Subject: [PATCH] * 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. --- src/comp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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); -- 2.39.5