sagemath/sage

build/bin/sage-spkg: Copy contents of build/pkgs/SPKG/spkg-env to the top of spkg-build and spkg-install

Opened this issue · 15 comments

For many spkgs, the build/pkgs/SPKG/spkg-build and spkg-install script templates set environment variables before invoking make.

This ticket allows to move environment variable settings common between these scripts to a build/pkgs/SPKG/spkg-env file, which will be included by build/bin/sage-spkg at the top of the generated executable scripts (also named spkg-build and spkg-install).

Moreover, sage-spkg generates an executable script spkg-buildsh (next to spkg-install) that drops the user into a subshell like sage -sh with spkg-env loaded.

This makes it easier to test new versions of packages.

CC: @embray @dimpase @tscrim

Component: build

Work Issues: redo on top of #29096, #29052

Author: Matthias Koeppe

Branch/Commit: u/mkoeppe/build_bin_sage_spkg__copy_contents_of_build_pkgs_spkg_spkg_env_to_the_top_of_spkg_build_and_spkg_install @ 60f3b57

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

Description changed:

--- 
+++ 
@@ -2,8 +2,11 @@
 
 This ticket allows to move environment variable settings common between these scripts to a `build/pkgs/SPKG/spkg-env` file, which will be included by `build/bin/sage-spkg` at the top of the generated executable scripts (also named `spkg-build` and `spkg-install`).
 
-Moreover, this ticket adds a command
-`sage --buildsh SPKG`
-which sources that file in addition to `src/bin/sage-env`.
+Moreover, `sage-spkg` generates an executable script `spkg-buildsh` (next to `spkg-install`) that drops the user into a subshell like `sage-sh` with spkg-env loaded.
+
+The new command `sage -i -b SPKG` only prepares the build directory (with generated scripts) but does not call build or install.
+
+The new command `sage -i -sh SPKG` prepares the build directory and then calls `spkg-buildsh`.
+
 This makes it easier to test new versions of packages.
 

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

b00ff06build/pkgs/python3/spkg-env: New, from top of spkg-build, spkg-install
a1d07b1sage-spkg: Create script spkg-buildsh, update the 'dont just' message

Description changed:

--- 
+++ 
@@ -2,7 +2,7 @@
 
 This ticket allows to move environment variable settings common between these scripts to a `build/pkgs/SPKG/spkg-env` file, which will be included by `build/bin/sage-spkg` at the top of the generated executable scripts (also named `spkg-build` and `spkg-install`).
 
-Moreover, `sage-spkg` generates an executable script `spkg-buildsh` (next to `spkg-install`) that drops the user into a subshell like `sage-sh` with spkg-env loaded.
+Moreover, `sage-spkg` generates an executable script `spkg-buildsh` (next to `spkg-install`) that drops the user into a subshell like `sage -sh` with `spkg-env` loaded.
 
 The new command `sage -i -b SPKG` only prepares the build directory (with generated scripts) but does not call build or install.
 
comment:5

IMHO we are trying to move from using sage -i to meaninful make targets, e.g. make foo-clean for uninstalling spkg foo, make foo for building/installing, etc.

Description changed:

--- 
+++ 
@@ -4,9 +4,5 @@
 
 Moreover, `sage-spkg` generates an executable script `spkg-buildsh` (next to `spkg-install`) that drops the user into a subshell like `sage -sh` with `spkg-env` loaded.
 
-The new command `sage -i -b SPKG` only prepares the build directory (with generated scripts) but does not call build or install.
-
-The new command `sage -i -sh SPKG` prepares the build directory and then calls `spkg-buildsh`.
-
 This makes it easier to test new versions of packages.
 
comment:7

But sage-spkg is not going away, is it?

comment:8

Erik has been working on these things a lot, he'd be the one to give a better advice.

Author: Matthias Koeppe

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

60f3b57Add build/pkgs/python2/spkg-env symlink

Changed commit from a1d07b1 to 60f3b57

comment:11

On top of #29052, could set SAGE_SHPROMPT_PREFIX=sage-$PKG_NAME-build.

Work Issues: redo on top of #29096, #29052

comment:15

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.