Opened 2 years ago

Closed 2 years ago

#24645 closed enhancement (fixed)

Support for spkg-postinst scripts

Reported by: embray Owned by:
Priority: major Milestone: sage-8.3
Component: build Keywords:
Cc: Merged in:
Authors: Erik Bray Reviewers: Julian Rüth
Report Upstream: N/A Work issues:
Branch: a1b1c16 (Commits) Commit: a1b1c166196a63f1e06bad0939cae60b74fde8df
Dependencies: #24644 Stopgaps:

Description

This is a change separated out from #22509, to add support for spkg-postinst scripts in SPKGs. These are run after spkg-install and, in the case of packages that support $SAGE_DESTDIR, after the package's main files have been copied into $SAGE_LOCAL.

This allows for post-installation steps that are easier to perform once the package has been installed into its runtime context. It may be used to generate additional files which are not tracked. In this it would be good to have an spkg-postrm script that cleans up any such files, but for now that is omitted since we don't have proper package uninstallation yet (this was added in #22510 which still needs to be updated).

Change History (15)

comment:1 Changed 2 years ago by embray

  • Status changed from new to needs_review

comment:2 Changed 2 years ago by embray

  • Dependencies set to #24644

comment:3 Changed 2 years ago by embray

  • Type changed from defect to enhancement

comment:4 Changed 2 years ago by embray

Note: #25139 now provides spkg-postrm and spkg-prerm capabilities.

comment:5 Changed 2 years ago by saraedum

additionall is a typo I think.

comment:6 Changed 2 years ago by saraedum

Could we add a ticket number to the TODO that tracks this?

comment:7 Changed 2 years ago by saraedum

  • Reviewers set to Julian Rüth

Otherwise, feel free to set this to positive review.

comment:8 Changed 2 years ago by embray

  • Status changed from needs_review to needs_work

In #25139 I actually removed the TODO comment, since there's a ticket for that now. I forgot that was originally introduced in this ticket. I'll just clean that up and set positive review.

comment:9 Changed 2 years ago by git

  • Commit changed from 828fdf7837c1e8f127a95053e8ae150abb087932 to 9499342c7f8486243706bfeb93c71e2d7240ddf1

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

4c66f35Added the ability for packages to have a post-install script called spkg-postinst.
168eaebThe postinst script should probably be run with SAGE_SUDO if it is set
9499342Add a paragraph to the docs about spkg-postinst

comment:10 Changed 2 years ago by embray

  • Status changed from needs_work to positive_review

comment:11 Changed 2 years ago by embray

  • Status changed from positive_review to needs_work

From #25139, I see there's still an unresolved issue here: When running post-install scripts the $SAGE_DESTDIR variable should not be set anymore (or even unset).

By design, the post-install scripts run after the package files have already been moved into the real $SAGE_LOCAL, so any commands run in the post-install scripts should not use $SAGE_DESTDIR.

comment:12 Changed 2 years ago by git

  • Commit changed from 9499342c7f8486243706bfeb93c71e2d7240ddf1 to a1b1c166196a63f1e06bad0939cae60b74fde8df

Branch pushed to git repo; I updated commit sha1. New commits:

a1b1c16Ensure SAGE_DESTDIR and SAGE_DESTDIR_LOCAL are unset once they are no longer needed (in particular, before the postinst script)

comment:13 Changed 2 years ago by embray

  • Status changed from needs_work to positive_review

Ok, I confirmed that this fixed the issue in #25139, so I'll set back to positive review unless anyone has an objection.

comment:14 Changed 2 years ago by embray

  • Milestone changed from sage-8.2 to sage-8.3

comment:15 Changed 2 years ago by vbraun

  • Branch changed from u/embray/build/spkg-postinst to a1b1c166196a63f1e06bad0939cae60b74fde8df
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.