Various scripts refer to "$SAGE_LOCAL/bin" in a way that conflates several different uses. We introduce new variables to give packagers more flexibility without having to patch, and to enable new installation schemes, including the use of Sage in users' venvs.
1a. Introduce $SAGE_BIN as the place where the binaries of all the SPKGs get installed to. Default is $SAGE_LOCAL/bin/.
1b. (Wishlist item:) Make it configurable through ./configure --bindir, but this would need major changes to spkg-configure scripts. (Supporting --bindir would be another step toward more autotools compliance, see Meta-ticket #21566.)
2a. Scripts such as src/bin/sage, src/bin/sage-eval are installed by the sagelib package using the scripts facility of distutils/setuptools. If sagelib is installed into a venv, these scripts are installed into the bin directory of the venv. For the default installation in sage-the-distribution --with-system-python, this venv is identical with SAGE_LOCAL. But if other venvs are created by the user, it will be unrelated to SAGE_LOCAL; in fact, SAGE_LOCAL may be undefined (in distribution packaging and when installing sagelib through pip). As proposed in #29013, we use the variable SAGE_VENV for this, so these scripts would be referred to as $SAGE_VENV/bin/sage-eval etc.
2b. Referring to the python3 used for sage. Likewise, this comes from the venv, not $SAGE_LOCAL/bin. So it should be referred to as $SAGE_VENV/bin/python3.
2c. The subset of the scripts in src/bin, currently installed by the sagelib package, that are "libexec"-like (not user-facing). Distribution packagers would like to hide these scripts. (In the old description of this ticket, it was proposed to use $SAGE_SCRIPTS_DIR for this, but a more specific name is needed: We will use $SAGE_VENV_SCRIPTS_DIR.)
In this ticket, we introduce SAGE_VENV for 2abc, ignoring the "libexec" aspect (using $SAGE_VENV/bin directly instead of going through SAGE_VENV_SCRIPTS_DIR). Items 1 and the libexec aspect of 2c can be done on follow-up tickets.
We also make sage-env-config optional from the viewpoint of the other scripts. This is preparation for #29850 / #29852.
See also:
Depends on #29951
CC: @mkoeppe @jhpalmieri @orlitzky @tobiasdiez @isuruf @antonio-rojas @mwageringel
Component: porting
Author: Matthias Koeppe
Branch/Commit: 38eebc3
Reviewer: Tobias Diez, Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/22731
Various scripts refer to "$SAGE_LOCAL/bin" in a way that conflates several different uses. We introduce new variables to give packagers more flexibility without having to patch, and to enable new installation schemes, including the use of Sage in users' venvs.
1a. Introduce
$SAGE_BINas the place where the binaries of all the SPKGs get installed to. Default is$SAGE_LOCAL/bin/.1b. (Wishlist item:) Make it configurable through
./configure --bindir, but this would need major changes to spkg-configure scripts. (Supporting--bindirwould be another step toward more autotools compliance, see Meta-ticket #21566.)2a. Scripts such as
src/bin/sage,src/bin/sage-evalare installed by thesagelibpackage using thescriptsfacility of distutils/setuptools. Ifsagelibis installed into a venv, these scripts are installed into thebindirectory of the venv. For the default installation in sage-the-distribution--with-system-python, this venv is identical withSAGE_LOCAL. But if other venvs are created by the user, it will be unrelated toSAGE_LOCAL; in fact,SAGE_LOCALmay be undefined (in distribution packaging and when installing sagelib through pip). As proposed in #29013, we use the variableSAGE_VENVfor this, so these scripts would be referred to as$SAGE_VENV/bin/sage-evaletc.2b. Referring to the
python3used for sage. Likewise, this comes from the venv, not$SAGE_LOCAL/bin. So it should be referred to as$SAGE_VENV/bin/python3.2c. The subset of the scripts in
src/bin, currently installed by thesagelibpackage, that are "libexec"-like (not user-facing). Distribution packagers would like to hide these scripts. (In the old description of this ticket, it was proposed to use$SAGE_SCRIPTS_DIRfor this, but a more specific name is needed: We will use$SAGE_VENV_SCRIPTS_DIR.)In this ticket, we introduce
SAGE_VENVfor 2abc, ignoring the "libexec" aspect (using$SAGE_VENV/bindirectly instead of going throughSAGE_VENV_SCRIPTS_DIR). Items 1 and the libexec aspect of 2c can be done on follow-up tickets.We also make
sage-env-configoptional from the viewpoint of the other scripts. This is preparation for #29850 / #29852.See also:
src/bin/sage-env: Make sure$SAGE_VENV/binis at the beginning of the PATHsrc/bin/sage-env: MakeSAGE_ROOTandSAGE_LOCALoptionalsrc/requirements.txtfor installation ofsagelibin a venvDepends on #29951
CC: @mkoeppe @jhpalmieri @orlitzky @tobiasdiez @isuruf @antonio-rojas @mwageringel
Component: porting
Author: Matthias Koeppe
Branch/Commit:
38eebc3Reviewer: Tobias Diez, Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/22731