Remove overlap between the blazerc and bazelrc names.
Bazel now has its own subclass of StartupOptions to specify bazel-only options. This is needed for https://github.com/bazelbuild/bazel/issues/4502.
RELNOTES(INC): No longer accepts --blazerc or --[no]master_blazerc, accepts bazelrc name only.
PiperOrigin-RevId: 193718297
diff --git a/src/main/cpp/BUILD b/src/main/cpp/BUILD
index 1ec8912..73bbf5d 100644
--- a/src/main/cpp/BUILD
+++ b/src/main/cpp/BUILD
@@ -100,6 +100,7 @@
}),
visibility = ["//src:__pkg__"],
deps = [
+ ":bazel_startup_options",
":blaze_util",
":option_processor",
":startup_options",
@@ -154,6 +155,22 @@
)
cc_library(
+ name = "bazel_startup_options",
+ srcs = ["bazel_startup_options.cc"],
+ hdrs = ["bazel_startup_options.h"],
+ visibility = [
+ "//src:__pkg__",
+ "//src/test/cpp:__pkg__",
+ ],
+ deps = [
+ ":blaze_util",
+ ":startup_options",
+ ":workspace_layout",
+ "//src/main/cpp/util:blaze_exit_code",
+ ],
+)
+
+cc_library(
name = "workspace_layout",
srcs = ["workspace_layout.cc"],
hdrs = ["workspace_layout.h"],
diff --git a/src/main/cpp/bazel_startup_options.cc b/src/main/cpp/bazel_startup_options.cc
new file mode 100644
index 0000000..f3138f7
--- /dev/null
+++ b/src/main/cpp/bazel_startup_options.cc
@@ -0,0 +1,57 @@
+// Copyright 2018 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "src/main/cpp/bazel_startup_options.h"
+
+#include <cassert>
+
+#include "src/main/cpp/blaze_util.h"
+#include "src/main/cpp/workspace_layout.h"
+
+namespace blaze {
+
+BazelStartupOptions::BazelStartupOptions(
+ const WorkspaceLayout *workspace_layout)
+ : StartupOptions("Bazel", workspace_layout) {
+ RegisterNullaryStartupFlag("master_bazelrc");
+ RegisterUnaryStartupFlag("bazelrc");
+}
+
+blaze_exit_code::ExitCode BazelStartupOptions::ProcessArgExtra(
+ const char *arg, const char *next_arg, const std::string &rcfile,
+ const char **value, bool *is_processed, std::string *error) {
+ assert(value);
+ assert(is_processed);
+
+ if ((*value = GetUnaryOption(arg, next_arg, "--bazelrc")) != nullptr) {
+ if (!rcfile.empty()) {
+ *error = "Can't specify --bazelrc in the .bazelrc file.";
+ return blaze_exit_code::BAD_ARGV;
+ }
+ } else if (GetNullaryOption(arg, "--nomaster_bazelrc") ||
+ GetNullaryOption(arg, "--master_bazelrc")) {
+ if (!rcfile.empty()) {
+ *error = "Can't specify --[no]master_bazelrc in .bazelrc file.";
+ return blaze_exit_code::BAD_ARGV;
+ }
+ option_sources["blazerc"] = rcfile;
+ } else {
+ *is_processed = false;
+ return blaze_exit_code::SUCCESS;
+ }
+
+ *is_processed = true;
+ return blaze_exit_code::SUCCESS;
+}
+
+} // namespace blaze
diff --git a/src/main/cpp/bazel_startup_options.h b/src/main/cpp/bazel_startup_options.h
new file mode 100644
index 0000000..53ce6cb
--- /dev/null
+++ b/src/main/cpp/bazel_startup_options.h
@@ -0,0 +1,36 @@
+// Copyright 2018 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef BAZEL_SRC_MAIN_CPP_BAZEL_STARTUP_OPTIONS_H_
+#define BAZEL_SRC_MAIN_CPP_BAZEL_STARTUP_OPTIONS_H_
+
+#include <string>
+
+#include "src/main/cpp/startup_options.h"
+#include "src/main/cpp/util/exit_code.h"
+
+namespace blaze {
+
+// BazelStartupOptions contains the startup options that are Bazel-specific.
+class BazelStartupOptions : public StartupOptions {
+ public:
+ explicit BazelStartupOptions(const WorkspaceLayout *workspace_layout);
+
+ blaze_exit_code::ExitCode ProcessArgExtra(
+ const char *arg, const char *next_arg, const std::string &rcfile,
+ const char **value, bool *is_processed, std::string *error) override;
+};
+
+} // namespace blaze
+
+#endif // BAZEL_SRC_MAIN_CPP_BAZEL_STARTUP_OPTIONS_H_
diff --git a/src/main/cpp/main.cc b/src/main/cpp/main.cc
index c88ea9f..25a1dbf 100644
--- a/src/main/cpp/main.cc
+++ b/src/main/cpp/main.cc
@@ -14,6 +14,7 @@
#include <memory>
+#include "src/main/cpp/bazel_startup_options.h"
#include "src/main/cpp/blaze.h"
#include "src/main/cpp/option_processor.h"
#include "src/main/cpp/startup_options.h"
@@ -23,7 +24,7 @@
std::unique_ptr<blaze::WorkspaceLayout> workspace_layout(
new blaze::WorkspaceLayout());
std::unique_ptr<blaze::StartupOptions> startup_options(
- new blaze::StartupOptions(workspace_layout.get()));
+ new blaze::BazelStartupOptions(workspace_layout.get()));
return blaze::Main(argc, argv, workspace_layout.get(),
new blaze::OptionProcessor(workspace_layout.get(),
std::move(startup_options)));
diff --git a/src/main/cpp/option_processor.cc b/src/main/cpp/option_processor.cc
index 864d968..6823757 100644
--- a/src/main/cpp/option_processor.cc
+++ b/src/main/cpp/option_processor.cc
@@ -227,8 +227,7 @@
// Find the master bazelrcs if requested. This list may contain duplicates.
vector<string> candidate_bazelrc_paths;
- if (SearchNullaryOption(cmd_line->startup_args, "master_blazerc", true) &&
- SearchNullaryOption(cmd_line->startup_args, "master_bazelrc", true)) {
+ if (SearchNullaryOption(cmd_line->startup_args, "master_bazelrc", true)) {
const string workspace_rc =
workspace_layout->GetWorkspaceRcPath(workspace, cmd_line->startup_args);
const string binary_rc =
@@ -240,13 +239,10 @@
candidate_bazelrc_paths = {workspace_rc, binary_rc, system_rc};
}
- const char* blazerc = SearchUnaryOption(cmd_line->startup_args, "--blazerc");
- if (blazerc == nullptr) {
- blazerc = SearchUnaryOption(cmd_line->startup_args, "--bazelrc");
- }
string user_bazelrc_path;
blaze_exit_code::ExitCode find_bazelrc_exit_code =
- FindUserBlazerc(blazerc, workspace, &user_bazelrc_path, error);
+ FindUserBlazerc(SearchUnaryOption(cmd_line->startup_args, "--bazelrc"),
+ workspace, &user_bazelrc_path, error);
if (find_bazelrc_exit_code != blaze_exit_code::SUCCESS) {
return find_bazelrc_exit_code;
}
diff --git a/src/main/cpp/startup_options.cc b/src/main/cpp/startup_options.cc
index ef083db..1f9bc8b 100644
--- a/src/main/cpp/startup_options.cc
+++ b/src/main/cpp/startup_options.cc
@@ -58,9 +58,6 @@
GetNullaryOption(arg.c_str(), ("--no" + name_).c_str());
}
-StartupOptions::StartupOptions(const WorkspaceLayout* workspace_layout)
- : StartupOptions("Bazel", workspace_layout) {}
-
void StartupOptions::RegisterNullaryStartupFlag(const std::string &flag_name) {
valid_startup_flags.insert(std::unique_ptr<NullaryStartupFlag>(
new NullaryStartupFlag(flag_name)));
@@ -131,13 +128,9 @@
RegisterNullaryStartupFlag("experimental_oom_more_eagerly");
RegisterNullaryStartupFlag("fatal_event_bus_exceptions");
RegisterNullaryStartupFlag("host_jvm_debug");
- RegisterNullaryStartupFlag("master_bazelrc");
- RegisterNullaryStartupFlag("master_blazerc");
RegisterNullaryStartupFlag("watchfs");
RegisterNullaryStartupFlag("write_command_log");
RegisterNullaryStartupFlag("expand_configs_in_place");
- RegisterUnaryStartupFlag("bazelrc");
- RegisterUnaryStartupFlag("blazerc");
RegisterUnaryStartupFlag("command_port");
RegisterUnaryStartupFlag("connect_timeout_secs");
RegisterUnaryStartupFlag("experimental_oom_more_eagerly_threshold");
@@ -232,30 +225,6 @@
NULL) {
host_jvm_args.push_back(value);
option_sources["host_jvm_args"] = rcfile; // NB: This is incorrect
- } else if ((value = GetUnaryOption(arg, next_arg, "--bazelrc")) != NULL) {
- if (!rcfile.empty()) {
- *error = "Can't specify --bazelrc in the .bazelrc file.";
- return blaze_exit_code::BAD_ARGV;
- }
- } else if ((value = GetUnaryOption(arg, next_arg, "--blazerc")) != NULL) {
- if (!rcfile.empty()) {
- *error = "Can't specify --blazerc in the .blazerc file.";
- return blaze_exit_code::BAD_ARGV;
- }
- } else if (GetNullaryOption(arg, "--nomaster_blazerc") ||
- GetNullaryOption(arg, "--master_blazerc")) {
- if (!rcfile.empty()) {
- *error = "Can't specify --[no]master_blazerc in .blazerc file.";
- return blaze_exit_code::BAD_ARGV;
- }
- option_sources["blazerc"] = rcfile;
- } else if (GetNullaryOption(arg, "--nomaster_bazelrc") ||
- GetNullaryOption(arg, "--master_bazelrc")) {
- if (!rcfile.empty()) {
- *error = "Can't specify --[no]master_bazelrc in .bazelrc file.";
- return blaze_exit_code::BAD_ARGV;
- }
- option_sources["blazerc"] = rcfile;
} else if (GetNullaryOption(arg, "--batch")) {
batch = true;
option_sources["batch"] = rcfile;
@@ -423,13 +392,6 @@
return blaze_exit_code::SUCCESS;
}
-blaze_exit_code::ExitCode StartupOptions::ProcessArgExtra(
- const char *arg, const char *next_arg, const string &rcfile,
- const char **value, bool *is_processed, string *error) {
- *is_processed = false;
- return blaze_exit_code::SUCCESS;
-}
-
string StartupOptions::GetDefaultHostJavabase() const {
return blaze::GetDefaultHostJavabase();
}
diff --git a/src/main/cpp/startup_options.h b/src/main/cpp/startup_options.h
index 1830cc5..91a4ab7 100644
--- a/src/main/cpp/startup_options.h
+++ b/src/main/cpp/startup_options.h
@@ -74,8 +74,9 @@
: source(source_arg), value(value_arg) {}
};
-// This class holds the parsed startup options for Blaze.
-// These options and their defaults must be kept in sync with those in
+// This class defines the startup options accepted by all versions Bazel, and
+// holds the parsed values. These options and their defaults must be kept in
+// sync with those in
// src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java.
// The latter are (usually) purely decorative (they affect the help message,
// which displays the defaults). The actual defaults are defined
@@ -86,7 +87,6 @@
// names also don't conform to the style guide.
class StartupOptions {
public:
- explicit StartupOptions(const WorkspaceLayout* workspace_layout);
virtual ~StartupOptions();
// Parses a single argument, either from the command line or from the .blazerc
@@ -131,7 +131,7 @@
// StartupOptions, the "ExtraOptions" concept makes no sense; remove it.
virtual blaze_exit_code::ExitCode ProcessArgExtra(
const char *arg, const char *next_arg, const std::string &rcfile,
- const char **value, bool *is_processed, std::string *error);
+ const char **value, bool *is_processed, std::string *error) = 0;
// Return the default path to the JDK used to run Blaze itself
// (must be an absolute directory).
@@ -291,8 +291,8 @@
// Constructor for subclasses only so that site-specific extensions of this
// class can override the product name. The product_name must be the
// capitalized version of the name, as in "Bazel".
- explicit StartupOptions(const std::string &product_name,
- const WorkspaceLayout* workspace_layout);
+ StartupOptions(const std::string &product_name,
+ const WorkspaceLayout *workspace_layout);
void RegisterUnaryStartupFlag(const std::string& flag_name);
diff --git a/src/test/cpp/BUILD b/src/test/cpp/BUILD
index 09bb3b1..ec7b708 100644
--- a/src/test/cpp/BUILD
+++ b/src/test/cpp/BUILD
@@ -32,6 +32,7 @@
srcs = ["option_processor_test.cc"],
tags = ["requires_internet"],
deps = [
+ "//src/main/cpp:bazel_startup_options",
"//src/main/cpp:blaze_util",
"//src/main/cpp:option_processor",
"//src/main/cpp:rc_file",
@@ -80,6 +81,19 @@
)
cc_test(
+ name = "bazel_startup_options_test",
+ size = "small",
+ srcs = ["bazel_startup_options_test.cc"],
+ deps = [
+ ":test_util",
+ "//src/main/cpp:bazel_startup_options",
+ "//src/main/cpp:blaze_util",
+ "//src/main/cpp:workspace_layout",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
name = "workspace_layout_test",
size = "small",
srcs = ["workspace_layout_test.cc"],
diff --git a/src/test/cpp/bazel_startup_options_test.cc b/src/test/cpp/bazel_startup_options_test.cc
new file mode 100644
index 0000000..2ac4c7f
--- /dev/null
+++ b/src/test/cpp/bazel_startup_options_test.cc
@@ -0,0 +1,114 @@
+// Copyright 2018 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "src/main/cpp/bazel_startup_options.h"
+
+#include <stdlib.h>
+
+#include "src/main/cpp/blaze_util_platform.h"
+#include "src/main/cpp/workspace_layout.h"
+#include "src/test/cpp/test_util.h"
+#include "googletest/include/gtest/gtest.h"
+
+namespace blaze {
+
+class BazelStartupOptionsTest : public ::testing::Test {
+ protected:
+ BazelStartupOptionsTest() : workspace_layout_(new WorkspaceLayout()) {}
+ ~BazelStartupOptionsTest() = default;
+
+ void SetUp() override {
+ // This knowingly ignores the possibility of these environment variables
+ // being unset because we expect our test runner to set them in all cases.
+ // Otherwise, we'll crash here, but this keeps our code simpler.
+ old_test_tmpdir_ = GetEnv("TEST_TMPDIR");
+
+ ReinitStartupOptions();
+ }
+
+ void TearDown() override { SetEnv("TEST_TMPDIR", old_test_tmpdir_); }
+
+ // Recreates startup_options_ after changes to the environment.
+ void ReinitStartupOptions() {
+ startup_options_.reset(new BazelStartupOptions(workspace_layout_.get()));
+ }
+
+ private:
+ std::unique_ptr<WorkspaceLayout> workspace_layout_;
+
+ protected:
+ std::unique_ptr<BazelStartupOptions> startup_options_;
+
+ private:
+ std::string old_test_tmpdir_;
+};
+
+TEST_F(BazelStartupOptionsTest, ProductName) {
+ ASSERT_EQ("Bazel", startup_options_->product_name);
+}
+
+TEST_F(BazelStartupOptionsTest, JavaLoggingOptions) {
+ ASSERT_EQ("com.google.devtools.build.lib.util.SingleLineFormatter",
+ startup_options_->java_logging_formatter);
+}
+
+TEST_F(BazelStartupOptionsTest, EmptyFlagsAreInvalid) {
+ EXPECT_FALSE(startup_options_->IsNullary(""));
+ EXPECT_FALSE(startup_options_->IsNullary("--"));
+ EXPECT_FALSE(startup_options_->IsUnary(""));
+ EXPECT_FALSE(startup_options_->IsUnary("--"));
+}
+
+// TODO(#4502 related cleanup) This test serves as a catalog of the valid
+// options - make this test check that the list is complete, that no options are
+// missing.
+TEST_F(BazelStartupOptionsTest, ValidStartupFlags) {
+ // IMPORTANT: Before modifying this test, please contact a Bazel core team
+ // member that knows the Google-internal procedure for adding/deprecating
+ // startup flags.
+ const StartupOptions* options = startup_options_.get();
+ ExpectIsNullaryOption(options, "batch");
+ ExpectIsNullaryOption(options, "batch_cpu_scheduling");
+ ExpectIsNullaryOption(options, "block_for_lock");
+ ExpectIsNullaryOption(options, "client_debug");
+ ExpectIsNullaryOption(options, "deep_execroot");
+ ExpectIsNullaryOption(options, "experimental_oom_more_eagerly");
+ ExpectIsNullaryOption(options, "fatal_event_bus_exceptions");
+ ExpectIsNullaryOption(options, "host_jvm_debug");
+ ExpectIsNullaryOption(options, "master_bazelrc");
+ ExpectIsNullaryOption(options, "watchfs");
+ ExpectIsNullaryOption(options, "write_command_log");
+ ExpectIsUnaryOption(options, "bazelrc");
+ ExpectIsUnaryOption(options, "command_port");
+ ExpectIsUnaryOption(options, "connect_timeout_secs");
+ ExpectIsUnaryOption(options, "experimental_oom_more_eagerly_threshold");
+ ExpectIsUnaryOption(options, "host_javabase");
+ ExpectIsUnaryOption(options, "host_jvm_args");
+ ExpectIsUnaryOption(options, "host_jvm_profile");
+ ExpectIsUnaryOption(options, "invocation_policy");
+ ExpectIsUnaryOption(options, "io_nice_level");
+ ExpectIsUnaryOption(options, "install_base");
+ ExpectIsUnaryOption(options, "max_idle_secs");
+ ExpectIsUnaryOption(options, "output_base");
+ ExpectIsUnaryOption(options, "output_user_root");
+}
+
+TEST_F(BazelStartupOptionsTest, BlazercFlagsAreNotAccepted) {
+ EXPECT_FALSE(startup_options_->IsNullary("--master_blazerc"));
+ EXPECT_FALSE(startup_options_->IsUnary("--master_blazerc"));
+ EXPECT_FALSE(startup_options_->IsNullary("--blazerc"));
+ EXPECT_FALSE(startup_options_->IsUnary("--blazerc"));
+}
+
+} // namespace blaze
diff --git a/src/test/cpp/option_processor_test.cc b/src/test/cpp/option_processor_test.cc
index 19c5d34..df48cce 100644
--- a/src/test/cpp/option_processor_test.cc
+++ b/src/test/cpp/option_processor_test.cc
@@ -14,6 +14,7 @@
#include "src/main/cpp/option_processor.h"
+#include "src/main/cpp/bazel_startup_options.h"
#include "src/main/cpp/blaze_util.h"
#include "src/main/cpp/blaze_util_platform.h"
#include "src/main/cpp/option_processor-internal.h"
@@ -41,7 +42,7 @@
option_processor_.reset(new OptionProcessor(
workspace_layout_.get(),
std::unique_ptr<StartupOptions>(
- new StartupOptions(workspace_layout_.get()))));
+ new BazelStartupOptions(workspace_layout_.get()))));
}
void TearDown() override {
diff --git a/src/test/cpp/startup_options_test.cc b/src/test/cpp/startup_options_test.cc
index a42180b..ecc7ac1 100644
--- a/src/test/cpp/startup_options_test.cc
+++ b/src/test/cpp/startup_options_test.cc
@@ -23,6 +23,19 @@
namespace blaze {
+// Minimal StartupOptions class for testing.
+class FakeStartupOptions : public StartupOptions {
+ public:
+ FakeStartupOptions(const WorkspaceLayout *workspace_layout)
+ : StartupOptions("Bazel", workspace_layout) {}
+ blaze_exit_code::ExitCode ProcessArgExtra(
+ const char *arg, const char *next_arg, const std::string &rcfile,
+ const char **value, bool *is_processed, std::string *error) override {
+ *is_processed = false;
+ return blaze_exit_code::SUCCESS;
+ }
+};
+
class StartupOptionsTest : public ::testing::Test {
protected:
StartupOptionsTest() : workspace_layout_(new WorkspaceLayout()) {}
@@ -45,7 +58,7 @@
// Recreates startup_options_ after changes to the environment.
void ReinitStartupOptions() {
- startup_options_.reset(new StartupOptions(workspace_layout_.get()));
+ startup_options_.reset(new FakeStartupOptions(workspace_layout_.get()));
}
private:
@@ -95,39 +108,6 @@
EXPECT_FALSE(startup_options_->IsUnary("--"));
}
-TEST_F(StartupOptionsTest, ValidStartupFlagsTest) {
- // IMPORTANT: Before modifying this test, please contact a Bazel core team
- // member that knows the Google-internal procedure for adding/deprecating
- // startup flags.
- const StartupOptions* options = startup_options_.get();
- ExpectIsNullaryOption(options, "batch");
- ExpectIsNullaryOption(options, "batch_cpu_scheduling");
- ExpectIsNullaryOption(options, "block_for_lock");
- ExpectIsNullaryOption(options, "client_debug");
- ExpectIsNullaryOption(options, "deep_execroot");
- ExpectIsNullaryOption(options, "experimental_oom_more_eagerly");
- ExpectIsNullaryOption(options, "fatal_event_bus_exceptions");
- ExpectIsNullaryOption(options, "host_jvm_debug");
- ExpectIsNullaryOption(options, "master_bazelrc");
- ExpectIsNullaryOption(options, "master_blazerc");
- ExpectIsNullaryOption(options, "watchfs");
- ExpectIsNullaryOption(options, "write_command_log");
- ExpectIsUnaryOption(options, "bazelrc");
- ExpectIsUnaryOption(options, "blazerc");
- ExpectIsUnaryOption(options, "command_port");
- ExpectIsUnaryOption(options, "connect_timeout_secs");
- ExpectIsUnaryOption(options, "experimental_oom_more_eagerly_threshold");
- ExpectIsUnaryOption(options, "host_javabase");
- ExpectIsUnaryOption(options, "host_jvm_args");
- ExpectIsUnaryOption(options, "host_jvm_profile");
- ExpectIsUnaryOption(options, "invocation_policy");
- ExpectIsUnaryOption(options, "io_nice_level");
- ExpectIsUnaryOption(options, "install_base");
- ExpectIsUnaryOption(options, "max_idle_secs");
- ExpectIsUnaryOption(options, "output_base");
- ExpectIsUnaryOption(options, "output_user_root");
-}
-
TEST_F(StartupOptionsTest, ProcessSpaceSeparatedArgsTest) {
std::string error;
const std::vector<RcStartupFlag> flags{
diff --git a/src/test/shell/integration/execution_phase_tests.sh b/src/test/shell/integration/execution_phase_tests.sh
index 21d6dc8..3905877 100755
--- a/src/test/shell/integration/execution_phase_tests.sh
+++ b/src/test/shell/integration/execution_phase_tests.sh
@@ -211,18 +211,14 @@
function test_jobs_default_auto() {
# The default flag value is only read if --jobs is not set explicitly.
# Do not use a bazelrc here, this would break the test.
- # TODO(b/65166983) this should be --bazelrc=/dev/null, since this is a bazel
- # test and we want to encourage bazel-specific naming, but that would
- # currently break the test because --bazelrc and --blazerc are treated
- # separately.
mkdir -p package || fail "mkdir failed"
echo "cc_library(name = 'foo', srcs = ['foo.cc'])" >package/BUILD
echo "int foo(void) { return 0; }" >package/foo.cc
- local output_base="$(bazel --nomaster_bazelrc --blazerc=/dev/null info \
+ local output_base="$(bazel --nomaster_bazelrc --bazelrc=/dev/null info \
output_base 2>/dev/null)" || fail "bazel info should work"
local java_log="${output_base}/java.log"
- bazel --nomaster_bazelrc --blazerc=/dev/null build package:foo \
+ bazel --nomaster_bazelrc --bazelrc=/dev/null build package:foo \
>>"${TEST_log}" 2>&1 || fail "Should build"
assert_last_log "BuildRequest" 'Flag "jobs" was set to "auto"' "${java_log}" \