File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222
2323set -o errexit
2424
25- # Correct PATH on Windows, to avoid using "FIND.EXE" instead of "/usr/bin/find"
26- # etc, leading to confusing errors.
27- export BAZEL_OLD_PATH=$PATH
28- case " $( uname -s | tr [:upper:] [:lower:]) " in
29- msys* |mingw* |cygwin* )
30- # Check that the PATH is set up correctly by attempting to locate `[`.
31- # This ensures that `which` is installed correctly and can succeed, while
32- # also avoids accidentally locating a tool that exists in plain Windows too
33- # (like "find" for "FIND.EXE").
34- which [ > & /dev/null || export PATH= " /bin:/usr/bin:$PATH "
35- esac
36-
3725# Check that the bintools can be found, otherwise we would see very confusing
3826# error messages.
27+ # For example on Windows we would find "FIND.EXE" instead of "/usr/bin/find"
28+ # when running "find".
3929hash tr >& /dev/null || {
4030 echo >&2 " ERROR: cannot locate GNU coreutils; check your PATH."
4131 echo >&2 " (You may need to run 'export PATH=/bin:/usr/bin:\$ PATH)'"
4232 exit 1
4333}
4434
35+ # Ensure Python is on the PATH on Windows,otherwise we would see
36+ # "LAUNCHER ERROR" messages from py_binary exe launchers.
37+ case " $( uname -s | tr [:upper:] [:lower:]) " in
38+ msys* |mingw* |cygwin* )
39+ which python.exe >& /dev/null || {
40+ echo >&2 " ERROR: cannot locate python.exe; check your PATH."
41+ echo >&2 " (You may need to run 'export PATH=/c/Python27:\$ PATH)' or similar,"
42+ echo >&2 " depending on where you installed Python)."
43+ exit 1
44+ }
45+ esac
46+
4547cd " $( dirname " $0 " ) "
4648
4749# Set the default verbose mode in buildenv.sh so that we do not display command
Original file line number Diff line number Diff line change @@ -129,11 +129,6 @@ function atexit() {
129129 ATEXIT_HANDLERS=" ${ATEXIT_HANDLERS} ${handler} "
130130}
131131
132- function restore_saved_path() {
133- export PATH=$BAZEL_OLD_PATH
134- export BAZEL_OLD_PATH=
135- }
136-
137132# Exit routine to run all registered atexit handlers.
138133#
139134# If the program exited with an error, this exit routine will also exit with the
@@ -183,7 +178,6 @@ function cleanup_phasefile() {
183178}
184179
185180atexit cleanup_phasefile
186- atexit restore_saved_path
187181
188182# Excutes a command respecting the current verbosity settings.
189183#
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ cat > "${VSTEMP}/windows_jni.bat" <<EOF
9999@call "${VSVARS} " amd64
100100@cd $( cygpath -a -w " ${PWD} " )
101101@set TMP=$( cygpath -a -w " ${VSTEMP} " )
102- @CL /O2 /EHsc /LD /Fe:"$( cygpath -a -w ${DLL} ) " /I "${VSTEMP} " /I . ${WINDOWS_SOURCES[*]}
102+ @CL /O2 /EHsc /LD /Fe:"$( cygpath -a -w ${DLL} ) " /I "%TMP% " /I . ${WINDOWS_SOURCES[*]}
103103EOF
104104
105105# Invoke the file and hopefully generate the .DLL .
You can’t perform that action at this time.
0 commit comments