From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#74368: 31.0.50; Different warnings between native-compile and native-compile-async Date: Sat, 16 Nov 2024 16:26:49 -0500 Message-ID: References: <39041F0A-3CD1-4665-9FE0-851334B3B37F@toadstyle.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18815"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74368@debbugs.gnu.org To: Sean Devlin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 16 22:27:17 2024 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 1tCQK5-0004iH-Ae for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Nov 2024 22:27:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCQJs-0008PL-32; Sat, 16 Nov 2024 16:27:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tCQJq-0008P5-HH for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 16:27:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tCQJq-0003aI-7e for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 16:27:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=KcZknKRkke9Ebo51R7ne5tzNQtIS3fUyYKz+ulsBQSA=; b=oPWOKX9OuxMEJjhFZDqYqKDVUJRPy2WE4PUEXROrRxy+sRbxujrmCq1KoKfTxkMpOXK1mV3/WpVsRoPRsTlpQvdLPgY5eh+/BkoldxjY0Le2f3OO7EsgYkNDFPHnVXIfh7nRgG8A3/a7E3/ov9UH0HY5iqIH6C3rck/EdXeGbvGs1hLmiDuYtWRGVgdxZU0fbsSBYRB/wQIpoyESc4w4kvBrRlY2m17Sl1/w2lp6QRJWaaTXfzluznmqzWegA8E5541X4Lau1u+0hbNTynC8Sn+20wRkf8Nmn72TcWQY+cAhg/JguGAJeDzMM6/Iu3ljXnA4ZViA4VVqvrb5TWPp+Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tCQJq-0008R5-1o for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 16:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2024 21:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74368 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 74368-submit@debbugs.gnu.org id=B74368.173179241832415 (code B ref 74368); Sat, 16 Nov 2024 21:27:02 +0000 Original-Received: (at 74368) by debbugs.gnu.org; 16 Nov 2024 21:26:58 +0000 Original-Received: from localhost ([127.0.0.1]:55016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCQJl-0008Qk-Ih for submit@debbugs.gnu.org; Sat, 16 Nov 2024 16:26:57 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCQJk-0008QY-1n for 74368@debbugs.gnu.org; Sat, 16 Nov 2024 16:26:57 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tCQJe-0003ZV-HF; Sat, 16 Nov 2024 16:26:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=KcZknKRkke9Ebo51R7ne5tzNQtIS3fUyYKz+ulsBQSA=; b=XM/g+AnPOqXhVZxJMTds VKDacSCcnxLvP0erbg4kITFKMxwyRvSMyEINZFabjNVjPi47eAd+0of4Ho9j78nVeBYpZp/03JzWS BU1JdDwnn1KPxycDvvgT5P+SFkKarXede3h9MxKV3CkgLEaOTtgLaE9mFlExdNIzWmPRl/d6u37Cs dpreFKgdV1bV7od7ss1WB/MEkt7ar6w86bBWhwlSLKmGGfNF0DMiUIKUNda9IV/7rpc30CW1gsYVI PWGik3/PSoxg42lH15zBE+QIcNOg2CCTakIa+mg/gXvIXLqXVdAAUxeRDBA1CWVK8/x/9apch20Zc Fy2ku1r9By3CEw==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1tCQJd-000519-Sk; Sat, 16 Nov 2024 16:26:49 -0500 In-Reply-To: <39041F0A-3CD1-4665-9FE0-851334B3B37F@toadstyle.org> (Sean Devlin's message of "Fri, 15 Nov 2024 12:04:42 -0500") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295497 Archived-At: Sean Devlin writes: > Hi folks, > > I'm not sure if this is a bug, but I noticed a difference in behavior > when compiling with native-compile and native-compile-async. > > Recipe: > > 1. mkdir /tmp/emacs-test > 2. printf ";; -*- lexical-binding: t; -*-\n\n(vertico-mode)\n" > /tmp/ema= cs-test/test.el > 2. HOME=3D/tmp/emacs-test emacs > 3. M-x package-install RET vertico RET > 4. M-: (native-compile "/tmp/emacs-test/test.el") RET > 5. M-! touch /tmp/emacs-test/test.el RET > 6. M-: (native-compile-async "/tmp/emacs-test/test.el") RET > > There is no warning when compiling synchronously, but there is a warning > during asynchronous compilation: > > test.el:3:2: Warning: the function =E2=80=98vertico-mode=E2=80=99 is not = known to be > defined. > > I guess maybe the asynchronous compiler has not processed the autoloads > from installed packages, whereas the synchronous compiler has. > > Is this difference in behavior expected? Or is one of the compilers > behaving incorrectly? > > Thanks! Hi Devlin, yes this difference is expected, 'native-compile' runs the compilation in the loaded Emacs so that all the definitions of loaded packages are known to the compiler. 'native-compile-async' runs in a new fresh Emacs so all requires need to be there in the compilation unit in order to let the compiler be able to load the definitions. We have also some doc in (info "(elisp) Native-Compilation Variables") which goes like this: A common cause for asynchronous native-compilation to produce warnings is compiling a file that is missing some =E2=80=98require=E2= =80=99 of a necessary feature. The feature may be loaded into the main emacs, but because native compilation always starts from a subprocess with a pristine environment, that may not be true for the subprocess. Regards Andrea