diff --git a/src/main/cpp/blaze_startup_options.cc b/src/main/cpp/blaze_startup_options.cc index 569c561e7b0cc7..ffbe403154ed45 100644 --- a/src/main/cpp/blaze_startup_options.cc +++ b/src/main/cpp/blaze_startup_options.cc @@ -91,7 +91,10 @@ string BlazeStartupOptions::GetWorkspace(const string &cwd) { } workspace = blaze_util::Dirname(workspace); } while (!workspace.empty() && workspace != "/"); - return ""; + + fprintf(stderr, "Could not find WORKSPACE file at or above %s.\n" + "Is your current directory in a Bazel source tree?\n", cwd.c_str()); + exit(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR); } blaze_exit_code::ExitCode BlazeStartupOptions::ProcessArgExtra(