-
-
Notifications
You must be signed in to change notification settings - Fork 564
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
Allow running Sage with a temporary DOT_SAGE directory #11932
Comments
comment:1
I copied some patches from #11926 (and make some small changes to John's patch). |
Dependencies: #11926 |
comment:3
I'd rename the function (as it creates a temporary directory), and not use a global variable for the "return value". The function could either take the variable name as its parameter (such that |
comment:4
Replying to @nexttime:
|
comment:5
Here's a version in which the function echoes the path of the temp dir. This works best with the patch from #11924: without applying the patch there, the parent directory of the temporary .sage directory gets polluted with pickle cache files. |
This comment has been minimized.
This comment has been minimized.
Milestone sage-4.7.3 deleted |
comment:7
Rebased to #11073. Documentation added. |
This comment has been minimized.
This comment has been minimized.
Reviewer: Jeroen Demeyer |
comment:8
The following seems to be portable:
so I would use this instead of
Finally, why not simply run
in |
Author: John Palmieri |
comment:9
I meant "in |
This comment has been minimized.
This comment has been minimized.
comment:10
Fixed. The patch to spkg/install is no longer valid; instead, we need to patch the sage-starts script. |
comment:11
This is not working, and I'm probably making some bash error in the
it works as it should: no banner, just "hello", then a new shell prompt. When I run
it starts up Sage, prints a banner, prints "hello", and then gives the Sage prompt. As a consequence, the |
comment:19
On an entirely different topic: I don't like the |
comment:20
Here are new patches which just use |
Attachment: trac_11932-scripts.patch.gz scripts repo |
documentation patch (Sage library) |
comment:21
Attachment: trac_11932-doc.patch.gz It would be nice to also have |
comment:22
Perhaps on another ticket... |
comment:23
Unfortunately, this doesn't quite work properly since
I suggest moving the |
comment:25
Okay, here's a new root patch. |
comment:26
Just one more issue: now that you don't source
by
If you make this change, you can give this ticket positive review. Furthermore, I would like to point out that |
root repo |
Attachment: trac_11932-root.patch.gz |
This comment has been minimized.
This comment has been minimized.
comment:27
Attachment: trac_11932-root.v2.patch.gz Here are two versions. If we want the easy root, the first version just makes the change diff --git a/spkg/bin/sage b/spkg/bin/sage
--- a/spkg/bin/sage
+++ b/spkg/bin/sage
@@ -238,7 +238,7 @@ cd "$SAGE_ROOT"
if [ "$1" = '--nodotsage' ]; then
export DOT_SAGE=`mktemp -d ${TMPDIR:-/tmp}/dotsageXXXXXX`
shift
- command sage "$@"
+ command "$0" "$@"
status=$?
rm -rf "$DOT_SAGE"
exit $status The second version deals (I think) with the matplotlib issue, creating the config directory in sage.misc.misc, where other subdirectories of diff --git a/spkg/bin/sage-env b/spkg/bin/sage-env
--- a/spkg/bin/sage-env
+++ b/spkg/bin/sage-env
@@ -281,8 +281,9 @@ fi
if [ "$DOT_SAGE" = "" ]; then
# It is *not* an error if this directory does not exist, it will
- # be created in spkg/bin/sage. This also works if $HOME/.sage is a
- # symbolic link to a non-existing directory.
+ # be created in spkg/bin/sage or devel/sage/sage/misc/misc.py.
+ # This also works if $HOME/.sage is a symbolic link to a
+ # non-existing directory.
DOT_SAGE=`resolvelinks "$HOME/.sage"`
# In theory, DOT_SAGE is not required to have a trailing slash.
@@ -340,8 +341,7 @@ if [ -f "$MPLINITFILE" ]; then
MPLCONFIGDIR="$DOT_SAGE/matplotlib"
fi
export MPLCONFIGDIR
- # Create the directory, because matplotlib doesn't seem to be happy otherwi
- mkdir -p "$MPLCONFIGDIR"
+ # The directory is created when Sage starts (see sage.misc.misc).
fi
# Add some directories to $LD_LIBRARY_PATH: If you have time to look at the second version, please consider it. If you would rather deal with just the first version here, we can move the other version to a new ticket. |
comment:28
For the Sage patch, what about:
I don't see a reason to create a directory when the environment variable doesn't exist. |
comment:29
Since we set |
comment:30
Attachment: trac_11932-sage.v2.patch.gz Looks good and works well. I'm currently running
|
This comment has been minimized.
This comment has been minimized.
comment:31
|
Merged: sage-5.1.beta0 |
Version which deals with matplotlib issue: apply
Depends on #11926
CC: @jhpalmieri
Component: scripts
Author: John Palmieri
Reviewer: Jeroen Demeyer
Merged: sage-5.1.beta0
Issue created by migration from https://trac.sagemath.org/ticket/11932
The text was updated successfully, but these errors were encountered: