On Monday, May 16, 2022 at 9:12:53 PM UTC-7 hohoa...@gmail.com wrote:

> Is it this snippet, would you please elaborate?
>
> <snippet from src/bin/sage-env around line 111>
> # Make sure that SAGE_ROOT is either an absolute physical directory name
> # or empty.
> if [ -n "$SAGE_ROOT" ]; then
>     export SAGE_ROOT=$(cd "$SAGE_ROOT" 2>/dev/null && pwd -P)
> fi
> </snippet from src/bin/sage-env around line 111>
>

Yes. You asked what happens when SAGE_ROOT has disappeared.
Well, in this case, after these lines are run, SAGE_ROOT will be empty.

BTW, it is rather confusing to see in '$SAGE_LOCAL/bin/sage':
>
> if [ -f "${SELF}-env-config" ]; then
>     # As of Trac #22731, sage-env-config is optional.
>     . "${SELF}-env-config" >&2
> fi
>
> again export SAGE_ROOT and SAGE_LOCAL (same as in the original question, 
> about 10 lines below)
>
 
It is actually $SAGE_VENV/bin/sage. When this script is invoked directly, 
it does not know about SAGE_ROOT. It first sources 
$SAGE_LOCAL/bin/sage-config to find the value of SAGE_ROOT and SAGE_LOCAL. 
Afterwards it sources $SAGE_LOCAL/bin/sage-env-config (and then 
$SAGE_LOCAL/bin/sage-env) to find the value of SAGE_ROOT and SAGE_LOCAL.

There is some redundancy there. sage-config is relatively new (it was added 
in https://trac.sagemath.org/ticket/29038), and it might be that in some 
downstream packaging of Sage it is not installed. sage-env-config has been 
around for a longer time, and eventually we may want to get rid of it.
See https://trac.sagemath.org/ticket/21707 for an overview of this work.
 

> Is it a prerequisite that $SAGE_ROOT be part of the installation and it 
> must stay as long as $SAGE_LOCAL is around?
>

No, it is not required. SAGE_LOCAL is a self-contained installation 
hierarchy. If you use "configure --prefix=..." to set SAGE_LOCAL to a 
directory outside of SAGE_ROOT, then it is OK to delete SAGE_ROOT 
afterwards. After you delete it, of course the commands that need 
SAGE_ROOT, such as "sage -i" for package installation, are no longer 
available.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/05b0133d-c125-4f5c-b8b7-eeb3a9b63561n%40googlegroups.com.

Reply via email to