Do not require users to set TMPDIR for bootstrap on Windows.

Fixes 1444.

--
Change-Id: If9afa2bebcd35b0c0882685588d8e1f3b18f5344
Reviewed-on: https://bazel-review.googlesource.com/#/c/3890/
MOS_MIGRATED_REVID=125771832
diff --git a/scripts/bootstrap/buildenv.sh b/scripts/bootstrap/buildenv.sh
index 9382513..1ca2c71 100755
--- a/scripts/bootstrap/buildenv.sh
+++ b/scripts/bootstrap/buildenv.sh
@@ -43,6 +43,13 @@
   EXE_EXT=".exe"
 esac
 
+# Fix TMPDIR on msys
+case "${PLATFORM}" in
+msys*|mingw*)
+  TMPDIR=${TMPDIR:-$(cygpath -m $TMP)}
+esac
+
+
 # Whether we display build messages or not.  We set this conditionally because
 # the file including us or the user may already have defined VERBOSE to their
 # liking.
diff --git a/site/docs/windows.md b/site/docs/windows.md
index f12229f..92c9216 100644
--- a/site/docs/windows.md
+++ b/site/docs/windows.md
@@ -29,7 +29,6 @@
 
 ```bash
 export JAVA_HOME="$(ls -d C:/Program\ Files/Java/jdk* | sort | tail -n 1)"
-export TMPDIR=c:/temp
 export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
 ```