-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Discover SAGE_SCRIPTS_DIR to make $SAGE_LOCAL/bin/sage work from any directory, in an environment without SAGE_* variables #25486
Comments
comment:1
Likewise, a naive trial to start the GAP shipped by Sage fails:
and one instead has to run:
or
(where This makes it hard to use |
Changed keywords from none to SAGE_LOCAL, SAGE_ROOT |
comment:2
One comment: the new version of GAP deprecates the gap.sh as the right way to start GAP. (The gap binary detects the directory that it lives in, and uses that as the default library directory.) Relying on the shell script to check for SAGE_LOCAL probably isn't a great idea for GAP 4.9.1 or later. That might make this more pressing. If you do need to check for the SAGE_LOCAL variable, it seems to me like a better place to check would be in GAP code. (The Also, I'm the Gap.app author. If it still looks necessary when I next make updates, I'll consider adding logic to set SAGE_LOCAL to a sensible guess on startup. I ran out of time for this release (as I wanted to get something out at the same time as GAP 4.9.1). I'd love for it to no longer be necessary! |
comment:3
I don't think there should be anything in GAP that cares about |
comment:5
A step into this direction: #29022 "Create module |
Dependencies: #29022 |
This comment has been minimized.
This comment has been minimized.
comment:9
This is adapted from an old branch of #21479 ( New commits:
|
Author: Matthias Koeppe |
Commit: |
comment:10
Removed a dependency that is not needed. |
Changed dependencies from #29022 to none |
This comment has been minimized.
This comment has been minimized.
comment:12
A few suggestions: rename Make
Wouldn't this permanently encode the directory in which Sage happens to be built in any Sage installation, including for binary builds? E.g. if Volker does a binary build and publishes it, then it will contain in How do distros currently handle |
comment:13
I think otherwise in principle I'm +1 to this but I don't see how it resolves that last question... |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
Replying to @embray:
Thanks! Done. |
comment:16
Replying to @embray:
Yes, that's what it does. Sage installations (
The binary build uses
Distributions tend to replace all of
Yes, in fact, there's very little left (see #25828/#28815). In any case, that's orthogonal to the present ticket. |
comment:25
pushing these forward to 9.2 |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:27
Rebased on 9.2.beta0 |
comment:28
lgtm |
Reviewer: Dima Pasechnik |
comment:29
oops, sorry, doesn't it need a shebang to make sure it is running in bash? |
comment:30
Well, I guess this ticket conflicts somehow with #29345 |
comment:31
Actually it is already documented that |
comment:32
lgtm |
comment:33
Thanks! |
Changed branch from u/mkoeppe/_sage_local_bin_sage_should_work_in_an_environment_without_sage___variables to |
comment:35
Follow up: #29446 |
Changed commit from |
comment:36
Replying to @mkoeppe:
I fixed all of the bashisms in #29345, but missed that comment. The sage build now fails again with any other
Debian's dash shell is crippled, but would it be possible to symlink |
comment:37
Follow-up on #30128 |
This ticket makes
$SAGE_LOCAL/bin/sage
work without environment variables set, or the current working directory to be something particular.It does that by
SAGE_ROOT
to$SAGE_LOCAL/bin/sage-env-config
(viasrc/bin/sage-env-config.in
).sage-env
that determinesSAGE_SCRIPTS_DIR
from the directory of itself.Previous discussion in https://groups.google.com/d/msg/sage-devel/oODph9-yjaI/FVeBsCk_CgAJ:
On Wednesday, May 30, 2018 at 9:01:59 AM UTC-7, Nils Bruin wrote:
Currently, if I run the script $SAGE_LOCAL/bin/sage in my normal environment (where SAGE_ROOT is not set) then I get:
Error: You must set the SAGE_ROOT environment variable or run this
script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory.
Error setting environment variables by sourcing '/usr/local/sage/sage-git/local/bin/sage-env';
possibly contact sage-devel (see http://groups.google.com/group/sage-devel).
If instead I run the script $SAGE_ROOT/sage a value for SAGE_ROOT is figured out and everything works
fine when called from my normal environment.
CC: @jdemeyer @nbruin @embray @kiwifb @EmmanuelCharpentier @tobihan @saraedum @slel @timokau @dimpase
Component: build
Keywords: SAGE_LOCAL, SAGE_ROOT
Author: Matthias Koeppe
Branch:
4415da5
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/25486
The text was updated successfully, but these errors were encountered: