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.bugs Subject: bug#55305: 28.0.50: With async nativecomp, package manager fails to load hyperbole-autoloads.el before compilation Date: Sun, 15 May 2022 20:01:53 +0300 Message-ID: <83a6bik9vi.fsf@gnu.org> References: <83czgekby6.fsf@gnu.org> <83bkvykbpx.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22009"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rsw@gnu.org, rswgnu@gmail.com, 55305@debbugs.gnu.org, akrl@sdf.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 15 19:03:13 2022 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 1nqHeD-0005Wl-Lp for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 May 2022 19:03:13 +0200 Original-Received: from localhost ([::1]:57372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqHeC-0004gA-Dc for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 May 2022 13:03:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqHe4-0004fl-0J for bug-gnu-emacs@gnu.org; Sun, 15 May 2022 13:03:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56658) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nqHe2-0005mN-Ke for bug-gnu-emacs@gnu.org; Sun, 15 May 2022 13:03:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nqHe2-0004EK-HD for bug-gnu-emacs@gnu.org; Sun, 15 May 2022 13:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 May 2022 17:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55305 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 55305-submit@debbugs.gnu.org id=B55305.165263413516202 (code B ref 55305); Sun, 15 May 2022 17:03:02 +0000 Original-Received: (at 55305) by debbugs.gnu.org; 15 May 2022 17:02:15 +0000 Original-Received: from localhost ([127.0.0.1]:50555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqHdH-0004DG-0M for submit@debbugs.gnu.org; Sun, 15 May 2022 13:02:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqHdF-0004D2-92 for 55305@debbugs.gnu.org; Sun, 15 May 2022 13:02:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50968) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqHd9-0005gx-VU; Sun, 15 May 2022 13:02:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=tLuEn8SEYUVl4sIFB9T3mtzABwRFQcAw1ZnAxyI5lek=; b=SXMw8djKOsVZ mdKevG745obDxuV4xrpw5v1nTwb+5a9IFGU+rlQHPq3zzfgOu/YdtMhHSuA+7k+N20YotyvwaPzZ+ +xN5Ww3BbLnyV9pn3VmJ8sq71C0Px1Cr6q6lBkcdTieXX9h3RFGS3ExRPrVTPBqg9bB6Wia/w8dsj y5/XAJLozBUTzne48sNK23vfMVHdeiyX2xkLe2L47WVE9FIlhCiiqzMWEjHZZ2wj1LqufEuW/nOAC 7n0oLLGCEnPz4jV1LcCpDphfn+eTX+a8Uyxf7r8o7AJOMTUt5BOdxhRqDoKmZ32j9u8VTRFikAcPs gIv0aKIH6RpPUeiKKCK8dA==; Original-Received: from [87.69.77.57] (port=1502 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 1nqHd9-0001Nk-Da; Sun, 15 May 2022 13:02:07 -0400 In-Reply-To: (message from Stefan Monnier on Sun, 15 May 2022 12:47:00 -0400) 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" Xref: news.gmane.io gmane.emacs.bugs:232337 Archived-At: > From: Stefan Monnier > Cc: akrl@sdf.org, 55305@debbugs.gnu.org, rswgnu@gmail.com, rsw@gnu.org > Date: Sun, 15 May 2022 12:47:00 -0400 > > > I don't see why comp.el should call package-related functions (or > > indeed know anything about packages and distinguish between packages > > and other Lisp files). It makes no sense to me. Compilation should > > not consider user customizations or be dependent on them. > > Compiling a `.el` file requires loading files, running macros, and > calling functions, all of which may not come with Emacs and may depend > on the user's specific customizations and set of installed packages > (regardless of whether they're installed via package.el or some other > way). > > So in order for the compilation to happen correctly, our async workers > need to mimic to some extent the currently running Emacs session. That was never the way byte-compilation worked in Emacs. We have all those 'require' and 'eval-when-compile' things precisely so a file can tell the compiler what is needed for the compilation. And we _need_ a way to make the compilation be completely independent of any local customizations or installed packages. > My suggested patch adds the call to `package-activate-all` which is > usually executed in `startup.el` between loading `early-init.el` and > `init.el` and whose intention is to initialize things for the > user-installed packages much like things are unconditionally initialized > for the bundled packages (i.e. enough so it's easy to use them, but > sufficiently little that it doesn't get in the way if the user doesn't > want to use the package). We don't call package-activate-all at startup when Emacs is told to ignore user and site customizations. That is NOT an accident, that is the only way to have *.elc and *.eln files that can be copied to another system and still work the same. Changing this makes no sense. I'm firmly against doing this. > AFAIK the only way to make async compilation work reliably is to make it > generate the `.eln` file without using the `.el` file (i.e. using the > `.elc` file instead, which can be compiled without having to load any > user-installed file, expand any macro, or run any user-installed > function). That will also save us from mis-compiling file and from > (re)emitting compilation warnings. This is unrelated, and is an entirely different discussion (which comes up from time to time, and we didn't yet find a way around the obstacles).