sage: Determine SAGE_LOCAL, SAGE_ROOT via sageconfig if it exists
We reduce the runtime dependency of sage
on sageenvconfig
.
We query sageconfig
(installed by sage_conf
, which has a dependency on our python3
package) for the values of SAGE_LOCAL
and SAGE_ROOT
. sageconfig
must be in the same directory as $0.
This allows the installed sage
script to be invoked directly from $SAGE_LOCAL/bin
in an environment without SAGE_...
variables, restoring what was previously implemented in #25486.
Also, we move sourcing of sageenvconfig
(but not sageenv
!) earlier in the sage
script.
This is so that commands such as $SAGE_LOCAL/bin/sage root
work correctly.
Followup tickets:
 #30888 resolve symlinks so it even works for symlinks to
$SAGE_LOCAL/bin/sage
 #30013 set
SAGE_VENV
too
 remove the buildtime dependency of the sage distribution on
src/bin/sageenvconfig
Change History (23)
Milestone: 
sage9.2 →
sagewishlist

Cc: 
François Bissey added

Dependencies: 
#29825 →
#29850

Description: 
modified (diff)

Dependencies: 
#29850 →
#22731

Branch: 
→ u/mkoeppe/get_rid_of_sage_env_config

Authors: 
→ Matthias Koeppe

Cc: 
Michael Orlitzky added

Commit: 
→ 9810f492a246441d7c570a1010558e38c1fc30ad

Description: 
modified (diff)

Status: 
new →
needs_review

Summary: 
Get rid of sageenvconfig →
sage: Determine SAGE_LOCAL, SAGE_ROOT via sageconfig if it exists

Description: 
modified (diff)

Milestone: 
sagewishlist →
sage9.3

Description: 
modified (diff)

Reviewers: 
→ Dima Pasechnik

Status: 
needs_review →
positive_review

Branch: 
u/mkoeppe/get_rid_of_sage_env_config →
9810f492a246441d7c570a1010558e38c1fc30ad

Resolution: 
→ fixed

Status: 
positive_review →
closed

Branch: 
9810f492a246441d7c570a1010558e38c1fc30ad →
u/mkoeppe/get_rid_of_sage_env_config

Resolution: 
fixed

Status: 
closed →
new

Status: 
new →
needs_review

Commit: 
9810f492a246441d7c570a1010558e38c1fc30ad →
eb3793ed6871a255bbebe35cfa4826cc6e13f9bd

Cc: 
Antonio Rojas Sébastien Labbé added

Reviewers: 
Dima Pasechnik →
Dima Pasechnik, François Bissey

Status: 
needs_review →
positive_review

Branch: 
u/mkoeppe/get_rid_of_sage_env_config →
eb3793ed6871a255bbebe35cfa4826cc6e13f9bd

Resolution: 
→ fixed

Status: 
positive_review →
closed

Last 10 new commits:
src/bin/sage: Only source sageenvconfig if it exists
src/bin/sage: Use python3 etc. from PATH instead of using SAGE_LOCAL
src/bin/sageenv: Make sageenvconfig optional
sage.env: Add SAGE_VENV
src/sage: Replace some SAGE_LOCAL by SAGE_VENV
src/bin/sage: Fix reference to trac ticket
src/sage/env.py: Add documentation
Merge branch 't/22731/22731' into t/29852/get_rid_of_sage_env_config
src/bin/sage: Find SAGE_ROOT, SAGE_LOCAL from sageconfig
src/bin/sage: Determine SAGE_ROOT, SAGE_LOCAL earlier