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
diff --git a/compile.sh b/compile.sh index 7d9be4c..a8819be 100755 --- a/compile.sh +++ b/compile.sh
@@ -26,7 +26,7 @@ # 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 @@ 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