Skip to content

Commit

Permalink
Trac #20529: Get rid of SAGE_ORIG_LD_LIBRARY_PATH
Browse files Browse the repository at this point in the history
the file src/sage/repl/interpreter.py uses the variable

SAGE_ORIG_LD_LIBRARY_PATH

which is not defined by default. This cause doctests failures on
a patchbot not running in a bash shell.

Let us get rid of this variable and related code.

Example of log with failing doctests:

https://patchbot.sagemath.org/log/20240/Ubuntu/14.04/x86_64/3.16.0-71-ge
neric/irma-atlas/2016-06-30%2011:02:50?short

URL: https://trac.sagemath.org/20529
Reported by: vbraun
Ticket author(s): Volker Braun
Reviewer(s): Erik Bray
  • Loading branch information
Release Manager authored and vbraun committed Jul 11, 2016
2 parents 34bbc13 + 82d0a8c commit d3721f6
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 39 deletions.
6 changes: 2 additions & 4 deletions src/bin/sage-native-execute
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/sh

LD_LIBRARY_PATH=$SAGE_ORIG_LD_LIBRARY_PATH; export LD_LIBRARY_PATH
if [ `uname` = 'Darwin' ]; then
DYLD_LIBRARY_PATH=$SAGE_ORIG_DYLD_LIBRARY_PATH
fi
# The entire sage-native-execute should probably be removed, but wait
# for http://trac.sagemath.org/ticket/9386

"$@"

2 changes: 0 additions & 2 deletions src/bin/sage-open
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
# will leads to a crash.

unset LIBRARY_PATH
unset LD_LIBRARY_PATH
unset DYLD_LIBRARY_PATH

open "$@"
4 changes: 0 additions & 4 deletions src/doc/en/developer/packaging_old_spkgs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ package. In this script, you may make the following assumptions:
- The environment variable ``SAGE_LOCAL`` points to the
``SAGE_ROOT/local`` directory of the Sage installation.

- The environment variables ``LD_LIBRARY_PATH`` and
``DYLD_LIBRARY_PATH`` both have ``SAGE_ROOT/local/lib`` at the
front.

The ``spkg-install`` script should copy your files to the appropriate
place after doing any build that is necessary. Here is a template::

Expand Down
7 changes: 0 additions & 7 deletions src/doc/en/installation/source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1229,13 +1229,6 @@ Sage uses the following environment variables when it runs:
run a web browser, but if this doesn't seem to work on your machine, set this
variable to the appropriate command.

- :envvar:`SAGE_ORIG_LD_LIBRARY_PATH_SET` - set this to something non-empty to
force Sage to set the :envvar:`LD_LIBRARY_PATH` variable before executing
system commands.

- :envvar:`SAGE_ORIG_DYLD_LIBRARY_PATH_SET` - similar, but only used on OS X to
set the :envvar:`DYLD_LIBRARY_PATH` variable.

- :envvar:`SAGE_CBLAS` - used in the file
:file:`SAGE_ROOT/src/sage/misc/cython.py`.
Set this to the base name of the BLAS library file on your system if you want
Expand Down
7 changes: 0 additions & 7 deletions src/doc/en/reference/repl/environ.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ Installation Guide for more about those.)
command to run a web browser, but if this doesn't seem to work on
your machine, set this variable to the appropriate command.

- :envvar:`SAGE_ORIG_LD_LIBRARY_PATH_SET` -- set this to something
non-empty to force Sage to set the :envvar:`LD_LIBRARY_PATH` before
executing system commands.

- :envvar:`SAGE_ORIG_DYLD_LIBRARY_PATH_SET` -- similar, but only used
on Mac OS X to set the :envvar:`DYLD_LIBRARY_PATH`.

- :envvar:`SAGE_CBLAS` -- used in the file
:file:`SAGE_ROOT/src/sage/misc/cython.py`. Set this to the
base name of the BLAS library file on your system if you want to
Expand Down
2 changes: 1 addition & 1 deletion src/sage/libs/gap/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GAPDIR="$(SAGE_LOCAL)/gap/latest"
VALGRIND=

all: main
LD_LIBRARY_PATH=$(SAGE_LOCAL)/lib $(VALGRIND) ./main
$(VALGRIND) ./main

main: main.o Makefile
gcc -L$(SAGE_LOCAL)/lib -o main main.o -lgap -lcsage -lntl -lstdc++ -lpari -lpython2.7 -lm -lgmp
Expand Down
14 changes: 0 additions & 14 deletions src/sage/repl/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ def system_raw(self, cmd):
"""
Run a system command.
If the command is not a sage-specific binary, adjust the library
paths before calling system commands. See :trac:`975` for a
discussion of running system commands.
This is equivalent to the sage-native-execute shell script.
EXAMPLES::
Expand All @@ -196,22 +192,12 @@ def system_raw(self, cmd):
sage: shell.system_raw('true')
sage: shell.user_ns['_exit_code']
0
sage: shell.system_raw('env | grep "^LD_LIBRARY_PATH=" | grep $SAGE_LOCAL')
sage: shell.user_ns['_exit_code']
1
sage: shell.system_raw('R --version')
R version ...
sage: shell.user_ns['_exit_code']
0
sage: shell.quit()
"""
path = os.path.join(SAGE_LOCAL, 'bin',
re.split(r'[\s|;&]', cmd)[0])
if not os.access(path, os.X_OK):
libraries = 'LD_LIBRARY_PATH="$SAGE_ORIG_LD_LIBRARY_PATH";export LD_LIBRARY_PATH;'
if os.uname()[0]=='Darwin':
libraries += 'DYLD_LIBRARY_PATH="$SAGE_ORIG_DYLD_LIBRARY_PATH";export DYLD_LIBRARY_PATH;'
cmd = libraries+cmd
return super(SageShellOverride, self).system_raw(cmd)


Expand Down

0 comments on commit d3721f6

Please sign in to comment.