-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sage-spkg-uninstall script and use it when possible to remove packages #25139
Comments
This comment has been minimized.
This comment has been minimized.
comment:3
and similarly for
|
comment:4
Overall this looks good to me. It's great that we finally get a feature like that in Sage :) |
Reviewer: Julian Rüth |
comment:6
Thanks for having a look! Replying to @saraedum:
I don't think that should be resolved now--the comment was just a note that it would be the correct spot, most likely, to start implementing such functionality. Thanks for reminding me about that though. There should be a follow-up ticket for it.
I agree, there should be some error checking there. It could also use
I'm not really sure it's necessary or desirable. There are various reasons it could fail, such as if that action had already (whether or not for good reasons) been performed by the user, or if the installation was otherwise broken somehow. In this case other things might break too, but at the very least you want to still allow the rest of the package uninstallation to proceed.
The
It's standard syntax understood by Sphinx for documenting module-level variables and class attributes. Some people don't like it, apparently, but I'm personally quite partial to it for documenting variables, even in code that won't necessarily be processed by Sphinx.
Maybe it's not necessary, but I wrote
Yep. And since you pointed that out I also noticed some other fishy business going on at the bottom of the |
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
|
Last 10 new commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:11
I believe I addressed all your comments, and made all the code updates I agreed were needed (especially cleaning up |
comment:12
Though before anyone reviews this further they should probably look at #24645 first. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
|
comment:14
Something in the last patchbot build went awry with brial. I'm not sure I understand the issue yet. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
|
comment:16
Ok, the issue is fixed in #24645. The next patchbot build should be good but we'll see. |
comment:18
The patchbot still seems to be unhappy. I do not understand what's going on there… |
comment:19
Looks like just a merge conflict, yet again. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
|
comment:21
Rebased, and removed the stuff related with |
comment:23
Looks good to me. I have not tested this though. If you are confident that this works, feel free to set it to positive review. |
comment:24
Will be interesting to see what the buildbots do with it, especially OSX. I expect it will be fine. |
Changed branch from u/embray/build/spkg-uninstall/script to |
This is a cleaned up an simplified version of a portion of the work originally done in #22510. This ticket adds a few new features that I felt were fundamentally inseparable (in part due to peculiarities of specific packages meaning that uninstallation could not be supported without some additional work).
Adds a new script
sage-spkg-uninstall
which is invoked likesage-spkg-uninstall <pkgname>
to uninstall a single package from$SAGE_LOCAL
(this also allows uninstalling standard packages, though we might prefer to prevent that by default). This script handles all matters of package uninstallation, including the final step of removing the package stamp file from under$SAGE_SPKG_INST
. There are two different ways a package can be uninstalled:a. "Modern" uninstallation: if a package has staged-installation support (i.e. has been updated to support Install packages in temporary root before copying to $SAGE_LOCAL #22509), this means that its stamp file contains a manifest of all files installed by that package (minus any files created by the package's
spkg-postinst
script). Therefore "modern" uninstallation consists mainly of looping over those files and removing them from$SAGE_LOCAL
. Any directories left empty by this process are also removed.b. "Legacy" uinstallation: many (though not all) packages have in their
spkg-install
script some code to perform an ad-hoc uninstallation of any previous versions of the package before installing the new version (this was sometimes necessary in particular for old versions of libraries). Support for this functionality is retained in order to properly support upgrades from older versions of Sage, where most packages may not support "modern" uninstallation.However, in order to support this properly, the legacy uninstall code for those packages should be moved out of their
spkg-install
scripts and into a newspkg-legacy-uninstall
script which is called bysage-spkg-uninstall
for these packages. This ticket includes one such example for demonstration purposes, adding anspkg-legacy-uninstall
forbrial
.In the future we may be able to deprecate, and ultimately remove these scripts. In the meantime all existing packages with uninstall code in their
spkg-install
should be updated (see followup ticket Add spkg-legacy-uninstall scripts for most standard packages #25140).Another feature this adds which is handled by
sage-spkg-uninstall
, but with some required support from thesage-spkg
script, are per-packagespkg-prerm
andspkg-postrm
scripts that are run just before and just after a package is uninstalled.This is needed in particular for some packages (namely
pkgconf
andwidgetsnbextension
) which really can't be removed properly without some pre/post-removal steps. Other packages will need this as well, but less crucially. I haven't found a specific use case yet forspkg-postrm
, but it's included for symmetry.Because these scripts are run during package uninstallation--of packages that are already installed--the scripts themselves need to be installed somewhere (e.g. Debian supports a similar feature, and keeps the scripts under
/var/lib/dpkg
somewhere). In this case a new pathSAGE_SPKG_SCRIPTS
is added under$SAGE_LOCAL/var/lib/sage/scripts
by default. Any package-specificprerm
andpostrm
scripts are stored there. After the package is uninstalled the scripts are removed as well.The Makefile is updated so that the
<pkgname>-clean
rules for most packages callsage-spkg-uninstall
, so that the packages are really thoroughly cleaned (rather than just removing their stamp files).Depends on #24645
Depends on #25039
Component: build
Keywords: uninstall
Author: Erik Bray
Branch/Commit:
7a81e70
Reviewer: Julian Rüth
Issue created by migration from https://trac.sagemath.org/ticket/25139
The text was updated successfully, but these errors were encountered: