From d0d7ef0830ccd0c43a10956abaa8331b06d80e63 Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Wed, 26 Apr 2017 10:48:00 +0200 Subject: 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 --- compile.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'compile.sh') 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 -- cgit v1.2.3