unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: sbaugh@catern.com
To: emacs-devel@gnu.org
Subject: Automatically saving package sources
Date: Fri, 02 Feb 2024 15:01:56 +0000	[thread overview]
Message-ID: <87il367vvf.fsf@catern.com> (raw)


It is nice for installed ELPA packages to be reinstalled when Emacs is
upgraded or changed, since there can be changes to autoload generation,
the byte compiler, the native compiler, or other things which will
change the output from the package installation.

Furthermore, it is nice (where possible) for this reinstallation to
happen with the same version of the package rather than by fetching the
latest version from ELPA.  This minimizes the number of changes that
happen at once.

However, right now there is no easy way to reinstall a package from the
same sources it was originally installed from, because those sources are
not saved separately from the package itself.  They are all mixed
together in the installed package directory.  This makes it impossible
to produce a "clean slate" environment for reinstalling the package,
which (since packages can create arbitrary files during
byte-compilation) means the package can't be reinstalled in a way that's
identical to its original installation.

If package.el supported saving the package source separately, however,
it could simply reinstall from that.

I would like to add an option package-save-sources which makes
package.el automatically save the package source for the currently
installed package version in a separate directory.  Perhaps in
~/.emacs.d/elpa-sources.

When package-save-sources is enabled, then package-reinstall would
reinstall a package from the saved source rather than upgrading the
package.  package-upgrade would delete the saved source and fetch a new
version.

Does this seem like a reasonable feature to add?

As an additional benefit, elpa-sources would be useful for reviewing
changes in the source when upgrading packages.  It could be optionally
maintained as a VCS repository, with packages saved to a constant path
based on their name (e.g. elpa-sources/xref.el instead of
elpa-sources/xref-1.2.3/xref.el).  Then a VCS could be used to review
the diff resulting from an upgrade.  This would be useful for any user
who wants to scrutinize package code changes before installing them.




             reply	other threads:[~2024-02-02 15:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 15:01 sbaugh [this message]
2024-02-03 22:08 ` Automatically saving package sources Stefan Kangas
2024-02-03 22:28   ` Stefan Monnier
2024-02-04 10:22 ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87il367vvf.fsf@catern.com \
    --to=sbaugh@catern.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).