unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#72453: 29.4; "use-package" macro does not load all expected related files
@ 2024-08-03 21:58 Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-08-04  4:44 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-08-03 21:58 UTC (permalink / raw)
  To: 72453


This problem exists for the current emacs-30 branch HEAD.

The following "init.el" file contents provide a test case:

  (defun use-package-ensure-trace (name args state)
    (warn "use-package-ensure-trace %s %s %s" name args state)
    t)

  ;; (require 'use-package)

  (setq use-package-ensure-function 'use-package-ensure-trace)
  (setq use-package-always-ensure t)

  (use-package faces)
  (use-package ansi-color)
  (use-package files :ensure t)
  (use-package rx)
  (use-package avoid)

Place it in a scratch directory "use-package-ensure-test" and invoke
Emacs with, for example:

  emacs --init-directory use-package-ensure-test

The init file sets use-package-always-ensure to true, and we expect
trace warnings to show up for each use-package invocation.  In fact, we
only see them for the third and beyond.

 Warning (emacs): use-package-ensure-trace files (t) nil
 Warning (emacs): use-package-ensure-trace rx (t) nil
 Warning (emacs): use-package-ensure-trace avoid (t) nil

Uncomment the "require" line in the init file and we see all of the
traces that we expect:

 Warning (emacs): use-package-ensure-trace faces (t) nil
 Warning (emacs): use-package-ensure-trace ansi-color (t) nil
 Warning (emacs): use-package-ensure-trace files (t) nil
 Warning (emacs): use-package-ensure-trace rx (t) nil
 Warning (emacs): use-package-ensure-trace avoid (t) nil

The root cause is the structure of the "use-package/use-package*.el"
libraries.  The "use-package" macro exists in "use-package-core.el", and
has an autoload.  When Emacs evalutes a use-package form, Emacs loads
"use-package-core.el" only.  It does not load any of the other
"use-package*.el" components.  That means that Emacs doesn't evaluate
any of the `add-to-list' forms at the bottom of "use-package-ensure.el".
As a result, the use-package-defaults mechanism doesn't start out with
the expected :ensure or :pin behaviors.

But the first time we refer to an :ensure property explicitly, that is
enough to trigger the autoload of "use-package-handler/:ensure", which
loads the file and sets up the defaults.  All later invocations run the
:ensure checks as expected.

Moving the "use-package" macro into the top-level "use-package" file
should fix the problem.  The "use-package" file explicitly loads the
other files, which sets up all of the defaults.



In GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42,
 cairo version 1.18.0) of 2024-06-29, modified by Debian built on sbuild
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Debian GNU/Linux trixie/sid

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/libexec
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/29.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/29.4/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils
 --with-native-compilation --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/libexec
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/29.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/29.4/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils
 --with-native-compilation --with-cairo --with-x=yes
 --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -Werror=implicit-function-declaration
 -ffile-prefix-map=/build/reproducible-path/emacs-29.4+1=. -fstack-protector-strong
 -fstack-clash-protection -Wformat -Werror=format-security
 -fcf-protection -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
 LDFLAGS=-Wl,-z,relro'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2
XPM GTK3 ZLIB

-- 
Derek Upham
derek_upham@mailfence.com





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-03 21:58 bug#72453: 29.4; "use-package" macro does not load all expected related files Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-08-04  4:44 ` Eli Zaretskii
  2024-08-04  6:01   ` John Wiegley
  2024-08-04 14:46   ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-08-18 11:21 ` Stefan Kangas
  2024-08-21 12:46 ` Mattias Engdegård
  2 siblings, 2 replies; 13+ messages in thread
From: Eli Zaretskii @ 2024-08-04  4:44 UTC (permalink / raw)
  To: Derek Upham, John Wiegley; +Cc: 72453

> Date: Sat, 03 Aug 2024 14:58:08 -0700
> From:  Derek Upham via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> 
> This problem exists for the current emacs-30 branch HEAD.
> 
> The following "init.el" file contents provide a test case:
> 
>   (defun use-package-ensure-trace (name args state)
>     (warn "use-package-ensure-trace %s %s %s" name args state)
>     t)
> 
>   ;; (require 'use-package)
> 
>   (setq use-package-ensure-function 'use-package-ensure-trace)
>   (setq use-package-always-ensure t)
> 
>   (use-package faces)
>   (use-package ansi-color)
>   (use-package files :ensure t)
>   (use-package rx)
>   (use-package avoid)
> 
> Place it in a scratch directory "use-package-ensure-test" and invoke
> Emacs with, for example:
> 
>   emacs --init-directory use-package-ensure-test

Is this step necessary, i.e. does this problem has anything to do with
the non-default --init-directory setting?

> The init file sets use-package-always-ensure to true, and we expect
> trace warnings to show up for each use-package invocation.  In fact, we
> only see them for the third and beyond.
> 
>  Warning (emacs): use-package-ensure-trace files (t) nil
>  Warning (emacs): use-package-ensure-trace rx (t) nil
>  Warning (emacs): use-package-ensure-trace avoid (t) nil
> 
> Uncomment the "require" line in the init file and we see all of the
> traces that we expect:
> 
>  Warning (emacs): use-package-ensure-trace faces (t) nil
>  Warning (emacs): use-package-ensure-trace ansi-color (t) nil
>  Warning (emacs): use-package-ensure-trace files (t) nil
>  Warning (emacs): use-package-ensure-trace rx (t) nil
>  Warning (emacs): use-package-ensure-trace avoid (t) nil
> 
> The root cause is the structure of the "use-package/use-package*.el"
> libraries.  The "use-package" macro exists in "use-package-core.el", and
> has an autoload.  When Emacs evalutes a use-package form, Emacs loads
> "use-package-core.el" only.  It does not load any of the other
> "use-package*.el" components.  That means that Emacs doesn't evaluate
> any of the `add-to-list' forms at the bottom of "use-package-ensure.el".
> As a result, the use-package-defaults mechanism doesn't start out with
> the expected :ensure or :pin behaviors.
> 
> But the first time we refer to an :ensure property explicitly, that is
> enough to trigger the autoload of "use-package-handler/:ensure", which
> loads the file and sets up the defaults.  All later invocations run the
> :ensure checks as expected.
> 
> Moving the "use-package" macro into the top-level "use-package" file
> should fix the problem.  The "use-package" file explicitly loads the
> other files, which sets up all of the defaults.

John, any comments or suggestions?





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-04  4:44 ` Eli Zaretskii
@ 2024-08-04  6:01   ` John Wiegley
  2024-08-04  8:14     ` Eli Zaretskii
  2024-08-04 14:46   ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 13+ messages in thread
From: John Wiegley @ 2024-08-04  6:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 72453, Derek Upham

>>>>> Eli Zaretskii <eliz@gnu.org> writes:

>> Moving the "use-package" macro into the top-level "use-package" file should
>> fix the problem. The "use-package" file explicitly loads the other files,
>> which sets up all of the defaults.

> John, any comments or suggestions?

I didn’t write any of the :ensure logic, so I have no comments there, but the
suggestion above sounds like a sound and harmless one to me.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-04  6:01   ` John Wiegley
@ 2024-08-04  8:14     ` Eli Zaretskii
  2024-08-04 14:56       ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2024-08-04  8:14 UTC (permalink / raw)
  To: John Wiegley, Stefan Kangas; +Cc: 72453, derek_upham

merge 72453 72293
thanks

> From: John Wiegley <johnw@gnu.org>
> Cc: Derek Upham <derek_upham@mailfence.com>,  72453@debbugs.gnu.org
> Date: Sat, 03 Aug 2024 23:01:04 -0700
> 
> >>>>> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> Moving the "use-package" macro into the top-level "use-package" file should
> >> fix the problem. The "use-package" file explicitly loads the other files,
> >> which sets up all of the defaults.
> 
> > John, any comments or suggestions?
> 
> I didn’t write any of the :ensure logic, so I have no comments there, but the
> suggestion above sounds like a sound and harmless one to me.

Thanks, John.

Stefan, would you please handle this?  Moving use-package from
use-package-core.el to use-package.el would probably mean much more
massive load whenever the macro is used, and I wonder whether there's
a more light-weight solution.  If such a light-weight solution exists,
I think we should install it on the emacs-30 release branch, but if
the only reasonable solution is what the OP suggested, then I think it
should go to master.

Btw, I think this bug and bug#72293 are the same bug, so I'm merging
them.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-04  4:44 ` Eli Zaretskii
  2024-08-04  6:01   ` John Wiegley
@ 2024-08-04 14:46   ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 13+ messages in thread
From: Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-08-04 14:46 UTC (permalink / raw)
  To: Eli Zaretskii, John Wiegley; +Cc: 72453

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]



On Aug 3, 2024 at 9:44 PM, Eli Zaretskii <eliz@gnu.org> wrote:> Place it in a scratch directory "use-package-ensure-test" and invoke
> Emacs with, for example:
> 
>   emacs --init-directory use-package-ensure-test

Is this step necessary, i.e. does this problem has anything to do with
the non-default --init-directory setting?

It's an outcome  of ease-of-reproduction.  This approach sets up a
minimal test case (with "-q", effectively), in a single file, with the
actions happening during the startup as typical for use-package.

-- 
Sent with https://mailfence.com
Secure and private email

[-- Attachment #2: Type: text/html, Size: 943 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-04  8:14     ` Eli Zaretskii
@ 2024-08-04 14:56       ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-08-17  8:24         ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-08-04 14:56 UTC (permalink / raw)
  To: Eli Zaretskii, John Wiegley, Stefan Kangas; +Cc: 72453

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

On Aug 4, 2024 at 1:14 AM, Eli Zaretskii <eliz@gnu.org> wrote:Stefan, would you please handle this?  Moving use-package from
use-package-core.el to use-package.el would probably mean much more
massive load whenever the macro is used, and I wonder whether there's
a more light-weight solution.  If such a light-weight solution exists,
I think we should install it on the emacs-30 release branch, but if
the only reasonable solution is what the OP suggested, then I think it
should go to master.

Alternatively, create a new file in the use-package directory that
consolidates the top-level macro and the various add-to-list calls.
(I expect that :delight and :diminish have the same problem as
:ensure and :pin do.)  Maybe "use-package-bootstrap.el".

-- 
Sent with https://mailfence.com
Secure and private email

[-- Attachment #2: Type: text/html, Size: 1142 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-04 14:56       ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-08-17  8:24         ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2024-08-17  8:24 UTC (permalink / raw)
  To: Derek Upham, stefankangas; +Cc: johnw, 72453

Ping! Stefan, could you please look into this?

> Date: Sun, 4 Aug 2024 16:56:16 +0200 (CEST)
> From: Derek Upham <derek_upham@mailfence.com>
> Cc: 72453@debbugs.gnu.org
> 
> On Aug 4, 2024 at 1:14 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>  Stefan, would you please handle this?  Moving use-package from
> use-package-core.el to use-package.el would probably mean much more
> massive load whenever the macro is used, and I wonder whether there's
> a more light-weight solution.  If such a light-weight solution exists,
> I think we should install it on the emacs-30 release branch, but if
> the only reasonable solution is what the OP suggested, then I think it
> should go to master.
> 
> Alternatively, create a new file in the use-package directory that
> consolidates the top-level macro and the various add-to-list calls.
> (I expect that :delight and :diminish have the same problem as
> :ensure and :pin do.)  Maybe "use-package-bootstrap.el".





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-03 21:58 bug#72453: 29.4; "use-package" macro does not load all expected related files Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-08-04  4:44 ` Eli Zaretskii
@ 2024-08-18 11:21 ` Stefan Kangas
  2024-08-18 11:31   ` Eli Zaretskii
  2024-08-19  1:26   ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-08-21 12:46 ` Mattias Engdegård
  2 siblings, 2 replies; 13+ messages in thread
From: Stefan Kangas @ 2024-08-18 11:21 UTC (permalink / raw)
  To: Derek Upham, 72453

[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]

Derek Upham via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:

>   emacs --init-directory use-package-ensure-test
>
> The init file sets use-package-always-ensure to true, and we expect
> trace warnings to show up for each use-package invocation.  In fact, we
> only see them for the third and beyond.
>
>  Warning (emacs): use-package-ensure-trace files (t) nil
>  Warning (emacs): use-package-ensure-trace rx (t) nil
>  Warning (emacs): use-package-ensure-trace avoid (t) nil

Thanks for the bug report and the clear recipe to reproduce it.

I can reproduce this bug here also.

> Moving the "use-package" macro into the top-level "use-package" file
> should fix the problem.  The "use-package" file explicitly loads the
> other files, which sets up all of the defaults.

The attached less intrusive patch fixes it here.  Could you please test
that it fixes the problem for you?

The patch just moves the relevant definitions to use-package-core.el.
If Eli and Andrea see no problem with this approach, I think we could
install it on emacs-30, after the first pre-release, and otherwise on
master.

Unrelatedly, I also noticed that the defcustoms in use-package-core.el
are all missing :version tags.  I'll fix that on emacs-30 after the
first pre-release is out.

[-- Attachment #2: 0001-Fix-early-use-of-use-package-always-ensure.patch --]
[-- Type: text/x-patch, Size: 8471 bytes --]

From 00dc146e9b8e41c534c19f78986f8e944681aa07 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Sun, 18 Aug 2024 13:10:19 +0200
Subject: [PATCH] Fix early use of use-package-always-ensure

* lisp/use-package/use-package-core.el:
* lisp/use-package/use-package-delight.el:
* lisp/use-package/use-package-diminish.el:
* lisp/use-package/use-package-ensure.el: Move add-to-list for
use-package-keywords and use-package-defaults from here...
* lisp/use-package/use-package-core.el (use-package-ensure)
(use-package-keywords): ...to the default definition here.

* lisp/use-package/use-package-ensure.el
(use-package-ensure): Move this defgroup...
(use-package-always-ensure)
(use-package-always-pin, use-package-ensure-function): ...and
these defcustoms from here...
* lisp/use-package/use-package-core.el (use-package-ensure)
(use-package-always-ensure, use-package-always-pin)
(use-package-ensure-function): ...to here.  (Bug#72453)
---
 lisp/use-package/use-package-core.el     | 54 ++++++++++++++++++++++--
 lisp/use-package/use-package-delight.el  |  2 -
 lisp/use-package/use-package-diminish.el |  2 -
 lisp/use-package/use-package-ensure.el   | 48 ---------------------
 4 files changed, 51 insertions(+), 55 deletions(-)

diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el
index 8c3241d5ee0..c42007a2d10 100644
--- a/lisp/use-package/use-package-core.el
+++ b/lisp/use-package/use-package-core.el
@@ -65,6 +65,13 @@ use-package
   :link '(custom-manual "(use-package) Top")
   :version "29.1")
 
+;; TODO: I don't think this package group is required.  Delete it.
+(defgroup use-package-ensure nil
+  "Support for :ensure and :pin keywords in `use-package' declarations."
+  :group 'use-package
+  :link '(custom-manual "(use-package) Installing packages")
+  :version "29.1")
+
 (defconst use-package-version "2.4.5"
   "This version of `use-package'.")
 
@@ -76,6 +83,10 @@ use-package-keywords
     :functions
     :preface
     :if :when :unless
+    :ensure
+    :pin
+    :delight
+    :diminish
     :vc
     :no-require
     :catch
@@ -114,7 +125,8 @@ use-package-keywords
 nothing at all to happen, even if the rest of the `use-package'
 declaration is incorrect."
   :type '(repeat symbol)
-  :group 'use-package)
+  :group 'use-package
+  :version "30.1")
 
 (defcustom use-package-deferring-keywords
   '(:bind-keymap
@@ -189,7 +201,12 @@ use-package-defaults
              (lambda (name args)
                (and use-package-always-demand
                     (not (plist-member args :defer))
-                    (not (plist-member args :demand))))))
+                    (not (plist-member args :demand)))))
+    (:ensure (list use-package-always-ensure)
+             (lambda (name args)
+               (and use-package-always-ensure
+                    (not (plist-member args :load-path)))))
+    (:pin use-package-always-pin use-package-always-pin))
   "Default values for specified `use-package' keywords.
 Each entry in the alist is a list of three elements:
 The first element is the `use-package' keyword.
@@ -214,7 +231,8 @@ use-package-defaults
           (list (symbol :tag "Keyword")
                 (choice :tag "Default value" sexp function)
                 (choice :tag "Enable if non-nil" sexp function)))
-  :group 'use-package)
+  :group 'use-package
+  :version "30.1")
 
 (defcustom use-package-merge-key-alist
   '((:if    . (lambda (new old) `(and ,new ,old)))
