diff options
Diffstat (limited to 'compile.sh')
-rwxr-xr-x | compile.sh | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/compile.sh b/compile.sh index c72a8026d1..076dd2492a 100755 --- a/compile.sh +++ b/compile.sh @@ -22,26 +22,28 @@ set -o errexit -# Correct PATH on Windows, to avoid using "FIND.EXE" instead of "/usr/bin/find" -# etc, leading to confusing errors. -export BAZEL_OLD_PATH=$PATH -case "$(uname -s | tr [:upper:] [:lower:])" in -msys*|mingw*|cygwin*) - # Check that the PATH is set up correctly by attempting to locate `[`. - # This ensures that `which` is installed correctly and can succeed, while - # also avoids accidentally locating a tool that exists in plain Windows too - # (like "find" for "FIND.EXE"). - which [ >&/dev/null || export PATH="/bin:/usr/bin:$PATH" -esac - # Check that the bintools can be found, otherwise we would see very confusing # error messages. +# For example on Windows we would find "FIND.EXE" instead of "/usr/bin/find" +# when running "find". hash tr >&/dev/null || { echo >&2 "ERROR: cannot locate GNU coreutils; check your PATH." echo >&2 " (You may need to run 'export PATH=/bin:/usr/bin:\$PATH)'" exit 1 } +# Ensure Python is on the PATH on Windows,otherwise we would see +# "LAUNCHER ERROR" messages from py_binary exe launchers. +case "$(uname -s | tr [:upper:] [:lower:])" in +msys*|mingw*|cygwin*) + which python.exe >&/dev/null || { + echo >&2 "ERROR: cannot locate python.exe; check your PATH." + echo >&2 " (You may need to run 'export PATH=/c/Python27:\$PATH)' or similar," + echo >&2 " depending on where you installed Python)." + exit 1 + } +esac + cd "$(dirname "$0")" # Set the default verbose mode in buildenv.sh so that we do not display command |