diff options
-rwxr-xr-x | compile.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compile.sh b/compile.sh index 23412730ad..31bb9c4f1c 100755 --- a/compile.sh +++ b/compile.sh @@ -35,8 +35,9 @@ hash tr >&/dev/null || { # 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 +case "$(uname -s | tr "[:upper:]" "[:lower:]")" in msys*|mingw*|cygwin*) + # Ensure Python is on the PATH, otherwise the bootstrapping fails later. which python.exe >&/dev/null || { echo >&2 "ERROR: cannot locate python.exe; check your PATH." echo >&2 " You may need to run the following command, or something" @@ -44,6 +45,10 @@ msys*|mingw*|cygwin*) echo >&2 " export PATH=\"/c/Python27:\$PATH\"" exit 1 } + # Ensure TMPDIR uses the user-specified TMPDIR or TMP or TEMP. + # This is necessary to avoid overly longs paths during bootstrapping, see for + # example https://github.com/bazelbuild/bazel/issues/4536 + export TMPDIR="${TMPDIR:-${TMP:-${TEMP:-}}}" esac cd "$(dirname "$0")" |