aboutsummaryrefslogtreecommitdiffhomepage
path: root/compile.sh
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2017-10-06 16:45:05 +0200
committerGravatar Klaus Aehlig <aehlig@google.com>2017-10-06 19:50:43 +0200
commite79a1107d90380501102990d82cbfaa8f51a1778 (patch)
treeb3e9b2ad5170cbe8baae6d394717f309861fc99b /compile.sh
parentddc8e0cd770627d3566ffd51f4802a30416e0cfc (diff)
Windows,bootstrapping: fix build_windows_jni.sh
Also: - check as the first thing in compile.sh that we can locate the GNU coreutils, and remove the duplicate check for the same thing on Windows - check early in compile.sh that we can access python.exe Fixes https://github.com/bazelbuild/bazel/issues/3863 Change-Id: Ib48b405cf93eafd48e21b280bcbab4d45117c1d9 PiperOrigin-RevId: 171291435
Diffstat (limited to 'compile.sh')
-rwxr-xr-xcompile.sh26
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