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

sage path-related troubles #4512

Closed
craigcitro opened this issue Nov 13, 2008 · 7 comments
Closed

sage path-related troubles #4512

craigcitro opened this issue Nov 13, 2008 · 7 comments

Comments

@craigcitro
Copy link
Member

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.

Component: build

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

@craigcitro craigcitro added this to the sage-3.2 milestone Nov 13, 2008
@craigcitro craigcitro self-assigned this Nov 13, 2008
@craigcitro
Copy link
Member Author

Attachment: trac-4512.patch.gz

@craigcitro
Copy link
Member Author

comment:1

This patch is for the sage-scripts repository, of course.

@mwhansen
Copy link
Contributor

comment:2

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.

@craigcitro
Copy link
Member Author

comment:3

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 ...

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Nov 14, 2008

comment:4

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

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Nov 14, 2008

comment:5

Attachment: trac-4512-pt2.patch.gz

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

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Nov 14, 2008

comment:6

Merged both patch in Sage 3.2.rc1

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Nov 14, 2008
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

2 participants