aboutsummaryrefslogtreecommitdiffhomepage
path: root/compile.sh
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2017-04-26 10:48:00 +0200
committerGravatar Vladimir Moskva <vladmos@google.com>2017-04-26 12:44:32 +0200
commitd0d7ef0830ccd0c43a10956abaa8331b06d80e63 (patch)
tree31cbb7a48fb832a7b5bee0b96aabc953096a723a /compile.sh
parentbcd23553f38f54fd4846aa507c827a4ee40cfab4 (diff)
Windows, bootstrapping: fix bugs to support Cygwin
We can't yet fully bootstrap Bazel on Cygwin, but can build Bazel from scratch. Building Bazel with Bazel fails because gcc isn't found where it's believed to be -- /usr/bin is a mount in Cygwin (to /bin), not a symlink or directory. In this change I: - added support for the Cygwin shell as a bootstrap platform (recognize `uname`) - updateed the bootstrap scripts to use "windows" as the PLATFORM string, not "mingw" - fixed the git lookup code - removed some hardwired msys-style path - added a cygpath call to convert $PWD to a mixed-style (otherwise the bootstrap script passes --client_cwd=/cygdrive/c/... to the server and WindowsFileSystem.java wants to make that relative to c:/cygwin64) See https://github.com/bazelbuild/bazel/issues/2885 Change-Id: Icc71261ea4f0c6d4a9c0846551a7977ca6020331 PiperOrigin-RevId: 154273014
Diffstat (limited to 'compile.sh')
-rwxr-xr-xcompile.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/compile.sh b/compile.sh
index 7d9be4cbb1..a8819be330 100755
--- a/compile.sh
+++ b/compile.sh
@@ -26,7 +26,7 @@ set -o errexit
# etc, leading to confusing errors.
export BAZEL_OLD_PATH=$PATH
case "$(uname -s | tr [:upper:] [:lower:])" in
-msys*|mingw*)
+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
@@ -114,10 +114,9 @@ if [[ $PLATFORM == "darwin" ]] && \
EXTRA_BAZEL_ARGS="${EXTRA_BAZEL_ARGS-} --define IPHONE_SDK=1"
fi
-case "${PLATFORM}" in
-msys*|mingw*)
+if [[ $PLATFORM == "windows" ]]; then
EXTRA_BAZEL_ARGS="${EXTRA_BAZEL_ARGS-} --cpu=x64_windows_msys --host_cpu=x64_windows_msys"
-esac
+fi
source scripts/bootstrap/bootstrap.sh