File tree 3 files changed +15
-19
lines changed 3 files changed +15
-19
lines changed Original file line number Diff line number Diff line change 22
22
23
23
set -o errexit
24
24
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
-
37
25
# Check that the bintools can be found, otherwise we would see very confusing
38
26
# error messages.
27
+ # For example on Windows we would find "FIND.EXE" instead of "/usr/bin/find"
28
+ # when running "find".
39
29
hash tr >& /dev/null || {
40
30
echo >&2 " ERROR: cannot locate GNU coreutils; check your PATH."
41
31
echo >&2 " (You may need to run 'export PATH=/bin:/usr/bin:\$ PATH)'"
42
32
exit 1
43
33
}
44
34
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
+
45
47
cd " $( dirname " $0 " ) "
46
48
47
49
# 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() {
129
129
ATEXIT_HANDLERS=" ${ATEXIT_HANDLERS} ${handler} "
130
130
}
131
131
132
- function restore_saved_path() {
133
- export PATH=$BAZEL_OLD_PATH
134
- export BAZEL_OLD_PATH=
135
- }
136
-
137
132
# Exit routine to run all registered atexit handlers.
138
133
#
139
134
# If the program exited with an error, this exit routine will also exit with the
@@ -183,7 +178,6 @@ function cleanup_phasefile() {
183
178
}
184
179
185
180
atexit cleanup_phasefile
186
- atexit restore_saved_path
187
181
188
182
# Excutes a command respecting the current verbosity settings.
189
183
#
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ cat > "${VSTEMP}/windows_jni.bat" <<EOF
99
99
@call "${VSVARS} " amd64
100
100
@cd $( cygpath -a -w " ${PWD} " )
101
101
@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[*]}
103
103
EOF
104
104
105
105
# Invoke the file and hopefully generate the .DLL .
You can’t perform that action at this time.
0 commit comments