From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Daniel Colascione" Newsgroups: gmane.emacs.devel Subject: Re: Finding the dump Date: Sun, 27 Jan 2019 16:32:54 -0800 Message-ID: <608533e75f41da3e36e191f8a670af05.squirrel@dancol.org> References: <83munr8jb1.fsf@gnu.org> <838szb8ey9.fsf@gnu.org> <83d0oj62bc.fsf@gnu.org> <87ef8z4g1m.fsf@igel.home> <838sz75u7p.fsf@gnu.org> <877eer4e4x.fsf@igel.home> <835zub5p3i.fsf@gnu.org> <8736pf408v.fsf@igel.home> <83womq3z5c.fsf@gnu.org> <871s4yxfvb.fsf@igel.home> <83o9823xcq.fsf@gnu.org> <87womqvyy4.fsf@igel.home> <4f30b2b598e71d2c6ad766a3da8e4a33.squirrel@dancol.org> <87o982vszn.fsf@igel.home> <87k1ipx3jq.fsf@igel.home> <87bm41wzmv.fsf@igel.home> Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="102281"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: SquirrelMail/1.4.23 [SVN] Cc: Eli Zaretskii , Daniel Colascione , Andreas Schwab , rpluim@gmail.com, emacs-devel@gnu.org To: "Paul Eggert" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 28 01:33:10 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gnurN-000QPK-LN for ged-emacs-devel@m.gmane.org; Mon, 28 Jan 2019 01:33:10 +0100 Original-Received: from localhost ([127.0.0.1]:52034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnurM-0006ya-Gb for ged-emacs-devel@m.gmane.org; Sun, 27 Jan 2019 19:33:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnurG-0006yT-Mq for emacs-devel@gnu.org; Sun, 27 Jan 2019 19:33:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gnurG-0000NX-0i for emacs-devel@gnu.org; Sun, 27 Jan 2019 19:33:02 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:41848) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gnurE-0000Li-0L; Sun, 27 Jan 2019 19:33:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:To:From:Subject:Date:References:In-Reply-To:Message-ID; bh=47Vp4KhTzLF1BJypVHPBBmV/GNF9sVRFkGtp95OC7Y8=; b=RNSl5RYudONMIWqkf8KKfHhg3VId9TsXqxUCOrIfkwazmKKJpUqiIq/IiE5FtNBKXbG5enHNvlB28yttNyxiZSr1QKMhbXr3S4BOs3YRcgveP2eWeVPDh7FAaL7rD1m3oRJH0HRLDTz5J64/NV0y1JbOiIfhMDNfmLtRxe2Nea/ZvFJEvyrlOXa7mrvQYf6gfpQ1/3CEerte+M8UHGuVMyY7SfCaVDYtp/efhGb684EEMT9dPVHON8X1TVCDhpGxL1zAnnIjFpC9eGDy9EDcPVXCPFYzFxm2oCfaF83Zp8X6el0OI/K6DgHzPu537XYYDiXKMgzgWvwZTf1GdiB0Uw==; Original-Received: from localhost ([127.0.0.1] helo=dancol.org) by dancol.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gnur8-00024d-1E; Sun, 27 Jan 2019 16:32:54 -0800 Original-Received: from 127.0.0.1 (SquirrelMail authenticated user dancol) by dancol.org with HTTP; Sun, 27 Jan 2019 16:32:54 -0800 In-Reply-To: X-Priority: 3 (Normal) Importance: Normal X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:232744 Archived-At: > Andreas Schwab wrote: >> On Jan 27 2019, Daniel Colascione wrote: >> >>> Why not? Plenty of other programs do. Looking at realpath(argv[0]) is >>> what >>> _everyone_ does. >> Which one? They are all broken. > > Andreas is quite right here. One cannot trust realpath (argv[0]). > > This discussion is reminding me what a hassle that dump file is. I plan to > look > into the possibility of putting the dump file inside the executable > (portably, > of course) so that Emacs startup needn't worry about finding the dump > file. This > would be significantly better for installers and users. No, he's wrong. Looking at argv[0] is normal practice. GCC does it. GDB does it. Python does it. The Perl cookbook tells people to do it. Running with the wrong argv[0] is an imaginary requirement that achieves nothing and is required for no real-world use case. When is argv[0] ever actually wrong? Besides, we _already_ do the moral equivalent of realpath(argv[0]), in init_cmdargs, which sets invocation-directory and from there various internal paths, including installation-directory. If you run Emacs (26, pre-pdumper) with the wrong argv0, and Emacs isn't installed, then Emacs falls over and dies, unable to find simple.el. What we should do is use the argv[0] directory more consistently, not make Emacs brittle and non-relocatable for no reason. It's unreal to see something we've done since at least 1994 and that GCC and GDB *also* do, presumably for just as long, suddenly called some intolerable bug. No, it's not. We do need to make the case of argv[0] being a symlink work correctly. I imagine gnulib has a realpath: we should use it. There's no other bug here.