Implement bash.exe detection logic.
The logic is as follows:
1) search for msys installation
2) search got git-on-Windows installation
3) search in PATH.
This happens on every client startup unless BAZEL_SH enviornment
variable is set.
My measurements show that the time required for this detection is
negligible (<10 msec in the worst case).
Change-Id: If130e2491a9df5a23954d303f2ccdb932eeed1db
PiperOrigin-RevId: 162466913
diff --git a/src/main/cpp/blaze_util.cc b/src/main/cpp/blaze_util.cc
index be3e0eb..d8a5af6 100644
--- a/src/main/cpp/blaze_util.cc
+++ b/src/main/cpp/blaze_util.cc
@@ -208,4 +208,22 @@
return true;
}
+static bool is_debug_log_enabled = false;
+
+void SetDebugLog(bool enabled) { is_debug_log_enabled = enabled; }
+
+void debug_log(const char *format, ...) {
+ if (!is_debug_log_enabled) {
+ return;
+ }
+
+ fprintf(stderr, "CLIENT: ");
+ va_list arglist;
+ va_start(arglist, format);
+ vfprintf(stderr, format, arglist);
+ va_end(arglist);
+ fprintf(stderr, "%s", "\n");
+ fflush(stderr);
+}
+
} // namespace blaze