From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Building Emacs from a new MinGW environment Date: Sat, 14 Sep 2013 17:50:40 +0300 Message-ID: <83ppsbfoe7.fsf@gnu.org> References: <83sixwfdjk.fsf@gnu.org> <834n9nhhp6.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1379170264 16022 80.91.229.3 (14 Sep 2013 14:51:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Sep 2013 14:51:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dani Moncayo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 14 16:51:06 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VKrBh-0000k6-SF for ged-emacs-devel@m.gmane.org; Sat, 14 Sep 2013 16:51:06 +0200 Original-Received: from localhost ([::1]:53621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKrBh-0007Wh-CN for ged-emacs-devel@m.gmane.org; Sat, 14 Sep 2013 10:51:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKrBZ-0007WB-EP for emacs-devel@gnu.org; Sat, 14 Sep 2013 10:51:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKrBT-0006bs-JA for emacs-devel@gnu.org; Sat, 14 Sep 2013 10:50:57 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:39061) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKrBT-0006bg-Af for emacs-devel@gnu.org; Sat, 14 Sep 2013 10:50:51 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MT400A00EDZWV00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Sat, 14 Sep 2013 17:50:49 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MT400A68EKPOCB0@a-mtaout21.012.net.il>; Sat, 14 Sep 2013 17:50:49 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163341 Archived-At: > Date: Sat, 14 Sep 2013 16:25:03 +0200 > From: Dani Moncayo > Cc: Emacs development discussions > > I've looked for the first call to "Fexpand_file_name" which returns a > "bad" file name (bad = containing a literal "%emacs_dir%"). It is > this one: > > #0 Fexpand_file_name (name=57476769, default_directory=57476785) > at C:/msys/home/dani/emacs/emacs.git/src/fileio.c:1437 > #1 0x01119643 in Fexpand_file_name (name=57476753, > default_directory=57422161) > at C:/msys/home/dani/emacs/emacs.git/src/fileio.c:930 > #2 0x011bf86f in init_callproc () > at C:/msys/home/dani/emacs/emacs.git/src/callproc.c:1616 > #3 0x010dad7c in main (argc=5, argv=0x972af8) > at C:/msys/home/dani/emacs/emacs.git/src/emacs.c:1325 > > The parameters of the call in frame #0 were: > (gdb) p SSDATA(name) > $1 = 0x36c4d50 <__register_frame_info+57429328> > "%emacs_dir%/share/emacs/24.3.50/etc/" > (gdb) p SSDATA(default_directory) > $3 = 0x36c4d7c <__register_frame_info+57429372> > "c:/msys/home/dani/emacs/build/src/" > > The parameters of the call in frame #1 were: > (gdb) p SSDATA(name) > $4 = 0x36c4d48 <__register_frame_info+57429320> "GNU" > (gdb) p SSDATA(default_directory) > $5 = 0x36c4204 <__register_frame_info+57426436> > "%emacs_dir%/share/emacs/24.3.50/etc/" > > IIUC, the function call at frame 0 failed to expand the default > directory passed to the function call at frame 1. > > Now, It seems to me that the code responsible for the expansion of > "%emacs_dir%" is this snippet of "Fexpand_file_name": > > /* If the file name has special constructs in it, > call the corresponding file handler. */ > handler = Ffind_file_name_handler (name, Qexpand_file_name); > if (!NILP (handler)) > { > handled_name = call3 (handler, Qexpand_file_name, > name, default_directory); > if (STRINGP (handled_name)) > return handled_name; > error ("Invalid handler in `file-name-handler-alist'"); > } > > But I observe that the call to "Ffind_file_name_handler" returns > "Qnil", and therefore the expansion (the call to "call3") is not > carried out. > > Debugging inside "Ffind_file_name_handler", I see that the "for" loop > is never entered. > > Does this gives you a clue of what is failing? If you need more info, > just tell me what commands should I run. You need to step further down into init_callproc. It should correctly initialize Vdata_directory here: if (data_dir == 0) { Lisp_Object tem, tem1, srcdir; srcdir = Fexpand_file_name (build_string ("../src/"), build_string (PATH_DUMPLOADSEARCH)); tem = Fexpand_file_name (build_string ("GNU"), Vdata_directory); tem1 = Ffile_exists_p (tem); if (!NILP (Fequal (srcdir, Vinvocation_directory)) || NILP (tem1)) { Lisp_Object newdir; newdir = Fexpand_file_name (build_string ("../etc/"), build_string (PATH_DUMPLOADSEARCH)); tem = Fexpand_file_name (build_string ("GNU"), newdir); tem1 = Ffile_exists_p (tem); if (!NILP (tem1)) Vdata_directory = newdir; <<<<<<<<<<<<<<<<<<<<<<<<<<<<< } } If that doesn't work, perhaps PATH_DUMPLOADSEARCH has the wrong value (it comes from src/epaths.h). If PATH_DUMPLOADSEARCH looks OK (it should not have any %emacs_dir% in it, then look at the value of 'tem' 3 lines above the line I marked: (gdb) p tem (gdb) xtype (gdb) xstring If the result of 'xstring' indeed shows the etc subdirectory of your Emacs source tree, then perhaps the trouble happens inside Ffile_exists_p: it should return non-nil in this case. You can display its result: (gdb) p tem1 (gdb) xtype (gdb) xsymbol