@@ -360,6 +378,36 @@ use-package-vc-prefer-newest
   :version "30.1"
   :group 'use-package)
 
+(defcustom use-package-always-ensure nil
+  "Treat every package as though it had specified using `:ensure SEXP'.
+See also `use-package-defaults', which uses this value."
+  :type 'sexp
+  :group 'use-package-ensure)
+
+(defcustom use-package-always-pin nil
+  "Treat every package as though it had specified using `:pin SYM'.
+See also `use-package-defaults', which uses this value."
+  :type 'symbol
+  :group 'use-package-ensure)
+
+(defcustom use-package-ensure-function 'use-package-ensure-elpa
+  "Function that ensures a package is installed.
+This function is called with three arguments: the name of the
+package declared in the `use-package' form; the arguments passed
+to all `:ensure' keywords (always a list, even if only one); and
+the current `state' plist created by previous handlers.
+
+Note that this function is called whenever `:ensure' is provided,
+even if it is nil.  It is up to the function to decide on the
+semantics of the various values for `:ensure'.
+
+This function should return non-nil if the package is installed.
+
+The default value uses package.el to install the package."
+  :type '(choice (const :tag "package.el" use-package-ensure-elpa)
+                 (function :tag "Custom"))
+  :group 'use-package-ensure)
+
 (defvar use-package-statistics (make-hash-table))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/lisp/use-package/use-package-delight.el b/lisp/use-package/use-package-delight.el
