Client: convert output_base to Path
(Roll-forward of commit 242acd6c07ccfe380bddf8d5a719c1cdfd6fdfb9 that was rolled back
by commit 505ca7e3036b328908dd57702278d1cf4641aba5 because it broke Google-internal
build targets. Those are now fixed.)
Benefits of a Path abstraction instead of raw
strings:
- type safety
- no need to convert paths on Windows all the time
- no need to check if paths are absolute
Closes #9245.
RELNOTES: none
PiperOrigin-RevId: 265686214
diff --git a/src/main/cpp/bazel_startup_options.cc b/src/main/cpp/bazel_startup_options.cc
index 4866fce..3d702e3 100644
--- a/src/main/cpp/bazel_startup_options.cc
+++ b/src/main/cpp/bazel_startup_options.cc
@@ -87,13 +87,13 @@
<< "Output user root \"" << output_user_root
<< "\" contains a space. This will probably break the build. "
"You should set a different --output_user_root.";
- } else if (output_base.find_first_of(' ') != std::string::npos) {
+ } else if (output_base.Contains(' ')) {
// output_base is computed from output_user_root by default.
// If output_user_root was bad, don't check output_base: while output_base
// may also be bad, we already warned about output_user_root so there's no
// point in another warning.
BAZEL_LOG(WARNING)
- << "Output base \"" << output_base
+ << "Output base \"" << output_base.AsPrintablePath()
<< "\" contains a space. This will probably break the build. "
"You should not set --output_base and let Bazel use the default, or "
"set --output_base to a path without space.";