Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions base/cvd/cuttlefish/host/commands/cvd/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("//:build_variables.bzl", "COPTS")
load("//cuttlefish/bazel:rules.bzl", "cf_cc_binary", "cf_cc_library")

package(
default_visibility = ["//:android_cuttlefish"],
)

bool_flag(
name = "all_host_substitutions",
build_setting_default = False,
)

config_setting(
name = "all_host_substitutions_enabled",
flag_values = {
":all_host_substitutions": "true",
},
)

cf_cc_library(
name = "libcvd",
srcs = ["cvd.cpp"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,12 @@ cf_cc_library(
name = "start",
srcs = ["start.cpp"],
hdrs = ["start.h"],
local_defines = select({
"//cuttlefish/host/commands/cvd:all_host_substitutions_enabled": [
"CUTTLEFISH_ENABLE_ALL_HOST_SUBSTITUTIONS_BY_DEFAULT",
],
"//conditions:default": [],
}),
Comment on lines +360 to +365
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this conflict with #2491 ?

See also the discussion in b/507524719

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I had not seen those yet.

cc @ser-io @jemoreira

deps = [
"//cuttlefish/common/libs/utils:contains",
"//cuttlefish/common/libs/utils:files",
Expand Down
3 changes: 3 additions & 0 deletions base/cvd/cuttlefish/host/commands/cvd/cli/commands/start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ Result<void> CvdStartCommandHandler::Handle(const CommandRequest& request) {
const auto bin = CF_EXPECT(FindStartBin(group.HostArtifactsPath()));

std::vector<std::string> host_substitutions;
#if defined(CUTTLEFISH_ENABLE_ALL_HOST_SUBSTITUTIONS_BY_DEFAULT)
host_substitutions.push_back("all");
#endif
Flag host_substitutions_flag =
GflagsCompatFlag("host_substitutions", host_substitutions);

Expand Down
6 changes: 6 additions & 0 deletions base/cvd/cuttlefish/host/commands/cvd/fetch/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ cf_cc_library(
name = "fetch_cvd_parser",
srcs = ["fetch_cvd_parser.cc"],
hdrs = ["fetch_cvd_parser.h"],
local_defines = select({
"//cuttlefish/host/commands/cvd:all_host_substitutions_enabled": [
"CUTTLEFISH_ENABLE_ALL_HOST_SUBSTITUTIONS_BY_DEFAULT",
],
"//conditions:default": [],
}),
deps = [
"//cuttlefish/common/libs/utils:files",
"//cuttlefish/common/libs/utils:flag_parser",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ std::vector<Flag> GetFlagsVector(FetchFlags& fetch_flags,

Result<FetchFlags> FetchFlags::Parse(std::vector<std::string>& args) {
FetchFlags fetch_flags;
#if defined(CUTTLEFISH_ENABLE_ALL_HOST_SUBSTITUTIONS_BY_DEFAULT)
fetch_flags.host_substitutions.push_back("all");
#endif

std::string directory;
std::vector<Flag> flags = GetFlagsVector(fetch_flags, directory);
CF_EXPECT(ConsumeFlags(flags, args), "Could not process command line flags.");
Expand Down
Loading