Subject: bug#55655: 28.1; package.el no longers respects `user-emacs-directory'

From: Shitikanth <[email-masked]>
Date: Thu, 26 May 2022 18:49:53 +0530

I think almost all emacs packages follow the convention of setting
the location of their cache/configuration files by
calling`locate-user-emacs-file'.
This enables the user to just set the user-emacs-directory instead of
configuring all of them individually. (This works great for the use case of
wanting to put your emacs config in a location other than ~/.emacs.d or
even having multiple emacs configs.)

> (defcustom package-user-dir (locate-user-emacs-file "elpa")

Looking at the definition of `package-user-dir`, it ostensibly tries to
follow the same convention as well. It has just stopped working for
some reason since 9973019764, which is why I consider this a bug.

Is it actually intended behavior that `package-user-dir' should not
by default have the same value as (locate-user-emacs-file "elpa")?

On Thu, 26 May 2022 at 17:19, Eli Zaretskii <[email-masked]> wrote:
>
> > From: Shitikanth <[email-masked]>
> > Date: Thu, 26 May 2022 16:37:48 +0530
> >
> > Until emacs 27.2, package.el used to correctly pick `package-user-dir'
> > based on the value of `user-emacs-directory', but it now seems to ignore
> > it and defaults to "~/.emacs.d/elpa".
> >
> > Demo:
> >     (setq user-emacs-directory "/tmp")
> >     (require 'package)
> >     (message "%s" package-user-dir)
> >
> > Starting with "emacs -Q" this would output "~/.emacs.d/elpa".
> > Expected output: "/tmp/elpa" (as in emacs 27.2).
> >
> > Based on git bisect, the offending commit seems to be 9973019764.
>
> Why do you set user-emacs-directory instead of setting
> package-user-dir directly?  You are supposed to set the latter in your
> early-init file.