Opened 10 years ago
Closed 10 years ago
#4512 closed defect (fixed)
[with patch, positive review] sage path-related troubles
Reported by: | craigcitro | Owned by: | craigcitro |
---|---|---|---|
Priority: | blocker | Milestone: | sage-3.2 |
Component: | build | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Unfortunately, it seems that sage -sh
doesn't ask the shell to avoid processing the .profile
or equivalent. In particular, it can lead to things like this:
[craigcitro@sharma ~/new-three-two] $ ./sage -version Sage Version 3.2.rc0, Release Date: 2008-11-10 [craigcitro@sharma ~/new-three-two] $ ./sage -sh Starting subshell with Sage environment variables set. Be sure to exit when you are done and do not do anything with other copies of Sage! [craigcitro@sharma ~/new-three-two] $ sage -version SAGE Version 3.1.4, Release Date: 2008-10-16 [craigcitro@sharma ~/new-three-two] $ which sage /usr/local/bin/sage
This comes from the fact that I manually prepend certain things to my path in my .bashrc
. Sadly, this leads to several small, subtle issues. I've attached a patch which turns several calls to sage
into $SAGE_ROOT/sage
.
However, something more serious is needed. I think that the right approach is to start the new shell without processing any login files, so that we know our path is correct. The patch does that.
I'm listing this as a blocker, because it causes such subtle errors, and because a fix is attached.
Attachments (2)
Change History (8)
Changed 10 years ago by
comment:1 Changed 10 years ago by
- Status changed from new to assigned
comment:2 Changed 10 years ago by
Could we at least have a PS1 that includes the current directory? I always hated it when I was on a machine where "sage -sh" didn't use my existing PS1.
comment:3 Changed 10 years ago by
Yeah, that would be very reasonable.
Actually, we could go one further: have a specific place in ~/.sage/
where one can put .profile
files and whatnot, with big warnings about paths. The point is really just that we don't want to grab the system-wide ones ...
comment:4 Changed 10 years ago by
Craig,
I am not so sure this is a blocker, i.e. just because your .profile is misconfigured doesn't mean that as a consequence somebody else's config will not be broken by fixing it for you. I am inclined to merge this patch, but I need to think about it.
Cheers,
Michael
Changed 10 years ago by
comment:5 Changed 10 years ago by
- Summary changed from [with patch, needs review] sage path-related troubles to [with patch, positive review] sage path-related troubles
trac-4512-pt2.patch addresses all my concerns even though it could be cleaner, i.e. via some special parameter. Craig will do so in a followup ticket, so positive review.
Cheers,
Michael
comment:6 Changed 10 years ago by
- Resolution set to fixed
- Status changed from assigned to closed
Merged both patch in Sage 3.2.rc1
This patch is for the
sage-scripts
repository, of course.