From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Native Compile: Example Of Possibly Spurious Warning Date: Mon, 17 May 2021 09:01:54 +0300 Message-ID: <83y2cducdp.fsf@gnu.org> References: <20210516205102.286BDC21098@raman-glaptop.localdomain> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36668"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: "T.V Raman" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 17 08:02:36 2021 Return-path: Envelope-to: ged-emacs-devel@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 1liWKp-0009I6-ND for ged-emacs-devel@m.gmane-mx.org; Mon, 17 May 2021 08:02:35 +0200 Original-Received: from localhost ([::1]:59814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liWKn-00088w-S6 for ged-emacs-devel@m.gmane-mx.org; Mon, 17 May 2021 02:02:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liWK7-0007Tq-1m for emacs-devel@gnu.org; Mon, 17 May 2021 02:01:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58196) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liWK6-0008PA-Ku; Mon, 17 May 2021 02:01:50 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4186 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liWK6-0004N5-6G; Mon, 17 May 2021 02:01:50 -0400 In-Reply-To: <20210516205102.286BDC21098@raman-glaptop.localdomain> 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269388 Archived-At: > From: "T.V Raman" > Date: Sun, 16 May 2021 13:51:02 -0700 (PDT) > > Here is an example. > > eak/lisp/emacspeak-preamble.el: Error: Symbol's value as variable is > void emacspeak-user-directory Disable showing Disable logging > The above file contains this innocent looking defvar: > (defvar emacspeak-user-directory (expand-file-name "~/.emacspeak/") > "Emacspeak resources, e.g. pronunciation dicts.") > > The only library it has required at that point is cl-lib > > In the running emacs, the variable emacspeak-user-directory has the > expected value: > "/home/raman/.emacspeak/" > > So why the warning above? How can we know without seeing the Lisp source file(s) relevant to this compilation? The answer is somewhere in those files. In general, native-compilation runs in a separate process that doesn't inherit the environment and loaded packages of your interactive session, so it is more sensitive to problems than when you byte-compile the same source from your interactive session. In particular, the Emacs sub-process that runs native-compilation is run in the batch mode, which doesn't load your init files. So you could try byte-compiling the same file from the shell prompt in batch mode, as an approximation to what native-compilation does; any warning or error you see in this batch byte-compilation will also happen in the async native-compilation.