From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: master b9ac4f8.. (Fix locating pdump by symlink) breaks with stow Date: Mon, 24 Jun 2019 15:14:47 +0100 Message-ID: References: <87imsvuvnr.fsf@wavexx.thregr.org> <20190624111050.jindvg6j4hr5j226@Ergus> <20190624122841.vfezkecaxjqwzjy3@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="18652"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (windows-nt) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 24 16:15:47 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfPl5-0004ip-6o for ged-emacs-devel@m.gmane.org; Mon, 24 Jun 2019 16:15:47 +0200 Original-Received: from localhost ([::1]:51586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPl3-00041Q-KK for ged-emacs-devel@m.gmane.org; Mon, 24 Jun 2019 10:15:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50713) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfPkG-000417-0B for emacs-devel@gnu.org; Mon, 24 Jun 2019 10:14:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfPkD-0002Db-Qo for emacs-devel@gnu.org; Mon, 24 Jun 2019 10:14:55 -0400 Original-Received: from [195.159.176.226] (port=46212 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hfPkD-0002CA-JR for emacs-devel@gnu.org; Mon, 24 Jun 2019 10:14:53 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hfPkC-0003lc-7p for emacs-devel@gnu.org; Mon, 24 Jun 2019 16:14:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:PBYg4ZZlFWkp5fzaM/+50GuvaqU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238100 Archived-At: On Mon 24 Jun 2019, Daniel Colascione wrote: >> On Mon, Jun 24, 2019 at 06:57:32PM +0700, Yuri Khan wrote: >>>On Mon, Jun 24, 2019 at 6:12 PM Ergus wrote: >>> >>>> 750| char* argv0 = realpath (argv[0], NULL); >>>> 751| if (!argv0) >>>> 752| fatal ("could not resolve realpath of \"%s\": %s", >>>> 752| argv0, strerror (errno)); >>> >>>This looks wrong. If we called realpath and it returned null, we???d >>>probably want the original argv[0] in the error message, not the null >>>result. >>> >> >> This also produces problems when using emacs from an alias like em o emc >> which is a very common practice. >> >> So there should be actually other conditions to try if the first >> realpath call fails and not abort (call fatal) in the first try. > > Try it now. Sorry about the botched change. Building commit 65d45def8d71e50d111adf1141011a5d30a27447 still fails on MSYS2 (Windows), and adds warnings: C:/emacs/git/emacs/master/lib/canonicalize-lgpl.c:51:21: warning: no previous prototype for 'realpath' [-Wmissing-prototypes] 51 | # define __realpath realpath | ^~~~~~~~ C:/emacs/git/emacs/master/lib/canonicalize-lgpl.c:117:1: note: in expansion of macro '__realpath' 117 | __realpath (const char *name, char *resolved) | ^~~~~~~~~~ C:/emacs/git/emacs/master/lib/canonicalize-lgpl.c:50:35: warning: no previous prototype for 'canonicalize_file_name' [-Wmissing-prototypes] 50 | # define __canonicalize_file_name canonicalize_file_name | ^~~~~~~~~~~~~~~~~~~~~~ C:/emacs/git/emacs/master/lib/canonicalize-lgpl.c:416:1: note: in expansion of macro '__canonicalize_file_name' 416 | __canonicalize_file_name (const char *name) | ^~~~~~~~~~~~~~~~~~~~~~~~ [...] C:/emacs/git/emacs/master/src/emacs.c: In function 'load_pdump': C:/emacs/git/emacs/master/src/emacs.c:851:22: warning: implicit declaration of function 'realpath' [-Wimplicit-function-declaration] 851 | real_exename = realpath (exename, NULL); | ^~~~~~~~ C:/emacs/git/emacs/master/src/emacs.c:851:22: warning: nested extern declaration of 'realpath' [-Wnested-externs] C:/emacs/git/emacs/master/src/emacs.c:851:20: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 851 | real_exename = realpath (exename, NULL); | ^ C:/emacs/git/emacs/master/src/emacs.c:923:7: error: 'argv0_len' undeclared (first use in this function) 923 | argv0_len = strlen (argv0_base); | ^~~~~~~~~ C:/emacs/git/emacs/master/src/emacs.c:923:7: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [Makefile:402: emacs.o] Error 1