index c458d263cf0..c67e2aa6320 100644
--- a/lisp/use-package/use-package-delight.el
+++ b/lisp/use-package/use-package-delight.el
@@ -81,8 +81,6 @@ use-package-handler/:delight
      `((if (fboundp 'delight)
            (delight '(,@args)))))))
 
-(add-to-list 'use-package-keywords :delight t)
-
 (provide 'use-package-delight)
 
 ;;; use-package-delight.el ends here
diff --git a/lisp/use-package/use-package-diminish.el b/lisp/use-package/use-package-diminish.el
index 79421a0e273..0be2ba688a0 100644
--- a/lisp/use-package/use-package-diminish.el
+++ b/lisp/use-package/use-package-diminish.el
@@ -70,8 +70,6 @@ use-package-handler/:diminish
              arg)
      body)))
 
-(add-to-list 'use-package-keywords :diminish t)
-
 (provide 'use-package-diminish)
 
 ;;; use-package-diminish.el ends here
diff --git a/lisp/use-package/use-package-ensure.el b/lisp/use-package/use-package-ensure.el
index 5f75b6b59ea..82ab3256ef0 100644
--- a/lisp/use-package/use-package-ensure.el
+++ b/lisp/use-package/use-package-ensure.el
@@ -32,46 +32,10 @@
 (require 'cl-lib)
 (require 'use-package-core)
 
-(defgroup use-package-ensure nil
-  "Support for :ensure and :pin keywords in `use-package' declarations."
-  :group 'use-package
-  :link '(custom-manual "(use-package) Installing packages")
-  :version "29.1")
-
 (eval-when-compile
   (declare-function package-installed-p "package")
   (declare-function package-read-all-archive-contents "package" ()))
 
