Skip to content

Support splitting spkg install into spkg-build and spkg-install (for SAGE_SUDO) #21726

@mkoeppe

Description

@mkoeppe

Here's a new attempt toward #21537 that is perhaps more elegant.

Let's change build/bin/sage-spkg as follows:

  • If spkg-build exists, call that, followed by $SAGE_SUDO spkg-install.
  • Otherwise, just call spkg-install (withOUT $SAGE_SUDO). (Such packages cannot be installed into a SAGE_ROOT that is only root-writable, unless they use $SAGE_SUDO themselves.)

The patch changes two example packages, to demonstrate this: 4ti2 and lcalc.

Before the patch:

$ rm -Rf local/share/4ti2
$ mkdir local/share/4ti2
$ sudo chown root local/share/4ti2
$ ./sage -f 4ti2
[...]
[4ti2-1.6.7] mkdir: /Users/mkoeppe/s/sage/sage-rebasing/local/share/4ti2/doc: Permission denied
[4ti2-1.6.7] make[4]: *** [install-docDATA] Error 1
[...]
$ sudo chown root local/bin/ local/bin/lcalc
$ ./sage -f lcalc 
[...]
[lcalc-1.23.p14] cp -f lcalc /Users/mkoeppe/s/sage/sage-rebasing/local//bin/.
[lcalc-1.23.p14] cp: /Users/mkoeppe/s/sage/sage-rebasing/local//bin/./lcalc: Permission denied
[...] 

Then, after the patch:

$ export SAGE_SUDO="sudo -E"
$ ./sage -f 4ti2 lcalc  # succeeds

Other packages will be handled in follow-up tickets.

See also:

CC: @jdemeyer @kiwifb @embray @vbraun @dimpase @tscrim

Component: build

Author: Matthias Koeppe

Branch: 48053d0

Reviewer: Erik Bray

Issue created by migration from https://trac.sagemath.org/ticket/21726

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions