Opened 11 years ago

Closed 11 years ago

#12698 closed enhancement (fixed)

Add a warning not to install packages using the Sage shell

Reported by: Jeroen Demeyer Owned by: Leif Leonhardy
Priority: major Milestone: sage-5.0
Component: scripts Keywords:
Cc: Merged in: sage-5.0.beta10
Authors: Jeroen Demeyer Reviewers: John Palmieri
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #11790 Stopgaps:

Status badges

Description (last modified by Jeroen Demeyer)

As we found out in http://trac.sagemath.org/sage_trac/ticket/12369#comment:189, you cannot use the Sage shell to install Sage packages.

The problem is that sage-env has some conditional commands. One of these commands is setting LD_LIBRARY_PATH. With #12405, only existing directories are added to LD_LIBRARY_PATH. Upon entering the Sage shell, $SAGE_LOCAL/lib might not exist yet, so that directory isn't added. Since now SAGE_ENV_SOURCED=1, the variable LD_LIBRARY_PATH is not changed anymore. Similarly, PYTHONHOME and PYTHONPATH are only set when Python has been installed.

This ticket is about adding a warning when running sage --sh. After the patch:

$ ./sage --sh

Starting subshell with Sage environment variables set.  Don't forget
to exit when you are done.  Beware:
 * Do not do anything with other copies of Sage on your system.
 * Do not use this for installing Sage packages using "sage -i" or for
   running "make" at Sage's root directory.  These should be done
   outside the Sage shell.

Bypassing shell configuration files...

Note: SAGE_ROOT=/usr/local/src/sage-5.0.beta8
(sage-sh) jdemeyer@arcanis:sage-5.0.beta8$

Apply 12698_sh_beware.patch to SAGE_ROOT.

Attachments (1)

12698_sh_beware.patch (1.5 KB) - added by Jeroen Demeyer 11 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 11 years ago by Jeroen Demeyer

Authors: Jeroen Demeyer
Description: modified (diff)
Status: newneeds_review

comment:2 Changed 11 years ago by John Palmieri

The comment about not running make seems to conflict with the error message in sage-spkg:

Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
  (cd '`pwd`' && '$SAGE_ROOT/sage' -sh)
When you are done debugging, you can type "exit" to leave the subshell.

(It's not clear what should be done to "debug the error", but running make seems like a natural thing to do.) Not running sage -i ... makes sense, but can you clarify the issue about running make?

comment:3 in reply to:  2 Changed 11 years ago by Jeroen Demeyer

Status: needs_reviewneeds_work

Replying to jhpalmieri:

Not running sage -i ... makes sense, but can you clarify the issue about running make?

I meant Sage's top-level "make" (or "make" inside SAGE_ROOT/spkg with #10492). Running "make" inside a spkg directory is fine, and indeed one is encouraged to use the Sage shell for that.

So the wording should be improved.

comment:4 Changed 11 years ago by Jeroen Demeyer

Description: modified (diff)
Status: needs_workneeds_review

Changed 11 years ago by Jeroen Demeyer

Attachment: 12698_sh_beware.patch added

comment:5 Changed 11 years ago by John Palmieri

Reviewers: John Palmieri
Status: needs_reviewpositive_review

I think this is okay now.

comment:6 Changed 11 years ago by Jeroen Demeyer

Merged in: sage-5.0.beta10
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.