Rollback of commit 1e37a5375f918376c132fa537e25695f673f41b8.
*** Reason for rollback ***
Apparently we now try to open output files for the process twice: once when we are constructing the output streams, and the second time when we tell the process to redirect its outputs. This causes the outputs to be empty on Windows
*** Original change description ***
Do redirection of stdout / stderr in Java instead of reimplementing it in every process wrapper again.
--
MOS_MIGRATED_REVID=126801016
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index 09bb32c..2cb8e58 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -227,6 +227,31 @@
#!/bin/sh
# Dummy process wrapper, does not support timeout
shift 2
+stdout="$1"
+stderr="$2"
+shift 2
+
+if [ "$stdout" = "-" ]
+then
+ if [ "$stderr" = "-" ]
+ then
+ "$@"
+ exit $?
+ else
+ "$@" 2>"$stderr"
+ exit $?
+ fi
+else
+ if [ "$stderr" = "-" ]
+ then
+ "$@" >"$stdout"
+ exit $?
+ else
+ "$@" 2>"$stderr" >"$stdout"
+ exit $?
+ fi
+fi
+
"$@"
exit $?