all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: sbaugh@catern.com,  emacs-devel@gnu.org
Subject: Re: Automatically saving package sources
Date: Sat, 03 Feb 2024 17:28:56 -0500	[thread overview]
Message-ID: <jwvplxdjilw.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CADwFkmn2eA-BLpr8oATqYwYW2gJfNi6BAEvUqt8xFPB+neRzeQ@mail.gmail.com> (Stefan Kangas's message of "Sat, 3 Feb 2024 17:08:46 -0500")

>> 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.

FWIW, native-compiled files do get regenerated (and from the `.el`
rather than from the `.elc`).  So the problem is more for autoloads and
`.elc` files.  And we do have `package-recompile` since Emacs-29.1.

>> 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.

While that's true in theory, in practice `package-recompile` should work
fine for all but the "weirdest" packages.

>> 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.

It could make sense to keep the tarballs, indeed.
I would see it as a cache: when asking to reinstall, we'd try and
re-fetch that specific package version, first looking for a local copy
in our cache, then looking for it in the repository ((Non)GNU ELPA does
keep a number of older versions, even though they're not listed in
`archive-contents`).
And if that fails, there's still `package-recompile` or an upgrade.


        Stefan




  reply	other threads:[~2024-02-03 22:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 15:01 Automatically saving package sources sbaugh
2024-02-03 22:08 ` Stefan Kangas
2024-02-03 22:28   ` Stefan Monnier [this message]
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

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

  git send-email \
    --in-reply-to=jwvplxdjilw.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=sbaugh@catern.com \
    --cc=stefankangas@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.