Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top-level sage script: Unconditionally set SAGE_ROOT #33786

Closed
mkoeppe opened this issue May 2, 2022 · 18 comments
Closed

Top-level sage script: Unconditionally set SAGE_ROOT #33786

mkoeppe opened this issue May 2, 2022 · 18 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented May 2, 2022

This will make it more robust when accidentally invoked from a sage shell inside another Sage installation.

Related to https://groups.google.com/g/sage-release/c/GOGWk66zaCQ/m/0o9KtVDIAAAJ

Depends on #33787

CC: @dimpase @orlitzky @jhpalmieri

Component: scripts

Author: Matthias Koeppe

Branch/Commit: 01caa38

Reviewer: John Palmieri

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

@mkoeppe mkoeppe added this to the sage-9.6 milestone May 2, 2022
@mkoeppe
Copy link
Member Author

mkoeppe commented May 2, 2022

Dependencies: #33787

@mkoeppe
Copy link
Member Author

mkoeppe commented May 2, 2022

@mkoeppe
Copy link
Member Author

mkoeppe commented May 2, 2022

Commit: 252372d

@mkoeppe
Copy link
Member Author

mkoeppe commented May 2, 2022

Author: Matthias Koeppe

@mkoeppe
Copy link
Member Author

mkoeppe commented May 2, 2022

New commits:

60bcbecREADME.md, src/doc/en/installation/source.rst: Update multi-user install
2116f9fREADME.md: Update final step 'symlink sage', add jupyter kernel step
5c68335Merge #33787
252372dSAGE_ROOT/sage: Unconditionally determine SAGE_ROOT from $0; no longer invite to edit this file

@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 2, 2022
@jhpalmieri
Copy link
Member

comment:5

It looks like this doesn't change the behavior of SAGE_ROOT/sage, just the documentation. Is that correct?

@mkoeppe
Copy link
Member Author

mkoeppe commented May 10, 2022

comment:6

Looks like I forgot to push a commit

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 10, 2022

Changed commit from 252372d to d703cd1

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 10, 2022

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

d703cd1SAGE_ROOT/sage: Actually unconditionally determine SAGE_ROOT from -zsh

@mkoeppe
Copy link
Member Author

mkoeppe commented May 10, 2022

comment:8

Here it is

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 10, 2022

Changed commit from d703cd1 to 01caa38

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 10, 2022

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

01caa38SAGE_ROOT/sage: Actually unconditionally determine SAGE_ROOT from $0

@jhpalmieri
Copy link
Member

comment:10

How do we determine whether people are actually setting SAGE_ROOT outside of this file and/or modifying the commented-out line in this file? That is, how do we determine how many Sage installations this might break? Should we deprecate the setting of SAGE_ROOT first?

if [ -z "$SAGE_ROOT" ];  then
   ...
else
   (print deprecation warning)
fi

@mkoeppe
Copy link
Member Author

mkoeppe commented May 11, 2022

comment:11

Replying to @jhpalmieri:

How do we determine whether people are actually setting SAGE_ROOT outside of this file and/or modifying the commented-out line in this file? That is, how do we determine how many Sage installations this might break?

I don't think this change can break anyone's installation if that was done using the old instructions ("system-wide install"):

  • the first variant, using symlinks, still works (we just don't advertise it any more)

  • in the second variant, using a copy of the script, there's no problem because users were instructed to make the change (setting SAGE_ROOT) in the copy, not in the original. Their old copy will continue to work. If they attempt to copy and make the change again, they will see that there is no longer a place that prompts them to make the change.

@jhpalmieri
Copy link
Member

Reviewer: John Palmieri

@jhpalmieri
Copy link
Member

comment:12

Okay, let's merge it (in 9.7).

@mkoeppe
Copy link
Member Author

mkoeppe commented May 12, 2022

comment:13

Thanks!

@vbraun
Copy link
Member

vbraun commented May 24, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants