Changes by: Jason J. Hickey (jyh at cs.caltech.edu)
Date: 2007-06-25 11:08:22 -0700 (Mon, 25 Jun 2007)
Revision: 11110
Log message:
Addressed bug #679. Consider the problem code,
Shell. +=
foo(argv) =
cd src
pwd
x(5)
foo 10
The issue is that an alias "cd src" is called within another alias
"foo 10". Aliases get new channels, just like processes, so "cd src"
is called with stdin=4,stdout=5,stderr=6.
Omake_shell_job has an explicit test that forces an alias to be a
pipeline unless stdout=Unix.stdout&&stderr=Unix.stderr. So "cd src"
is run in a pipeline, and it has no effect.
The fix is to take out the test, which isn't needed in this particular
case. For rules, it *is* needed, because rules send their output through
a pipe to the output processor (the +/- lines, etc.), which is internal
to omake. If an alias generates a lot of output, it *must* be
run in a subprocess/thread, or omake will deadlock.