Received: (at 81710) by debbugs.gnu.org; 31 Aug 2026 11:24:21 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 31 07:24:21 2026 Received: from localhost ([127.0.0.1]:51041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1x107h-0005gU-2a for submit <at> debbugs.gnu.org; Mon, 31 Aug 2026 07:24:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58932) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1x107e-0005gC-HG for 81710 <at> debbugs.gnu.org; Mon, 31 Aug 2026 07:24:19 -0400 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 <eliz@HIDDEN>) id 1x107Y-0005PA-Qp; Mon, 31 Aug 2026 07:24:12 -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=6PBd9NRiRf5UJWqatRrtEoaReSsV0n4IdxYr9SJeNKU=; b=jLuvXN6bkgsE KBHMsvPzZt/GIqlvLMR6iRqGVOweP2KoaSavrvaRVwaB/Rj97grqxjNBH6nzGY/FS42bo2I9eLcqA yZ11kNpHMGtB79WzYhTsjlw2GF2t6jtxvujWoK44TMBTdYGg5nR+g8rrJBTcVIDCI2OyVNuRqbKik 8uE8UXLPOnFLwIIzQC+59RNVQJ8t8yN3TrPq/Ie05Te6LMnooofexq9sSC3KzPDxiKDWONB5YN5HG BmRVFC3r7RyHZxvI2aDJLbSKV4v+XAyjAo6ceriXUikWVt8W/J1kqO5Wuawjkyy1Ecqg/5iJ36KMi WIe4L5nBBHBZ4WMMjMa08A==; Date: Mon, 31 Aug 2026 14:24:09 +0300 Message-Id: <86v78q8rdy.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Stefan Monnier <monnier@HIDDEN>, John Wiegley <johnw@HIDDEN> In-Reply-To: <jwv8q5nf0o8.fsf-monnier+emacs@HIDDEN> (bug-gnu-emacs@HIDDEN) Subject: Re: bug#81710: 32.0.50; Byte-compiling `(use-package ...)` has nasty side-effects References: <jwv4igh1o9v.fsf-monnier+@gnu.org> <87se3y8dan.fsf@HIDDEN> <jwvjypakpus.fsf-monnier+emacs@HIDDEN> <jwv8q5nf0o8.fsf-monnier+emacs@HIDDEN> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 81710 Cc: 81710 <at> debbugs.gnu.org, johnw@HIDDEN, spwhitton@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) > Cc: 81710 <at> debbugs.gnu.org, John Wiegley <johnw@HIDDEN> > Date: Sun, 30 Aug 2026 23:32:07 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> > > So, I propose the patch below. > Comments? Objections? > > >From 896900d70150dbb67b272bc1f42bdcb7fe664d7e Mon Sep 17 00:00:00 2001 > From: Stefan Monnier <monnier@HIDDEN> > Date: Sun, 30 Aug 2026 23:30:36 -0400 > Subject: [PATCH] (use-package-handler/:ensure): Fix bug#81710 > > * lisp/use-package/use-package-ensure.el (use-package-ensure-elpa): > Require `package` more lazily since `package-installed-p` doesn't need it. > (use-package-handler/:ensure): Don't install packages as side effects > during compilation. > --- > etc/NEWS | 8 ++++++++ > lisp/use-package/use-package-ensure.el | 12 ++++++------ > 2 files changed, 14 insertions(+), 6 deletions(-) > > diff --git a/etc/NEWS b/etc/NEWS > index abd1c7446df..591524695f3 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -158,6 +158,14 @@ for nearby fields. > > * Changes in Specialized Modes and Packages in Emacs 32.1 > > +** Use-Package > +*** ':ensure t' installs the package only at run-time. > +In previous versions, it tried to install it more eagerly during > +compilation, but such side-effects are not welcome during compilation. > +If you want to make sure your packages are all already installed after > +byte-compiling your init file, just (re)load it into the current Emacs > +session. Shouldn't we leave behind an option to get back old behavior? I suppose there are people out there who are happy with eager installation as we do today.
bug-gnu-emacs@HIDDEN:bug#81710; Package emacs.
Full text available.
Received: (at 81710) by debbugs.gnu.org; 31 Aug 2026 03:32:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 30 23:32:20 2026
Received: from localhost ([127.0.0.1]:46470 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1x0skt-0003JI-Qd
for submit <at> debbugs.gnu.org; Sun, 30 Aug 2026 23:32:20 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:8065)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
id 1x0skq-0003It-G0
for 81710 <at> debbugs.gnu.org; Sun, 30 Aug 2026 23:32:17 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1D1734412D6;
Sun, 30 Aug 2026 23:32:10 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
s=mail; t=1788147128;
bh=+dHbhKDUQEbbsSnXWfmPjeq/uuYvOtbRdIOtl6B/TFI=;
h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
b=nEDu6imryvXf6whlkew5+JY/aBZVDZLZ5RW0KKdX440TXMSZRUMNGSe9KqylUm2vv
8vHx2BA9UyugU/uvne7MMOyUElhlDiqQHI3DyQp15BcW8CFR6XBtZ1MaSJAIWLQQEj
Tvpn/CHocgvv7uRMjI4Tr9GX/mtvVNL1DtgWwCzAKmjZ800D9wbzc30h2+eRV5h+ky
nYTJ/JcM76DA6H+gZkUtHGgqpXPfPhiQ8yTUxUrkz+4687yb9caRH2CNwriO6Xu9IA
2+FkhBwPSkTS9VhIcGrrCOsytBcUmU9XYkppglDGAjhGrNrnXTZk69kefASjTVDgu3
FDYCaGkCz2Bjg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 89165441261;
Sun, 30 Aug 2026 23:32:08 -0400 (EDT)
Received: from alfajor (104-195-193-66.cpe.teksavvy.com [104.195.193.66])
by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5733B1203C3;
Sun, 30 Aug 2026 23:32:08 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
Subject: Re: bug#81710: 32.0.50; Byte-compiling `(use-package ...)` has
nasty side-effects
In-Reply-To: <jwvjypakpus.fsf-monnier+emacs@HIDDEN>
Message-ID: <jwv8q5nf0o8.fsf-monnier+emacs@HIDDEN>
References: <jwv4igh1o9v.fsf-monnier+@gnu.org>
<87se3y8dan.fsf@HIDDEN>
<jwvjypakpus.fsf-monnier+emacs@HIDDEN>
Date: Sun, 30 Aug 2026 23:32:07 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-SPAM-INFO: Spam detection results: 0
ALL_TRUSTED -1 Passed through trusted hosts only via SMTP
AWL 0.148 Adjusted score from AWL reputation of From: address
BAYES_00 -1.9 Bayes spam probability is 0 to 1%
DKIM_SIGNED 0.1 Message has a DKIM or DK signature,
not necessarily valid
DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
domain
DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
domain
X-SPAM-LEVEL:
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 81710
Cc: 81710 <at> debbugs.gnu.org, John Wiegley <johnw@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
--=-=-=
Content-Type: text/plain
> diff --git a/lisp/use-package/use-package-ensure.el b/lisp/use-package/use-package-ensure.el
> index 5980093bca0..447ed381243 100644
> --- a/lisp/use-package/use-package-ensure.el
> +++ b/lisp/use-package/use-package-ensure.el
> @@ -152,7 +152,7 @@ use-package-handler/:ensure
> ;; being macro-expanded by elisp completion (see `lisp--local-variables'),
> ;; but still install packages when byte-compiling, to avoid requiring
> ;; `package' at runtime.
> - (if (bound-and-true-p byte-compile-current-file)
> + (if nil ;; (macroexp-compiling-p)
> ;; Eval when byte-compiling,
> (funcall use-package-ensure-function name ensure state)
> ;; or else wait until runtime.
So, I propose the patch below.
Comments? Objections?
=== Stefan
--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
filename=0001-use-package-handler-ensure-Fix-bug-81710.patch
From 896900d70150dbb67b272bc1f42bdcb7fe664d7e Mon Sep 17 00:00:00 2001
From: Stefan Monnier <monnier@HIDDEN>
Date: Sun, 30 Aug 2026 23:30:36 -0400
Subject: [PATCH] (use-package-handler/:ensure): Fix bug#81710
* lisp/use-package/use-package-ensure.el (use-package-ensure-elpa):
Require `package` more lazily since `package-installed-p` doesn't need it.
(use-package-handler/:ensure): Don't install packages as side effects
during compilation.
---
etc/NEWS | 8 ++++++++
lisp/use-package/use-package-ensure.el | 12 ++++++------
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index abd1c7446df..591524695f3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -158,6 +158,14 @@ for nearby fields.
* Changes in Specialized Modes and Packages in Emacs 32.1
+** Use-Package
+*** ':ensure t' installs the package only at run-time.
+In previous versions, it tried to install it more eagerly during
+compilation, but such side-effects are not welcome during compilation.
+If you want to make sure your packages are all already installed after
+byte-compiling your init file, just (re)load it into the current Emacs
+session.
+
** Package
---
diff --git a/lisp/use-package/use-package-ensure.el b/lisp/use-package/use-package-ensure.el
index 5980093bca0..116cb36ee61 100644
--- a/lisp/use-package/use-package-ensure.el
+++ b/lisp/use-package/use-package-ensure.el
@@ -120,11 +120,11 @@ use-package-ensure-elpa
(or (and (eq ensure t) (use-package-as-symbol name))
ensure)))
(when package
- (require 'package)
(when (consp package)
(use-package-pin-package (car package) (cdr package))
(setq package (car package)))
(unless (package-installed-p package)
+ (require 'package)
(condition-case-unless-debug err
(progn
(when (assoc package (bound-and-true-p
@@ -148,11 +148,11 @@ use-package-ensure-elpa
(defun use-package-handler/:ensure (name _keyword ensure rest state)
(let* ((body (use-package-process-keywords name rest state))
(ensure (and (not (plist-member rest :vc)) ensure)))
- ;; We want to avoid installing packages when the `use-package' macro is
- ;; being macro-expanded by elisp completion (see `lisp--local-variables'),
- ;; but still install packages when byte-compiling, to avoid requiring
- ;; `package' at runtime.
- (if (bound-and-true-p byte-compile-current-file)
+ ;; We used to eagerly install packages during compilation so as
+ ;; avoid requiring `package' at runtime, but such side-effects
+ ;; during compilation are nor welcome (bug#81710), so we don't
+ ;; do that anymore.
+ (if nil ;; (macroexp-compiling-p)
;; Eval when byte-compiling,
(funcall use-package-ensure-function name ensure state)
;; or else wait until runtime.
--
2.53.0
--=-=-=--
bug-gnu-emacs@HIDDEN:bug#81710; Package emacs.
Full text available.
Received: (at 81710) by debbugs.gnu.org; 28 Aug 2026 19:45:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 28 15:45:18 2026
Received: from localhost ([127.0.0.1]:51176 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1x02Vn-0005ev-IG
for submit <at> debbugs.gnu.org; Fri, 28 Aug 2026 15:45:17 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:8288)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
id 1x02Vk-0005cv-0z
for 81710 <at> debbugs.gnu.org; Fri, 28 Aug 2026 15:45:13 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3DBCF442543;
Fri, 28 Aug 2026 15:36:09 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
s=mail; t=1787945767;
bh=I+uQonoPlZAd4jqUyT2mg9uhGhaN7KybUOYq7MTv7PA=;
h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
b=b/3R0PYgeqNd9ILc6XO25QuqJmdDgBgm+5P2rJa0WIpEXjzuIO7FN0O+wWloGleWa
aT3TPSbfRObk8pPgDYS/42C3CVLGeIIkZEAy3viiHu+veBmk44qwFecFeGof9ITG6F
QLAowp66N7G0SOrcZ6UwAKwUeSRUX6xqgkYwhVaHhgX6stBGVjSoj3BMOmjimMGbyg
46rdJs4LxGvt5cJB4JFj9ree3iNGQ9AFXAGllk8/v3qUg9cVtvDaVhtVCbChSH7Mug
c2klmNYkK8EFWnvUSOYtfJQgntvx/uhgtc4ZICzaCoBa8qt8ioWjvYBG7vfej7NfV8
fgBuI1EdtWoag==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A7CD844224E;
Fri, 28 Aug 2026 15:36:07 -0400 (EDT)
Received: from alfajor (unknown [23.233.239.192])
by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 889491202F4;
Fri, 28 Aug 2026 15:36:07 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
Subject: Re: bug#81710: 32.0.50; Byte-compiling `(use-package ...)` has
nasty side-effects
In-Reply-To: <87se3y8dan.fsf@HIDDEN>
Message-ID: <jwvjypakpus.fsf-monnier+emacs@HIDDEN>
References: <jwv4igh1o9v.fsf-monnier+@gnu.org>
<87se3y8dan.fsf@HIDDEN>
Date: Fri, 28 Aug 2026 15:36:06 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results: 0
ALL_TRUSTED -1 Passed through trusted hosts only via SMTP
BAYES_00 -1.9 Bayes spam probability is 0 to 1%
DKIM_SIGNED 0.1 Message has a DKIM or DK signature,
not necessarily valid
DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
domain
DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
domain
X-SPAM-LEVEL:
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 81710
Cc: 81710 <at> debbugs.gnu.org, John Wiegley <johnw@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
Sean Whitton [2026-08-28 16:39:28] wrote:
> Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" [26/Aug 12:56am -04] wrote:
>> Package: Emacs
>> Version: 32.0.50
>>
>> Compiling a file which contains a form like:
>>
>> (use-package MYPKG :ensure t)
>>
>> will cause network access to fetch ELPA's `archive-contents` and try to
>> install MYPKG if isn't already installed. This is highly unexpected
>> and unusual. Those side-effects should happen at run-time but not at
>> compile-time.
>
> Ouch. I guess that we need to make use-package-handler/:ensure do
> nothing when (macroexp-compiling-p) returns non-nil?
AFAICT the patch below fixes the problem, but clearly it goes against
the original design, which considers this bug as a feature.
IIUC the original design tries to cater to the case where we're
compiling the `init.el` file which contains a call like
(use-package MYPKG :ensure t)
at toplevel. But in the case of `slime-xterm-color.el`, this is not an
init file and the `use-package` call is within an `if` which makes it
much more clearly problematic.
I'm not sure the case of the init file is important enough to warrant
that kind of undesirable behavior. It seems a lot simpler to get the
same benefit in a different way, e.g. by (re)loading the init file right
after compiling it.
=== Stefan
diff --git a/lisp/use-package/use-package-ensure.el b/lisp/use-package/use-package-ensure.el
index 5980093bca0..447ed381243 100644
--- a/lisp/use-package/use-package-ensure.el
+++ b/lisp/use-package/use-package-ensure.el
@@ -152,7 +152,7 @@ use-package-handler/:ensure
;; being macro-expanded by elisp completion (see `lisp--local-variables'),
;; but still install packages when byte-compiling, to avoid requiring
;; `package' at runtime.
- (if (bound-and-true-p byte-compile-current-file)
+ (if nil ;; (macroexp-compiling-p)
;; Eval when byte-compiling,
(funcall use-package-ensure-function name ensure state)
;; or else wait until runtime.
bug-gnu-emacs@HIDDEN:bug#81710; Package emacs.
Full text available.Received: (at 81710) by debbugs.gnu.org; 28 Aug 2026 15:39:39 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 28 11:39:39 2026 Received: from localhost ([127.0.0.1]:50674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1wzyg7-0005hw-3X for submit <at> debbugs.gnu.org; Fri, 28 Aug 2026 11:39:39 -0400 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]:54453) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>) id 1wzyg4-0005h2-0h for 81710 <at> debbugs.gnu.org; Fri, 28 Aug 2026 11:39:37 -0400 Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id 1F15E1D00136; Fri, 28 Aug 2026 11:39:30 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Fri, 28 Aug 2026 11:39:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1787931569; x= 1788017969; bh=XETP5KCZ9Yf52eY96o86Ld97gGRe6bITZ+mVBLRC/Zk=; b=I A+cpY2zTBInmdq1w92wVuMKbxGfrV2jYUA/Zf75H+HsJI+nj37lCJK7pJvZQ/5jI IapIi3AXC6qGjUTaMXsCdF6bsN3Nj44FarzQcGZ/XiXJfNz5yFuRisYMe8oScNbm rGhJ0IGFbiaSDFjIl1tax12QfISj4j03v2DA0/4rbseUQVJ6ttgYNhsoCo9zbCu9 HoAQvy4Van/1Of6xi6E9w7iFX9PPF+sTcwcAR0cqJA/Gk3ps/pqis0/BHnlF1wjh FbPJyleB5SP69whBxyhta7DYpTcOjSRIjDk5wAfKSwqXQbBqZG/WzFNOzlM7Lm/v T3dLn33w+Pg2yK5h8iyOw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1787931569; x=1788017969; bh=XETP5KCZ9Yf52eY96o86Ld97gGRe6bITZ+m VBLRC/Zk=; b=Wm/EEuSBMIy091IjxazrgzKCm/jE1ZItACbjnSge4i3ENjuz5LB pEM9Y6Ps3hJN2APxu4Zgzl/Qct3LdUHVV4ZBmOzWDjd8ZtPPtOlCAv5+0HTUp7J4 7RNVA4wlBArHpV+54YdnGHv5W3CPz0VOvGmQkGtzO1l8lXPMjvuNXu5TJ3VuDALc 235OxHxAk7uiDZJpvnwz/E7Udqwrcc37DACDnHUm3xOp+ARYxV3J5SevEAn1UYQ0 DlRaesuMxhJoY4mi87D8xDlOBUW+Jy9OAKf1HsYh4dlh9xmDOemAms77hBx4TY0w 3pdKu6DMT3hwTMl6KHxvwjklQK+U5qT4baQ== X-ME-Sender: <xms:sauRapuTUjxfISkKIuZJU4C3M-SDhmXzZGBQcPav5hKtvhzY8SJ76w> <xme:sauRaqOedEWBYMGlCESmcvymRFzqRkOVRJmaXwJdm4IayZXlYUjzcHi2zlXegBbJt f4IPQVapbswAR2KRtvww_QibkItN76GsnsYSZChNv5VzZueF2KjT9p7> X-ME-Received: <xmr:sauRav1401vU1ROTvWgOWK9YlUWf-goV3nG30eG0YHF5C9U6E5Ycwe6iidPdbs8NPErq7CfVQcRqzQW3Qs4NlAa8x3e0RpZhfw> X-ME-Proxy-Cause: dmFkZTFY0Ht4FUtMVF+KPCTo7LPQBYZrgiOjbohVzdqixq2cx/7xfW3WnUtJ+lT7Urwm9O POpdntp+g05gL2+UNTLzIIcIOFSdCDcpFVBpJS4jRLUugv5/dxMwAzT0s59hB/7a3KMukD XzTBYWR98LPH6shzAN+xz5RCTtjQn4ZGh9SqxHYIeZTk8ofdWjsY8Tpd67FrduZgHml0ID 1WlIzxJWBdUkwpgUKr6z6h9evXkBNatWhkV5A65yd2g8ek6F2j7/x6mrcTtKcGFpZsz89M vujlHBB+cDSisryICasuwoLRMY3uADM5NVY8XRTZ/GBOLlhs+qMG8u8ZrxFWfNNeCki7ov bIbcaCVvoS3ISKrsuoRh3HtmThEsh1QL0WR2jvNl9weW3EKjUrFGcXJEl8bf99hJ+kf7Rh ceH94sBAylBkmsNRpL6OXTC4YfOyuMENuUaTmtRVBYPA3Sd8qdCJA47kTjCvdBd1trfNCW mW3hv5AxA4CfyJZMI3zn5M67tGA8sOr3QexN2zGjG8iYyR246FB748e7/1+MN1LSH597N7 K3uwQl5D6xbg6uI7kAQb6deKfv1sILCKk0XJGJi3d2EIeWLuUqLrRPNsRNppo5UeofcVtG ij9eAkeFTY4EdEvnd7bdMB0AA1+01+UyERYpb/cpDv3/t9a0XVyc4jwjMxrA X-ME-Proxy: <xmx:sauRauNSixHprP0wOXhG36WEOvkubTRGjYbF5OIVxRbxEGFe_1twRQ> <xmx:sauRan1G4VV_f3JFKE_AZjdgAR2eivJfz7JDTeEJVGFcjVmkTCSXhQ> <xmx:sauRatERqroACB-HL1pwZENT3sbNxXXaS4_2pOqqrv7MBExgZ6BFbA> <xmx:sauRas5pAV-hIGCwIF1K_8oGqP-m1WBdiLFxeOqeA4jeNLwf-WbCJg> <xmx:sauRamri_sserGtDvZ_cRafDLT6kNWVeer6kaZP-xoWAISOuYmUmMoC5> Feedback-ID: i62564b17:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 28 Aug 2026 11:39:29 -0400 (EDT) Received: by athena.silentflame.com (Postfix, from userid 1000) id 7A7E52828B9; Fri, 28 Aug 2026 16:39:28 +0100 (BST) From: Sean Whitton <spwhitton@HIDDEN> To: 81710 <at> debbugs.gnu.org Subject: Re: bug#81710: 32.0.50; Byte-compiling `(use-package ...)` has nasty side-effects In-Reply-To: <jwv4igh1o9v.fsf-monnier+@gnu.org> References: <jwv4igh1o9v.fsf-monnier+@gnu.org> Date: Fri, 28 Aug 2026 16:39:28 +0100 Message-ID: <87se3y8dan.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 81710 Cc: John Wiegley <johnw@HIDDEN>, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" [26/Aug 12:56am -04] wrote: > Package: Emacs > Version: 32.0.50 > > Compiling a file which contains a form like: > > (use-package MYPKG :ensure t) > > will cause network access to fetch ELPA's `archive-contents` and try to > install MYPKG if isn't already installed. This is highly unexpected > and unusual. Those side-effects should happen at run-time but not at > compile-time. Ouch. I guess that we need to make use-package-handler/:ensure do nothing when (macroexp-compiling-p) returns non-nil? -- Sean Whitton
bug-gnu-emacs@HIDDEN:bug#81710; Package emacs.
Full text available.
Received: (at submit) by debbugs.gnu.org; 26 Aug 2026 04:57:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 26 00:57:07 2026
Received: from localhost ([127.0.0.1]:57064 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1wz5hD-00057X-03
for submit <at> debbugs.gnu.org; Wed, 26 Aug 2026 00:57:07 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:42768)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
id 1wz5hB-00056s-AP
for submit <at> debbugs.gnu.org; Wed, 26 Aug 2026 00:57:05 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
id 1wz5h5-0002Il-QL
for bug-gnu-emacs@HIDDEN; Wed, 26 Aug 2026 00:56:59 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
id 1wz5h4-0003MK-7Z
for bug-gnu-emacs@HIDDEN; Wed, 26 Aug 2026 00:56:59 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 597D9440726
for <bug-gnu-emacs@HIDDEN>; Wed, 26 Aug 2026 00:56:56 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
s=mail; t=1787720214;
bh=Wp1i3qCOn9ev+5+fbPjVo4iAa1WvUnx0JqKZ0gnN+Es=;
h=From:To:Subject:Date:From;
b=d8W9E64dgJKaTHHOrg+sDZWcQHb+GgsAp23wPS727yMI+mngQKp/tsBqER2pFTGDc
VwvSXclbBBKh9l7BOQEFDJ4DFN9258RprdGhTaz/BCL9Z7+SZbr+lcYOIspeEGxIkC
pglemw7Q8nM4MXqS4eSVMW1iLfefXwJtj9Nj4hU+YtH/wbQDQ542XfXzBiW+kEafnr
9ZUiCaETln8vYVJJT8xID1YdeIC16OHH2pf78OPpO3oQ/GQ1uOTdriy8nEh/WV5pr4
MDzyD3QxPb3FYyGUIurAXkX3ys88d0siUyboKMKHpPtdkfGW2wrw3uwBZDsBYfJjYo
gMIxWco9f3WZw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D76264405F2
for <bug-gnu-emacs@HIDDEN>; Wed, 26 Aug 2026 00:56:54 -0400 (EDT)
Received: from pastel (104-195-211-127.cpe.teksavvy.com [104.195.211.127])
by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B5C2C12055D
for <bug-gnu-emacs@HIDDEN>; Wed, 26 Aug 2026 00:56:54 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 32.0.50; Byte-compiling `(use-package ...)` has nasty side-effects
Message-ID: <jwv4igh1o9v.fsf-monnier+@gnu.org>
X-Debbugs-Cc: monnier@HIDDEN, John Wiegley <johnw@HIDDEN>
Date: Wed, 26 Aug 2026 00:56:53 -0400
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results: 0
ALL_TRUSTED -1 Passed through trusted hosts only via SMTP
AWL 0.127 Adjusted score from AWL reputation of From: address
BAYES_00 -1.9 Bayes spam probability is 0 to 1%
DKIM_SIGNED 0.1 Message has a DKIM or DK signature,
not necessarily valid
DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
domain
DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
domain
X-SPAM-LEVEL:
Received-SPF: pass client-ip=132.204.25.50;
envelope-from=monnier@HIDDEN; helo=mailscanner.iro.umontreal.ca
X-Spam_score_int: -42
X-Spam_score: -4.3
X-Spam_bar: ----
X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3,
SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Package: Emacs
Version: 32.0.50
Compiling a file which contains a form like:
(use-package MYPKG :ensure t)
will cause network access to fetch ELPA's `archive-contents` and try to
install MYPKG if isn't already installed. This is highly unexpected
and unusual. Those side-effects should happen at run-time but not at
compile-time.
Example backtrace:
use-package-ensure-elpa(xterm-color (t) nil)
use-package-handler/:ensure(xterm-color :ensure (t) ... nil)
use-package-process-keywords(xterm-color ... nil)
#f(compiled-function (name &rest args) ...)(xterm-color :ensure t)
apply(#f(compiled-function (name &rest args) ...) (xterm-color :ensure t))
macroexpand-1((use-package xterm-color :ensure t) ...)
macroexp-macroexpand((use-package xterm-color :ensure t) ...)
macroexp--expand-all((use-package xterm-color :ensure t))
[...]
byte-compile-from-buffer(#<buffer *Compiler Input*>)
byte-compile-file(".../slime-xterm-color.el")
batch-byte-compile-file(".../slime-xterm-color.el")
batch-byte-compile()
where `use-package-ensure-elpa` does:
(defun use-package-ensure-elpa (name args _state &optional _no-refresh)
(dolist (ensure args)
(let ((package
(or (and (eq ensure t) (use-package-as-symbol name))
ensure)))
(when package
(require 'package)
(when (consp package)
(use-package-pin-package (car package) (cdr package))
(setq package (car package)))
(unless (package-installed-p package)
(condition-case-unless-debug err
(progn
(when (assoc package (bound-and-true-p
package-pinned-packages))
(package-read-all-archive-contents))
(if (assoc package package-archive-contents)
(package-install package)
(package-refresh-contents)
(when (assoc package (bound-and-true-p
package-pinned-packages))
(package-read-all-archive-contents))
(package-install package))
t)
[...]))))))
=== Stefan
Stefan Monnier <monnier@HIDDEN>:monnier@HIDDEN, johnw@HIDDEN, bug-gnu-emacs@HIDDEN.
Full text available.monnier@HIDDEN, johnw@HIDDEN, bug-gnu-emacs@HIDDEN:bug#81710; Package emacs.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.