From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#48578: 28.0.50; Native-compiled files of some preloaded files not loaded at dump time Date: Tue, 25 May 2021 13:18:16 +0000 Message-ID: References: <83k0nrkzem.fsf@gnu.org> <0D04DA9F-BDFB-431E-9F14-385BE7CAAD54@gnu.org> <1064AF16-6F08-4DEA-A63B-D8781420F287@gnu.org> <834kesdruz.fsf@gnu.org> <8335ubc6g9.fsf@gnu.org> Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5829"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 48578@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 25 15:19:51 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llWyM-0001D2-VY for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 May 2021 15:19:50 +0200 Original-Received: from localhost ([::1]:49518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llWyL-0002Pe-VA for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 May 2021 09:19:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llWxa-0000QG-C0 for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 09:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33450) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llWxZ-0006ET-WE for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 09:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1llWxZ-0006E4-T0 for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 09:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 May 2021 13:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48578 X-GNU-PR-Package: emacs Original-Received: via spool by 48578-submit@debbugs.gnu.org id=B48578.162194870123875 (code B ref 48578); Tue, 25 May 2021 13:19:01 +0000 Original-Received: (at 48578) by debbugs.gnu.org; 25 May 2021 13:18:21 +0000 Original-Received: from localhost ([127.0.0.1]:44996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llWwu-0006D0-Lu for submit@debbugs.gnu.org; Tue, 25 May 2021 09:18:20 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:50823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llWwr-0006Cr-Jw for 48578@debbugs.gnu.org; Tue, 25 May 2021 09:18:19 -0400 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 14PDIGoF001023 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 25 May 2021 13:18:16 GMT In-Reply-To: <8335ubc6g9.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 25 May 2021 16:02:14 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207210 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Andrea Corallo >> 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. Andrea --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=48578.patch diff --git a/src/comp.c b/src/comp.c index 340ed85038..e961161fc6 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4008,15 +4008,18 @@ 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); + /* 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). */ + +#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); --=-=-=--