-(defcustom use-package-always-ensure nil
-  "Treat every package as though it had specified using `:ensure SEXP'.
-See also `use-package-defaults', which uses this value."
-  :type 'sexp
-  :group 'use-package-ensure)
-
-(defcustom use-package-always-pin nil
-  "Treat every package as though it had specified using `:pin SYM'.
-See also `use-package-defaults', which uses this value."
-  :type 'symbol
-  :group 'use-package-ensure)
-
-(defcustom use-package-ensure-function 'use-package-ensure-elpa
-  "Function that ensures a package is installed.
-This function is called with three arguments: the name of the
-package declared in the `use-package' form; the arguments passed
-to all `:ensure' keywords (always a list, even if only one); and
-the current `state' plist created by previous handlers.
-
-Note that this function is called whenever `:ensure' is provided,
-even if it is nil.  It is up to the function to decide on the
-semantics of the various values for `:ensure'.
-
-This function should return non-nil if the package is installed.
-
-The default value uses package.el to install the package."
-  :type '(choice (const :tag "package.el" use-package-ensure-elpa)
-                 (function :tag "Custom"))
-  :group 'use-package-ensure)
-
 ;;;; :pin
 
 (defun use-package-normalize/:pin (_name keyword args)
@@ -196,18 +160,6 @@ use-package-handler/:ensure
             body))
     body))
 
