octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EXEC_PATH


From: John W. Eaton
Subject: EXEC_PATH
Date: Thu, 25 Nov 2010 12:26:44 -0500

On 25-Nov-2010, Marco Atzeri wrote:

| while testing to print plots on latest dev on cygwin, 
| I hit a strange problem
| 
| What could cause that EXEC_PATH losts the PATH portion 
| coming from the system ?
| 
| octave:1> getenv("OCTAVE_EXEC_PATH")
| ans = 
| 
| octave:2> EXEC_PATH
| ans = 
/usr/local/libexec/octave/3.3.54+/site/exec/i686-pc-cygwin:/usr/local/libexec/octave/api-v42+/site/exec/i686-pc-cygwin:/usr/local/libexec/octave/site/exec/i686-pc-cygwin:/usr/local/libexec/octave/3.3.54+/exec/i686-pc-cygwin:/usr/local/bin
| 
| octave:3> getenv("PATH")
| ans = 
/home/itq00146/bin:/usr/local/bin:/usr/local/lib/bin:/usr/bin:/usr/lib/lapack:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/utility:/usr/local/libexec/octave/3.3.54+/site/exec/i686-pc-cygwin:/usr/local/libexec/octave/api-v42+/site/exec/i686-pc-cygwin:/usr/local/libexec/octave/site/exec/i686-pc-cygwin:/usr/local/libexec/octave/3.3.54+/exec/i686-pc-cygwin:/usr/local/bin
| 
| I do not see such problem on a fedora 14 under virtual box,
| as there OCTAVE_EXEC_PATH = PATH

EXEC_PATH is now just the extra directories to append to PATH.

Currently that is done by

  1. storing the value of PATH when Octave starts

  2. setting PATH in the environment to the original PATH + EXEC_PATH
     when EXEC_PATH is initialized or any time EXEC_PATH changes

I added the following note in the set_exec_path function in
src/defaults.cc:

  // FIXME -- should we really be modifying PATH in the environment?
  // The way things are now, Octave will ignore directories set in the
  // PATH with calls like
  //
  //   setenv ("PATH", "/my/path");
  //
  // To fix this, I think Octave should be searching the combination of
  // PATH and EXEC_PATH for programs that it executes instead of setting
  // the PATH in the environment and relying on the shell to do the
  // searching.

so I'm considering this change as well, so that changes to PATH while
Octave is running will not be ignored when executing programs.  I
think the current behavior might be confusing.  However, it has always
been this way and I don't recall complaints (though previously, the
extra directories were prepended to PATH).  The recent changes were
in response to bug report #31695.  Oops, I see there was no ChangeLog
entry for this change.  I will fix that.

BTW, how did you notice this, and in what way did it cause a problem
for you?

Maybe I should mention this change in the NEWS file.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]