[plt-scheme] (getenv ...)/standalone executables?

From: Matt Jadud (mcj4 at kent.ac.uk)
Date: Tue May 30 15:33:18 EDT 2006

Hi all,

We're seeing some things that we can't quite figure out.

Given the following code:

(module footest mzscheme
   (printf "PATH from MzScheme: ~a~n" (getenv "PATH"))
)

we get different behaviors under different versions of MzScheme. We're 
not clear if this is to be expected or not.

MzScheme SVN:HEAD (just checked out), we can do the following:

mzc --exe footest footest.ss
./footest

and get the full path back from the environment. However, if we instead 
do something like

export PATH=".:$PATH" ; footest

we only get the first element from the path back. In this case, we only 
get ".", because it is now the first directory in the path.

So, it would appear that the PATH is reported differently by "getenv" 
depending on whether we invoke the executable with a fully specified 
path or not. This seems to be independent of the shell we're executing 
under; we've tried 'sh' and 'bash', anyway. These tests were run on two 
Intel/Linux boxen, one running Debian (stable/unstable), and one running 
an up-to-date Ubuntu 5.10.

This does not seem to be a problem with (say) 301.5 (which I had laying 
around on the Ubuntu machine). That is, 301.5 reports the full path 
regardless of how the executable is invoked.

On my Mac (10.4.current), 301.14 does not exhibit this behavior. 
SVN:HEAD, just downloaded, does not exhibit this behavior, either.

Does this represent a bug, or a new feature? And, do you need to know 
more about the *NIX systems/shells we're using if this is a bug?

EXE PATH?
---
While I'm at it, when copying an executable from one Linux machine to 
another, the executable reports:

mcj4 at pianosa:/tmp$ ./footest
./footest: failed to start /home/<username>/plt/bin/mzscheme

where the executable was built on one machine, and run on another. I 
know things have changed, but this seems problematic. I went back 
through the messages on the 301.13 thread (which had to do with related 
issues), but I didn't see anything that clued me in as to what to do. 
Granted, it's been a long day, and well past my dinner time. (PB&J time, 
methinks...)

Cheers,
Matt


Posted on the users mailing list.