-(add-to-list 'use-package-defaults
-             '(:ensure (list use-package-always-ensure)
-                       (lambda (name args)
-                         (and use-package-always-ensure
-                              (not (plist-member args :load-path))))) t)
-
-(add-to-list 'use-package-defaults
-             '(:pin use-package-always-pin use-package-always-pin) t)
-
-(add-to-list 'use-package-keywords :ensure)
-(add-to-list 'use-package-keywords :pin)
-
 (provide 'use-package-ensure)
 
 ;;; use-package-ensure.el ends here
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-18 11:21 ` Stefan Kangas
@ 2024-08-18 11:31   ` Eli Zaretskii
  2024-08-19  1:26   ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2024-08-18 11:31 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 72453, derek_upham

> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Sun, 18 Aug 2024 11:21:40 +0000
> 
> The attached less intrusive patch fixes it here.  Could you please test
> that it fixes the problem for you?
> 
> The patch just moves the relevant definitions to use-package-core.el.
> If Eli and Andrea see no problem with this approach, I think we could
> install it on emacs-30, after the first pre-release, and otherwise on
> master.

I think this should go to master, since the problem is not terribly
important to fix, and moving stuff between files could cause
unintended consequences.

Thanks.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-18 11:21 ` Stefan Kangas
  2024-08-18 11:31   ` Eli Zaretskii
@ 2024-08-19  1:26   ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-08-19 23:58     ` Stefan Kangas
  1 sibling, 1 reply; 13+ messages in thread
From: Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-08-19  1:26 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 72453

Stefan Kangas <stefankangas@gmail.com> writes:

>>  Warning (emacs): use-package-ensure-trace files (t) nil
>>  Warning (emacs): use-package-ensure-trace rx (t) nil
>>  Warning (emacs): use-package-ensure-trace avoid (t) nil
>
> Thanks for the bug report and the clear recipe to reproduce it.
>
> I can reproduce this bug here also.
>
>> Moving the "use-package" macro into the top-level "use-package" 
>> file
>> should fix the problem.  The "use-package" file explicitly 
>> loads the
>> other files, which sets up all of the defaults.
>
> The attached less intrusive patch fixes it here.  Could you 
> please test
> that it fixes the problem for you?

Validating on stock 29.4, with this command:

   ~/emacs-29.4/bin/emacs --init-directory use-package-ensure-test

and this test code:

 (defun use-package-ensure-trace (name args state)
   (warn "use-package-ensure-trace %s %s %s" name args state)
   t)

 ;;(require 'use-package)

 (setq use-package-ensure-function 'use-package-ensure-trace)
 (setq use-package-always-ensure t)

 (use-package faces)
 (use-package ansi-color)
 (use-package files :ensure t)
 (use-package rx)
 (use-package avoid)

I’m seeing the outputs that we expect:

 Warning (emacs): use-package-ensure-trace faces (t) nil
 Warning (emacs): use-package-ensure-trace ansi-color (t) nil
 Warning (emacs): use-package-ensure-trace files (t) nil
 Warning (emacs): use-package-ensure-trace rx (t) nil
 Warning (emacs): use-package-ensure-trace avoid (t) nil

Thanks for working on this.

-- 
Derek Upham
derek_upham@mailfence.com





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-19  1:26   ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-08-19 23:58     ` Stefan Kangas
  0 siblings, 0 replies; 13+ messages in thread
From: Stefan Kangas @ 2024-08-19 23:58 UTC (permalink / raw)
  To: Derek Upham; +Cc: 72453-done

Version: 31.1

Derek Upham <derek_upham@mailfence.com> writes:

> I’m seeing the outputs that we expect:
>
>  Warning (emacs): use-package-ensure-trace faces (t) nil
>  Warning (emacs): use-package-ensure-trace ansi-color (t) nil
>  Warning (emacs): use-package-ensure-trace files (t) nil
>  Warning (emacs): use-package-ensure-trace rx (t) nil
>  Warning (emacs): use-package-ensure-trace avoid (t) nil

Thanks for testing.

So I've pushed this to master as commit 644d2a83316.  I'm consequently
closing this bug report.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-03 21:58 bug#72453: 29.4; "use-package" macro does not load all expected related files Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-08-04  4:44 ` Eli Zaretskii
  2024-08-18 11:21 ` Stefan Kangas
@ 2024-08-21 12:46 ` Mattias Engdegård
  2024-09-01  9:32   ` Stefan Kangas
  2 siblings, 1 reply; 13+ messages in thread
From: Mattias Engdegård @ 2024-08-21 12:46 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 72453, Derek Upham

[-- Attachment #1: Type: text/plain, Size: 147 bytes --]

It seems that 644d2a83 and 8f4ad4d7 cause failures in use-package-tests on master (log attached); the tests pass after reverting those commits.


[-- Attachment #2: use-package-tests.log --]
[-- Type: application/octet-stream, Size: 27754 bytes --]

Running 166 tests (2024-08-21 14:42:42+0200, selector `(not (or (tag :unstable) (tag :nativecomp)))')
test-map (keymap #^[nil nil keymap nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] (f1 . ignore))
binding ((<f1> . test-map) ignore nil)
   passed    1/166  bind-key/845 (0.000217 sec)
   passed    2/166  bind-key/:prefix-map (0.000064 sec)
   passed    3/166  use-package-test-handler/:vc-6 (0.000148 sec)
   passed    4/166  use-package-test-normalize-function (0.000087 sec)
   passed    5/166  use-package-test-normalize/:bind-1 (0.000042 sec)
   passed    6/166  use-package-test-normalize/:bind-2 (0.000048 sec)
   passed    7/166  use-package-test-normalize/:bind-3 (0.000042 sec)
   passed    8/166  use-package-test-normalize/:custom (0.000093 sec)
   passed    9/166  use-package-test-normalize/:delight (0.000106 sec)
   passed   10/166  use-package-test-normalize/:diminish (0.000070 sec)
   passed   11/166  use-package-test-normalize/:ensure (0.000100 sec)
   passed   12/166  use-package-test-normalize/:hook (0.000113 sec)
   passed   13/166  use-package-test-normalize/:mode (0.000073 sec)
   passed   14/166  use-package-test-normalize/:vc (0.000148 sec)
   passed   15/166  use-package-test-recognize-function (0.000099 sec)
   passed   16/166  use-package-test/334-1 (0.000065 sec)
   passed   17/166  use-package-test/334-2 (0.000049 sec)
   passed   18/166  use-package-test/482-1 (0.000117 sec)
   passed   19/166  use-package-test/482-2 (0.000221 sec)
   passed   20/166  use-package-test/482-3 (0.000060 sec)
   passed   21/166  use-package-test/538 (0.000122 sec)
   passed   22/166  use-package-test/543 (0.000099 sec)
   passed   23/166  use-package-test/545 (0.000093 sec)
   passed   24/166  use-package-test/550 (0.000122 sec)
   passed   25/166  use-package-test/558 (0.000050 sec)
   passed   26/166  use-package-test/560 (0.000177 sec)
   passed   27/166  use-package-test/572-1 (0.000095 sec)
   passed   28/166  use-package-test/572-2 (0.000090 sec)
   passed   29/166  use-package-test/572-3 (0.000094 sec)
   passed   30/166  use-package-test/575-1 (0.000150 sec)
   passed   31/166  use-package-test/575-2 (0.000113 sec)
   passed   32/166  use-package-test/585 (0.000122 sec)
   passed   33/166  use-package-test/589 (0.000106 sec)
   passed   34/166  use-package-test/591 (0.000124 sec)
   passed   35/166  use-package-test/:after-1 (0.000093 sec)
   passed   36/166  use-package-test/:after-10 (0.000166 sec)
   passed   37/166  use-package-test/:after-2 (0.000257 sec)
   passed   38/166  use-package-test/:after-3 (0.000154 sec)
   passed   39/166  use-package-test/:after-4 (0.000143 sec)
   passed   40/166  use-package-test/:after-5 (0.000227 sec)
   passed   41/166  use-package-test/:after-6 (0.000234 sec)
   passed   42/166  use-package-test/:after-7 (0.000239 sec)
   passed   43/166  use-package-test/:after-8 (0.000298 sec)
   passed   44/166  use-package-test/:after-9 (0.000238 sec)
   passed   45/166  use-package-test/:autoload-1 (0.000150 sec)
   passed   46/166  use-package-test/:bind*-1 (0.000114 sec)
   passed   47/166  use-package-test/:bind-1 (0.000111 sec)
   passed   48/166  use-package-test/:bind-2 (0.000119 sec)
   passed   49/166  use-package-test/:bind-3 (0.000109 sec)
   passed   50/166  use-package-test/:bind-4 (0.000089 sec)
   passed   51/166  use-package-test/:bind-5 (0.000116 sec)
   passed   52/166  use-package-test/:bind-6 (0.000118 sec)
   passed   53/166  use-package-test/:bind-7 (0.000299 sec)
   passed   54/166  use-package-test/:bind-8 (0.000203 sec)
   passed   55/166  use-package-test/:bind-keymap*-1 (0.000147 sec)
   passed   56/166  use-package-test/:bind-keymap-1 (0.000139 sec)
   passed   57/166  use-package-test/:catch-1 (0.000166 sec)
   passed   58/166  use-package-test/:catch-2 (0.000141 sec)
   passed   59/166  use-package-test/:catch-3 (0.000160 sec)
   passed   60/166  use-package-test/:commands-1 (0.000137 sec)
   passed   61/166  use-package-test/:commands-2 (0.000140 sec)
   passed   62/166  use-package-test/:commands-3 (0.000157 sec)
   passed   63/166  use-package-test/:commands-4 (0.000152 sec)
   passed   64/166  use-package-test/:commands-5 (0.000145 sec)
   passed   65/166  use-package-test/:commands-6 (0.000148 sec)
   passed   66/166  use-package-test/:config-1 (0.000086 sec)
   passed   67/166  use-package-test/:config-2 (0.000098 sec)
   passed   68/166  use-package-test/:config-3 (0.000083 sec)
   passed   69/166  use-package-test/:config-4 (0.000087 sec)
   passed   70/166  use-package-test/:custom-1 (0.000263 sec)
   passed   71/166  use-package-test/:custom-face-1 (0.000158 sec)
   passed   72/166  use-package-test/:custom-face-2 (0.000150 sec)
   passed   73/166  use-package-test/:custom-face-3 (0.000142 sec)
   passed   74/166  use-package-test/:custom-with-comment1 (0.000152 sec)
   passed   75/166  use-package-test/:defer-1 (0.000121 sec)
   passed   76/166  use-package-test/:defer-2 (0.000136 sec)
   passed   77/166  use-package-test/:defer-3 (0.000126 sec)
   passed   78/166  use-package-test/:defer-4 (0.000133 sec)
   passed   79/166  use-package-test/:defines-1 (0.000135 sec)
   passed   80/166  use-package-test/:defines-2 (0.000148 sec)
   passed   81/166  use-package-test/:delight-1 (0.000097 sec)
   passed   82/166  use-package-test/:delight-2 (0.000095 sec)
   passed   83/166  use-package-test/:delight-3 (0.000091 sec)
   passed   84/166  use-package-test/:delight-4 (0.000092 sec)
   passed   85/166  use-package-test/:delight-5 (0.000085 sec)
   passed   86/166  use-package-test/:delight-6 (0.000275 sec)
   passed   87/166  use-package-test/:demand-1 (0.000158 sec)
   passed   88/166  use-package-test/:demand-2 (0.000160 sec)
   passed   89/166  use-package-test/:demand-3 (0.000156 sec)
   passed   90/166  use-package-test/:demand-4 (0.000159 sec)
   passed   91/166  use-package-test/:demand-5 (0.000160 sec)
   passed   92/166  use-package-test/:demand-6 (0.000167 sec)
Test use-package-test/:demand-7 backtrace:
  signal(ert-test-failed (((should (pcase (expand-minimally (use-packa
  ert-fail(((should (pcase (expand-minimally (use-package counsel :loa
  (if (unwind-protect (setq value-1389 (let* ((val (let (... ...) (mac
  (let (form-description-1390) (if (unwind-protect (setq value-1389 (l
  (let ((value-1389 (gensym "ert-form-evaluation-aborted-"))) (let (fo
  #f(lambda () [t] (let ((value-1389 (gensym "ert-form-evaluation-abor
  #f(compiled-function () #<bytecode 0x647e5a02e355e30>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x647e5a02e355e30>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name use-package-test/:demand-7 :documenta
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
  ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
  eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
  command-line-1(("-L" ":../../emacs/test" "-l" "ert" "--eval" "(setq 
  command-line()
  normal-top-level()
Test use-package-test/:demand-7 condition:
    (ert-test-failed
     ((should (pcase (expand-minimally ...) (... t))) :form
      (let* ((val ...)) (if (consp val) (let* ... ...))) :value nil))
   FAILED   93/166  use-package-test/:demand-7 (0.000398 sec) at ../../emacs/test/lisp/use-package/use-package-tests.el:1432
Test use-package-test/:diminish-1 backtrace:
  signal(ert-test-failed (((should (pcase (expand-minimally (use-packa
  ert-fail(((should (pcase (expand-minimally (use-package foo :diminis
  (if (unwind-protect (setq value-1424 (let* ((val (let (... ...) (mac
  (let (form-description-1425) (if (unwind-protect (setq value-1424 (l
  (let ((value-1424 (gensym "ert-form-evaluation-aborted-"))) (let (fo
  #f(lambda () [t] (let ((value-1424 (gensym "ert-form-evaluation-abor
  #f(compiled-function () #<bytecode 0x647e5a02e355e30>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x647e5a02e355e30>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name use-package-test/:diminish-1 :documen
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
  ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
  eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
  command-line-1(("-L" ":../../emacs/test" "-l" "ert" "--eval" "(setq 
  command-line()
  normal-top-level()
Test use-package-test/:diminish-1 condition:
    (ert-test-failed
     ((should (pcase (expand-minimally ...) (... t))) :form
      (let* ((val ...)) (if (equal val ...) (let nil t))) :value nil))
   FAILED   94/166  use-package-test/:diminish-1 (0.000234 sec) at ../../emacs/test/lisp/use-package/use-package-tests.el:1522
Test use-package-test/:diminish-2 backtrace:
  signal(ert-test-failed (((should (pcase (expand-minimally (use-packa
  ert-fail(((should (pcase (expand-minimally (use-package foo :diminis
  (if (unwind-protect (setq value-1426 (let* ((val (let (... ...) (mac
  (let (form-description-1427) (if (unwind-protect (setq value-1426 (l
  (let ((value-1426 (gensym "ert-form-evaluation-aborted-"))) (let (fo
  #f(lambda () [t] (let ((value-1426 (gensym "ert-form-evaluation-abor
  #f(compiled-function () #<bytecode 0x647e5a02e355e30>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x647e5a02e355e30>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name use-package-test/:diminish-2 :documen
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
  ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
  eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
  command-line-1(("-L" ":../../emacs/test" "-l" "ert" "--eval" "(setq 
  command-line()
  normal-top-level()
Test use-package-test/:diminish-2 condition:
    (ert-test-failed
     ((should (pcase (expand-minimally ...) (... t))) :form
      (let* ((val ...)) (if (equal val ...) (let nil t))) :value nil))
   FAILED   95/166  use-package-test/:diminish-2 (0.000171 sec) at ../../emacs/test/lisp/use-package/use-package-tests.el:1530
Test use-package-test/:diminish-3 backtrace:
  signal(ert-test-failed (((should (pcase (expand-minimally (use-packa
  ert-fail(((should (pcase (expand-minimally (use-package foo :diminis
  (if (unwind-protect (setq value-1428 (let* ((val (let (... ...) (mac
  (let (form-description-1429) (if (unwind-protect (setq value-1428 (l
  (let ((value-1428 (gensym "ert-form-evaluation-aborted-"))) (let (fo
  #f(lambda () [t] (let ((value-1428 (gensym "ert-form-evaluation-abor
  #f(compiled-function () #<bytecode 0x647e5a02e355e30>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x647e5a02e355e30>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name use-package-test/:diminish-3 :documen
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
  ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
  eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
  command-line-1(("-L" ":../../emacs/test" "-l" "ert" "--eval" "(setq 
  command-line()
  normal-top-level()
Test use-package-test/:diminish-3 condition:
    (ert-test-failed
     ((should (pcase (expand-minimally ...) (... t))) :form
      (let* ((val ...)) (if (equal val ...) (let nil t))) :value nil))
   FAILED   96/166  use-package-test/:diminish-3 (0.000221 sec) at ../../emacs/test/lisp/use-package/use-package-tests.el:1538
Test use-package-test/:diminish-4 backtrace:
  signal(ert-test-failed (((should (pcase (expand-minimally (use-packa
  ert-fail(((should (pcase (expand-minimally (use-package foo :diminis
  (if (unwind-protect (setq value-1430 (let* ((val (let (... ...) (mac
  (let (form-description-1431) (if (unwind-protect (setq value-1430 (l
  (let ((value-1430 (gensym "ert-form-evaluation-aborted-"))) (let (fo
  #f(lambda () [t] (let ((value-1430 (gensym "ert-form-evaluation-abor
  #f(compiled-function () #<bytecode 0x647e5a02e355e30>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x647e5a02e355e30>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name use-package-test/:diminish-4 :documen
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
  ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
  eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
  command-line-1(("-L" ":../../emacs/test" "-l" "ert" "--eval" "(setq 
  command-line()
  normal-top-level()
Test use-package-test/:diminish-4 condition:
    (ert-test-failed
     ((should (pcase (expand-minimally ...) (... t))) :form
      (let* ((val ...)) (if (equal val ...) (let nil t))) :value nil))
   FAILED   97/166  use-package-test/:diminish-4 (0.000186 sec) at ../../emacs/test/lisp/use-package/use-package-tests.el:1546
   passed   98/166  use-package-test/:disabled-1 (0.000092 sec)
   passed   99/166  use-package-test/:ensure-1 (0.000116 sec)
Test use-package-test/:ensure-10 backtrace:
  signal(ert-test-failed (((should (pcase (expand-minimally (use-packa
  ert-fail(((should (pcase (expand-minimally (use-package foo :ensure 
  (if (unwind-protect (setq value-258 (let* ((val (let (... ...) (macr
  (let (form-description-259) (if (unwind-protect (setq value-258 (let
  (let ((value-258 (gensym "ert-form-evaluation-aborted-"))) (let (for
  (let ((use-package-always-ensure t)) (let ((value-258 (gensym "ert-f
  #f(lambda () [t] (let ((use-package-always-ensure t)) (let ((value-2
  #f(compiled-function () #<bytecode 0x647e5a02e355e30>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x647e5a02e355e30>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name use-package-test/:ensure-10 :document
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
  ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
  eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
  command-line-1(("-L" ":../../emacs/test" "-l" "ert" "--eval" "(setq 
  command-line()
  normal-top-level()
Test use-package-test/:ensure-10 condition:
    (ert-test-failed
     ((should (pcase (expand-minimally ...) (... t))) :form
      (let* ((val ...)) (if (consp val) (let* ... ...))) :value nil))
   FAILED  100/166  use-package-test/:ensure-10 (0.000177 sec) at ../../emacs/test/lisp/use-package/use-package-tests.el:307
   passed  101/166  use-package-test/:ensure-11 (0.000188 sec)
   passed  102/166  use-package-test/:ensure-12 (0.000158 sec)
   passed  103/166  use-package-test/:ensure-13 (0.000099 sec)
Test use-package-test/:ensure-14 backtrace:
  signal(ert-test-failed (((should (pcase (expand-minimally (use-packa
  ert-fail(((should (pcase (expand-minimally (use-package ess-site :en
  (if (unwind-protect (setq value-269 (let* ((val (let (... ...) (macr
  (let (form-description-270) (if (unwind-protect (setq value-269 (let
  (let ((value-269 (gensym "ert-form-evaluation-aborted-"))) (let (for
  #f(lambda () [t] (let ((value-269 (gensym "ert-form-evaluation-abort
  #f(compiled-function () #<bytecode 0x647e5a02e355e30>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x647e5a02e355e30>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name use-package-test/:ensure-14 :document
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
  ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
  eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
  command-line-1(("-L" ":../../emacs/test" "-l" "ert" "--eval" "(setq 
  command-line()
  normal-top-level()
Test use-package-test/:ensure-14 condition:
    (ert-test-failed
     ((should (pcase (expand-minimally ...) (... t))) :form
      (let* ((val ...)) (if (equal val ...) (let nil t))) :value nil))
   FAILED  104/166  use-package-test/:ensure-14 (0.000158 sec) at ../../emacs/test/lisp/use-package/use-package-tests.el:343
Test use-package-test/:ensure-15 backtrace:
  signal(ert-test-failed (((should (pcase (expand-minimally (use-packa
  ert-fail(((should (pcase (expand-minimally (use-package foo :pin "el
  (if (unwind-protect (setq value-271 (let* ((val (let (... ...) (macr
  (let (form-description-272) (if (unwind-protect (setq value-271 (let
  (let ((value-271 (gensym "ert-form-evaluation-aborted-"))) (let (for
  (let ((use-package-always-ensure t)) (let ((value-271 (gensym "ert-f
  #f(lambda () [t] (let ((use-package-always-ensure t)) (let ((value-2
  #f(compiled-function () #<bytecode 0x647e5a02e355e30>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x647e5a02e355e30>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name use-package-test/:ensure-15 :document
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
  ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
  eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
  command-line-1(("-L" ":../../emacs/test" "-l" "ert" "--eval" "(setq 
  command-line()
  normal-top-level()
Test use-package-test/:ensure-15 condition:
    (ert-test-failed
     ((should (pcase (expand-minimally ...) (... t))) :form
      (let* ((val ...)) (if (equal val ...) (let nil t))) :value nil))
   FAILED  105/166  use-package-test/:ensure-15 (0.000202 sec) at ../../emacs/test/lisp/use-package/use-package-tests.el:358
   passed  106/166  use-package-test/:ensure-2 (0.000210 sec)
   passed  107/166  use-package-test/:ensure-3 (0.000123 sec)
   passed  108/166  use-package-test/:ensure-4 (0.000097 sec)
   passed  109/166  use-package-test/:ensure-5 (0.000128 sec)
   passed  110/166  use-package-test/:ensure-6 (0.000119 sec)
Test use-package-test/:ensure-7 backtrace:
  signal(ert-test-failed (((should (pcase (expand-minimally (use-packa
  ert-fail(((should (pcase (expand-minimally (use-package foo :ensure 
  (if (unwind-protect (setq value-204 (let* ((val (let (... ...) (macr
  (let (form-description-205) (if (unwind-protect (setq value-204 (let
  (let ((value-204 (gensym "ert-form-evaluation-aborted-"))) (let (for
  (let ((use-package-always-ensure nil)) (let ((value-204 (gensym "ert
  #f(lambda () [t] (let ((use-package-always-ensure nil)) (let ((value
  #f(compiled-function () #<bytecode 0x647e5a02e355e30>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x647e5a02e355e30>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name use-package-test/:ensure-7 :documenta
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
  ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
  eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
  command-line-1(("-L" ":../../emacs/test" "-l" "ert" "--eval" "(setq 
  command-line()
  normal-top-level()
Test use-package-test/:ensure-7 condition:
    (ert-test-failed
     ((should (pcase (expand-minimally ...) (... t))) :form
      (let* ((val ...)) (if (consp val) (let* ... ...))) :value nil))
   FAILED  111/166  use-package-test/:ensure-7 (0.000170 sec) at ../../emacs/test/lisp/use-package/use-package-tests.el:277
Test use-package-test/:ensure-8 backtrace:
  signal(ert-test-failed (((should (pcase (expand-minimally (use-packa
  ert-fail(((should (pcase (expand-minimally (use-package foo :ensure 
  (if (unwind-protect (setq value-222 (let* ((val (let (... ...) (macr
  (let (form-description-223) (if (unwind-protect (setq value-222 (let
  (let ((value-222 (gensym "ert-form-evaluation-aborted-"))) (let (for
  (let ((use-package-always-ensure t)) (let ((value-222 (gensym "ert-f
  #f(lambda () [t] (let ((use-package-always-ensure t)) (let ((value-2
  #f(compiled-function () #<bytecode 0x647e5a02e355e30>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x647e5a02e355e30>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name use-package-test/:ensure-8 :documenta
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
  ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
  eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
  command-line-1(("-L" ":../../emacs/test" "-l" "ert" "--eval" "(setq 
  command-line()
  normal-top-level()
Test use-package-test/:ensure-8 condition:
    (ert-test-failed
     ((should (pcase (expand-minimally ...) (... t))) :form
      (let* ((val ...)) (if (consp val) (let* ... ...))) :value nil))
   FAILED  112/166  use-package-test/:ensure-8 (0.000325 sec) at ../../emacs/test/lisp/use-package/use-package-tests.el:287
Test use-package-test/:ensure-9 backtrace:
  signal(ert-test-failed (((should (pcase (expand-minimally (use-packa
  ert-fail(((should (pcase (expand-minimally (use-package foo :ensure 
  (if (unwind-protect (setq value-240 (let* ((val (let (... ...) (macr
  (let (form-description-241) (if (unwind-protect (setq value-240 (let
  (let ((value-240 (gensym "ert-form-evaluation-aborted-"))) (let (for
  (let ((use-package-always-ensure nil)) (let ((value-240 (gensym "ert
  #f(lambda () [t] (let ((use-package-always-ensure nil)) (let ((value
  #f(compiled-function () #<bytecode 0x647e5a02e355e30>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x647e5a02e355e30>
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name use-package-test/:ensure-9 :documenta
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
  ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
  ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
  eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
  command-line-1(("-L" ":../../emacs/test" "-l" "ert" "--eval" "(setq 
  command-line()
  normal-top-level()
Test use-package-test/:ensure-9 condition:
    (ert-test-failed
     ((should (pcase (expand-minimally ...) (... t))) :form
      (let* ((val ...)) (if (consp val) (let* ... ...))) :value nil))
   FAILED  113/166  use-package-test/:ensure-9 (0.000330 sec) at ../../emacs/test/lisp/use-package/use-package-tests.el:297
   passed  114/166  use-package-test/:functions-1 (0.000213 sec)
   passed  115/166  use-package-test/:functions-2 (0.000149 sec)
   passed  116/166  use-package-test/:functions-3 (0.000101 sec)
   passed  117/166  use-package-test/:functions-4 (0.000107 sec)
   passed  118/166  use-package-test/:functions-5 (0.000113 sec)
   passed  119/166  use-package-test/:hook-1 (0.000155 sec)
   passed  120/166  use-package-test/:hook-2 (0.000118 sec)
   passed  121/166  use-package-test/:hook-3 (0.000116 sec)
   passed  122/166  use-package-test/:hook-4 (0.000204 sec)
   passed  123/166  use-package-test/:hook-5 (0.000157 sec)
   passed  124/166  use-package-test/:hook-6 (0.000146 sec)
   passed  125/166  use-package-test/:hook-7 (0.000131 sec)
   passed  126/166  use-package-test/:if-1 (0.000084 sec)
   passed  127/166  use-package-test/:if-2 (0.000082 sec)
   passed  128/166  use-package-test/:if-3 (0.000082 sec)
   passed  129/166  use-package-test/:init-1 (0.000079 sec)
   passed  130/166  use-package-test/:init-2 (0.000086 sec)
   passed  131/166  use-package-test/:interpreter-1 (0.000099 sec)
   passed  132/166  use-package-test/:interpreter-2 (0.000099 sec)
   passed  133/166  use-package-test/:load-path-1 (0.000117 sec)
   passed  134/166  use-package-test/:load-path-2 (0.000125 sec)
   passed  135/166  use-package-test/:load-path-3 (0.000142 sec)
   passed  136/166  use-package-test/:load-path-4 (0.000144 sec)
   passed  137/166  use-package-test/:magic-1 (0.000102 sec)
   passed  138/166  use-package-test/:magic-2 (0.000098 sec)
   passed  139/166  use-package-test/:magic-fallback-1 (0.000285 sec)
   passed  140/166  use-package-test/:magic-fallback-2 (0.000190 sec)
   passed  141/166  use-package-test/:mode-1 (0.000181 sec)
   passed  142/166  use-package-test/:mode-2 (0.000185 sec)
   passed  143/166  use-package-test/:no-require-1 (0.000143 sec)
   passed  144/166  use-package-test/:no-require-2 (0.000147 sec)
   passed  145/166  use-package-test/:no-require-3 (0.000157 sec)
   passed  146/166  use-package-test/:pin-1 (0.000162 sec)
   passed  147/166  use-package-test/:pin-2 (0.000148 sec)
   passed  148/166  use-package-test/:preface-1 (0.000136 sec)
   passed  149/166  use-package-test/:preface-2 (0.000102 sec)
   passed  150/166  use-package-test/:preface-3 (0.000131 sec)
   passed  151/166  use-package-test/:preface-4 (0.000127 sec)
   passed  152/166  use-package-test/:requires-1 (0.000096 sec)
   passed  153/166  use-package-test/:requires-2 (0.000106 sec)
   passed  154/166  use-package-test/:requires-3 (0.000097 sec)
   passed  155/166  use-package-test/:requires-4 (0.000283 sec)
   passed  156/166  use-package-test/:unless-1 (0.000166 sec)
   passed  157/166  use-package-test/:unless-2 (0.000155 sec)
   passed  158/166  use-package-test/:unless-3 (0.000150 sec)
   passed  159/166  use-package-test/:vc-1 (0.000162 sec)
   passed  160/166  use-package-test/:vc-2 (0.000179 sec)
   passed  161/166  use-package-test/:vc-3 (0.000151 sec)
   passed  162/166  use-package-test/:vc-4 (0.000165 sec)
   passed  163/166  use-package-test/:vc-5 (0.000177 sec)
   passed  164/166  use-package-test/:when-1 (0.000099 sec)
   passed  165/166  use-package-test/:when-2 (0.000096 sec)
   passed  166/166  use-package-test/:when-3 (0.000096 sec)

Ran 166 tests, 155 results as expected, 11 unexpected (2024-08-21 14:42:44+0200, 1.865600 sec)

11 unexpected results:
   FAILED  use-package-test/:demand-7
   FAILED  use-package-test/:diminish-1
   FAILED  use-package-test/:diminish-2
   FAILED  use-package-test/:diminish-3
   FAILED  use-package-test/:diminish-4
   FAILED  use-package-test/:ensure-10
   FAILED  use-package-test/:ensure-14
   FAILED  use-package-test/:ensure-15
   FAILED  use-package-test/:ensure-7
   FAILED  use-package-test/:ensure-8
   FAILED  use-package-test/:ensure-9

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#72453: 29.4; "use-package" macro does not load all expected related files
  2024-08-21 12:46 ` Mattias Engdegård
@ 2024-09-01  9:32   ` Stefan Kangas
  0 siblings, 0 replies; 13+ messages in thread
From: Stefan Kangas @ 2024-09-01  9:32 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: 72453, Derek Upham

Mattias Engdegård <mattias.engdegard@gmail.com> writes:

> It seems that 644d2a83 and 8f4ad4d7 cause failures in use-package-tests on master (log attached); the tests pass after reverting those commits.

Thanks, this should now be fixed.





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-09-01  9:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-03 21:58 bug#72453: 29.4; "use-package" macro does not load all expected related files Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-04  4:44 ` Eli Zaretskii
2024-08-04  6:01   ` John Wiegley
2024-08-04  8:14     ` Eli Zaretskii
2024-08-04 14:56       ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-17  8:24         ` Eli Zaretskii
2024-08-04 14:46   ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18 11:21 ` Stefan Kangas
2024-08-18 11:31   ` Eli Zaretskii
2024-08-19  1:26   ` Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-19 23:58     ` Stefan Kangas
2024-08-21 12:46 ` Mattias Engdegård
2024-09-01  9:32   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).