From a2c6bc71c28f567e3115b1ea740b37630aa16ffb Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Mon, 16 Mar 2015 18:32:50 +0000 Subject: [PATCH] Improve error message if WORKSPACE file is not found -- MOS_MIGRATED_REVID=88746523 --- src/main/cpp/blaze_startup_options.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(