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
Add error messages and update documentation for spaces in $SAGE_ROOT #9644
Comments
This comment has been minimized.
This comment has been minimized.
comment:1
After applying diff --git a/sage-sage b/sage-sage
--- a/sage-sage
+++ b/sage-sage
@@ -127,7 +127,7 @@ usage_advanced() {
exit 1
}
-. $SAGE_ROOT/local/bin/sage-env 1>/dev/null 2>/dev/null
+. "$SAGE_ROOT/local/bin/sage-env" 1>/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
echo "Error setting environment variables by running $SAGE_ROOT/local/bin/sage-env; possibly contact sage-devel (see http://groups.google.com/group/sage-devel)." I get $ ./sage
----------------------------------------------------------------------
| Sage Version 4.5.2.rc0, Release Date: 2010-07-28 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
**********************************************************************
* *
* Warning: this is a prerelease version, and it may be unstable. *
* *
**********************************************************************
ls: cannot access /mnt/usb1/scratch/mpatel/tmp/my: No such file or directory
ls: cannot access sage/devel/sage: Not a directory
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
/mnt/usb1/scratch/mpatel/tmp/my sage/local/lib/python2.6/site-packages/IPython/ipmaker.pyc in force_import(modname)
64 reload(sys.modules[modname])
65 else:
---> 66 __import__(modname)
67
68
/mnt/usb1/scratch/mpatel/tmp/my sage/ipy_profile_sage.py in <module>()
14 from sage.misc.interpreter import attached_files
15
---> 16 branch = sage.misc.misc.branch_current_hg_notice(sage.misc.misc.branch_current_hg())
17 if branch:
18 print branch
/mnt/usb1/scratch/mpatel/tmp/my sage/local/lib/python2.6/site-packages/sage/misc/misc.pyc in branch_current_hg()
1877 i = s.rfind('->')
1878 if i == -1:
-> 1879 raise RuntimeError, "unable to determine branch?!"
1880 s = s[i+2:]
1881 i = s.find('-')
RuntimeError: unable to determine branch?!
Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.
sage: |
comment:3
**R T F M ! ** ;-) (Milestone Sage 6.0) It is well documented that -Leif |
comment:4
Ok, it could perhaps be documented in more prominent places, but it's (still) twice in
And afair it is (or at least has been at some time) better documented in the Installation Guide. So I would open two tickets (one could be this with changed title):
|
comment:5
Ouch, I just realized the scripting "logic" is completely insane: While
So even when an error is detected in Argh... |
comment:6
With the attached patch I get: leif@portland:~/Sage /sage-4.5.2.alpha0-j12$ ./sage
Error: The path to the Sage directory ($SAGE_ROOT) MUST NOT contain spaces.
It is currently "/home/leif/Sage /sage-4.5.2.alpha0-j12".
You must correct this by moving Sage (or renaming some directories) first.
Exiting now...
leif@portland:~/Sage /sage-4.5.2.alpha0-j12$ (Note the spaces in the path, I simply renamed a component of the path to my Sage directories.) |
comment:7
The error message could of course be a bit more friendly, for example: "Please correct this by moving Sage (or renaming some directories) first." |
comment:8
An alternative, perhaps simpler, but "less efficient" test for spaces would be: [ `echo "X${SAGE_ROOT}X" | wc -w` -ne 1 ] (This one catches leading and trailing blanks, too, like the shell function in the patch when called properly. But we usually have leading and trailing slashs/path separators in |
comment:9
I know there was one bit of code in sage which removed one space, but not multiple ones. i.e.
rather than
I changed the one occurrence I spotted, but there might be others lucking. Of course, the best way to solve this is to not have any hacks like this, and just get Sage to build with spaces in paths. If things are quoted properly, this should be possible. Perhaps there should be an environment variable that can be used to bypass that hack which removes spaces. Then we could slowly find the packages that have problems and correct them one by one. Once they were all corrected, the hack could be removed and Sage would build on paths with spaces in them. Dave |
Gives error message on spaces in $SAGE_ROOT. (Draft, but functional. Slightly more friendly.) Apply to scripts repo. |
comment:10
Attachment: trac_9644-first_aid_for_spaces_in_SAGE_ROOT-scripts_repo.patch.gz We could require people who update/provide new spkgs to at least check if the upstream supports spaces in path names (I really doubt all will), and to harden the corresponding Sage scripts in that way. But I expect this to be a long lasting process, rather than a goal for any release in the nearer future. And I have absolutely no idea which "inner" parts of Sage (i.e. Python code) might break on spaces in file or path names. Of course users that only download and install binaries should somehow get informed, too, e.g. directly on the download page. |
comment:11
And THAT was the point of the original post - that README.txt should probably also mention this issue for downloads, since he downloaded a binary. Anyway, I'm glad to see this wasn't a platform-specific issue. Probably this ticket should get closed by fixing the manual and adding the error messages, as it were, and then one could open a sage-wishlist milestone ticket for supporting spaces in the path. (The error message may also want to say that certain Sage components would fail otherwise? Or would that be too long?) |
Work Issues: Update README.txt, put info on download page(s) |
comment:12
Replying to @kcrisman:
Although the README.txt (and other scattered pieces of information) are rarely changed/current, I really thought this was a well-known issue, since I came across that in the documentation many times. (I think it once was better placed, s.t. nobody could miss it, though people tend to read READMEs and installation guides - if at all - after they run into problems... ;-) )
Yes, that's what I was thinking of, too.
As long as it fits onto a 80x25 screen... Feel free to add a "reviewer patch" or make some suggestion and I'll update the patch. I'm quite sure then this could get into 4.5.2. Someone volunteering for a revised README? Harald, ideas for the web page? |
comment:13
Oh, perhaps the Makefile or |
comment:14
Well, it's possible to add anything somewhere on the webpage, but I think it doesn't look good, or is professional, to list bugs on a download page (especially because it is never read just like the readme). I don't know the exact problem, but I'm for adding a check at the "sage" script itself -- ahh, i've just seen that above -- and to the early scripts when starting to build sage. |
comment:15
The Installation Guide definitely needs to be updated, too: [...] Make sure there are no spaces in the directory name under which you build. Running from a directory with spaces in its name is supported but discouraged. Building is not possible, since several of the components do not build if there are spaces in the path. [...] (This snippet is actually from Steps to Install from Source.) |
comment:17
An aside: For this special situation:
the patches here should get Sage to start and get I'm sure there are other problems to fix, and these patches certainly won't allow Sage to build with spaces in |
This comment has been minimized.
This comment has been minimized.
Changed work issues from Update README.txt, put info on download page(s) to Update README.txt, Wiki page, Installation Guide; put info on download page(s) |
comment:21
Thanks, Leif. I'd like to focus, for now, on releasing 4.5.3 and then on the PARI upgrade for 4.6.alpha0. I'll try to work on this ticket after 4.5.3 is out. |
Changed work issues from Update README.txt, Wiki page, Installation Guide; put info on download page(s) to Update README.txt, Wiki page(s), Installation Guide; put info on download page(s) |
This comment has been minimized.
This comment has been minimized.
comment:22
Btw: If you want to have fun, try compiling Sage with (It's |
comment:26
So we are all happy. :) Minor correction: Swap from and to in "Another approach is to create a symbolic link ...". |
comment:27
How about this? |
comment:28
Thanks, very good. |
comment:29
The invocation of sage-env from the top-level makefile is causing errors. On sage.math:
On my mac:
On t2.math:
In all cases, changing "contains-spaces" to "contains_spaces" seems to fix the problem. I'm attaching a small patch to do this. (On Solaris systems, I also see a new warning, presumably because we're not redirecting output to /dev/null: after typing "make ptestlong", I see
Note the line |
comment:31
Thanks, I wanted to make exactly the same change weeks ago... (replacing the dash in the name by an underscore). Also, (Note that this error message has always been there; you just had to look into Although the Makefile shouldn't break the assumption that we're using I wonder if |
comment:32
The changes look fine. The Here my default shell is
Now change my shell to /bin/sh
I'd prefer to use the more portable |
comment:33
Sourcing The other Sage scripts source As said before, best would be to change An even nicer solution would just "source" You can hardly touch a piece of Sage without experiencing other things to fix... ;-) |
comment:34
Could someone please update the commit strings of the "installation" and "ref" patches to be a bit more descriptive and restore the positive review? |
Attachment: trac_9644-sage-repo-installation.patch.gz Attachment: trac_9644-scripts-ref.patch.gz apply on top of other scripts patch |
comment:36
Here are new commit strings. Can we restore the positive review now? |
comment:37
Thanks! |
Changed work issues from Update README.txt, Wiki page(s), Installation Guide; put info on download page(s) to Update README.txt, Wiki page(s); put info on download page(s) |
comment:39
I've updated some Wiki pages a while ago. Harald said we shouldn't "announce bugs" on the download pages; I think a simple comment on where to currently not install Sage shouldn't be interpreted as such. |
Merged: sage-4.6.alpha2 |
Reported by Dan on sage-support:
This actually appears to be a more general problem:
Similar tickets: #5261 (OS X app bundles), #8303 (command-line arguments).
Documentation to correct / clarify:
$SAGE_ROOT/README.txt
(This file gets into the download directories, too.)Sage Installation Guide:
Wiki pages:
Perhaps also put a note onto the download pages for binaries, e.g. http://boxen.math.washington.edu/sage/linux/64bit/index.html
CC: @kcrisman @nexttime @dandrake @haraldschilly @sagetrac-mvngu
Component: misc
Work Issues: Update README.txt, Wiki page(s); put info on download page(s)
Author: John Palmieri, Leif Leonhardy
Reviewer: John Palmieri, David Kirkby
Merged: sage-4.6.alpha2
Issue created by migration from https://trac.sagemath.org/ticket/9644
The text was updated successfully, but these errors were encountered: