From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Automatically saving package sources Date: Sat, 03 Feb 2024 17:28:56 -0500 Message-ID: References: <87il367vvf.fsf@catern.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24117"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: sbaugh@catern.com, emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 03 23:29:54 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rWOWH-00061j-Q1 for ged-emacs-devel@m.gmane-mx.org; Sat, 03 Feb 2024 23:29:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rWOVa-0001Hf-Bo; Sat, 03 Feb 2024 17:29:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rWOVY-0001HJ-IA for emacs-devel@gnu.org; Sat, 03 Feb 2024 17:29:08 -0500 Original-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 ) id 1rWOVW-0001M3-OR for emacs-devel@gnu.org; Sat, 03 Feb 2024 17:29:08 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9AC2810035E; Sat, 3 Feb 2024 17:29:04 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1706999343; bh=KsywuKqB1DX9QQXoSTwuBkj7VAl38eOkVIbeHlV2yII=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Fqz9QcIV7ovUOI3CNW0Rx6mZFpSFQlO6O1SGR6l5WrbCCZBydFBB1EnzTkWkXt2L0 ilDgQBzAJ6p3vJXYO3eghdTFxsVL5WF8Z2qRKpNkmXsdJ+iLJyfl1V3xK7ZyWeJS9A LuhP1Z1P9+6ZfLXMmrGwJkIYmHzcyqbevrjQeJlcJUriSmdtMrgkkcYsTLgfAziqrR YNlrsT20U+27vnMF05u3ZA1rBDU2vYCAGeZVXBiR2uXM18WqJHQAFSUI5rwxIMYda8 fKSldqOd3wTS6OtehB0KfYLQoknitO69GozXfu/zahElANveSwMiUjk4dPqT6Uf/c3 c6tdsrgHT/FLA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 94F54100192; Sat, 3 Feb 2024 17:29:03 -0500 (EST) Original-Received: from alfajor (69-165-153-17.dsl.teksavvy.com [69.165.153.17]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6974912078A; Sat, 3 Feb 2024 17:29:03 -0500 (EST) In-Reply-To: (Stefan Kangas's message of "Sat, 3 Feb 2024 17:08:46 -0500") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:315841 Archived-At: >> 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