all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 48578@debbugs.gnu.org
Cc: eliz@gnu.org
Subject: bug#48578: 28.0.50; Native-compiled files of some preloaded files not loaded at dump time
Date: Tue, 25 May 2021 13:22:39 +0000	[thread overview]
Message-ID: <xjfr1hvkkww.fsf@sdf.org> (raw)
In-Reply-To: <xjfv977kl47.fsf@sdf.org> (Andrea Corallo via's message of "Tue,  25 May 2021 13:18:16 +0000")

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Andrea Corallo <akrl@sdf.org>
>>> Cc: 48578@debbugs.gnu.org
>>> Date: Tue, 25 May 2021 12:34:27 +0000
>>> 
>>> +  /* Use `file-truename' or fall back to 'realpath' `expand-file-name'
>>> +     when the first is not available.  (`file-truename' is not
>>> +     available only for a short phases of the bootstrap before file.el
>>> +     is loaded).  */
>>> +
>>> +  if (NILP (Ffboundp (intern_c_string ("file-truename"))))
>>> +    {
>>> +#ifndef WINDOWSNT
>>> +      char *file_normalized = realpath (SSDATA (filename), NULL);
>>> +#else
>>> +      char *file_normalized = ??? ;
>>> +#endif
>>> +      filename = Fexpand_file_name (build_string (file_normalized), Qnil);
>>> +      xfree (file_normalized);
>>> +    }
>>> +  else
>>> +    filename = CALL1I (file-truename, filename);
>>>  
>>>    if (NILP (Ffile_exists_p (filename)))
>>>      xsignal1 (Qfile_missing, filename);
>>
>> Thanks, I will try that.  But why not use realpath at all times, even
>> if file-truename is available?  They do the same thing, AFAIK, no?
>
> AFAIK yes but the file-truename implementation didn't look sufficiently
> trivial to be sure they are really equivalent with the quick skim I had.
>
> I agree with the idea of using always one (realpath), should be also
> easier to ideantify issues in case.
>
> Attached the updated patch.

Well... attached updating also the comment.

  Andrea


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 48578.patch --]
[-- Type: text/x-diff, Size: 1097 bytes --]

diff --git a/src/comp.c b/src/comp.c
index 340ed85038..8e40ea0f25 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4008,15 +4008,15 @@ DEFUN ("comp-el-to-eln-rel-filename", Fcomp_el_to_eln_rel_filename,
 {
   CHECK_STRING (filename);
 
-  /* 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);
+  /* `file-truename' is not available only during bootstrap before
+     file.el is loaded.  */
+#ifndef WINDOWSNT
+  char *file_normalized = realpath (SSDATA (filename), NULL);
+#else
+  char *file_normalized = ??? ;
+#endif
+  filename = Fexpand_file_name (build_string (file_normalized), Qnil);
+  xfree (file_normalized);
 
   if (NILP (Ffile_exists_p (filename)))
     xsignal1 (Qfile_missing, filename);

  reply	other threads:[~2021-05-25 13:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-22  7:20 bug#48578: 28.0.50; Native-compiled files of some preloaded files not loaded at dump time Eli Zaretskii
2021-05-24  6:55 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-24  7:30   ` Eli Zaretskii
2021-05-24  7:47     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-24  8:10       ` Eli Zaretskii
2021-05-24  8:48         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-24 16:22           ` Eli Zaretskii
2021-05-25 12:34             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-25 13:02               ` Eli Zaretskii
2021-05-25 13:18                 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-25 13:22                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-05-26 13:43                     ` Eli Zaretskii
2021-05-27 11:57                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-27 13:45                         ` Eli Zaretskii
2021-05-29  7:02                           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-29  8:57                             ` Eli Zaretskii
2021-05-25 18:13                   ` Basil L. Contovounesios
2021-05-25 18:15                     ` Eli Zaretskii
2021-05-25 18:31                       ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xjfr1hvkkww.fsf@sdf.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=48578@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.