Skip to content

Commit

Permalink
Fixed bazel configuration ambiguity for non HTTP3 builds (envoyproxy#…
Browse files Browse the repository at this point in the history
…34483)

To avoid ambiguity when building with //bazel:http3=False (on PPC
and Windows) this commit adds 2 new config_setting_groups and
updates the relevant select() statements.

Signed-off-by: Ted Poole <tpoole@redhat.com>
  • Loading branch information
tedjpoole authored Jun 6, 2024
1 parent b6b585b commit 964ea7d
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 6 deletions.
58 changes: 58 additions & 0 deletions bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,64 @@ selects.config_setting_group(
],
)

selects.config_setting_group(
name = "disable_http3_on_linux_ppc",
match_all = [
":disable_http3",
":linux_ppc",
],
)

selects.config_setting_group(
name = "disable_http3_on_windows_x86_64",
match_all = [
":disable_http3",
":windows_x86_64",
],
)

bool_flag(
name = "enabled",
build_setting_default = True,
visibility = ["//visibility:private"],
)

bool_flag(
name = "disabled",
build_setting_default = False,
visibility = ["//visibility:private"],
)

# Alias equal to "not(":disable_http3")" (if "not()" existed).
alias(
name = "enable_http3_setting",
actual = select({
":disable_http3": ":disabled",
"//conditions:default": ":enabled",
}),
)

config_setting(
name = "enable_http3",
flag_values = {":enable_http3_setting": "True"},
)

selects.config_setting_group(
name = "enable_http3_on_linux_ppc",
match_all = [
":enable_http3",
":linux_ppc",
],
)

selects.config_setting_group(
name = "enable_http3_on_windows_x86_64",
match_all = [
":enable_http3",
":windows_x86_64",
],
)

config_setting(
name = "disable_admin_html",
values = {"define": "admin_html=disabled"},
Expand Down
7 changes: 4 additions & 3 deletions source/exe/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ envoy_cc_library(
"//source/server:options_base",
"//source/server:server_base_lib",
] + select({
"//bazel:windows_x86_64": envoy_all_extensions(WINDOWS_SKIP_TARGETS),
"//bazel:linux_ppc": envoy_all_extensions(PPC_SKIP_TARGETS),
"//bazel:disable_http3": envoy_all_extensions(NO_HTTP3_SKIP_TARGETS),
"//bazel:enable_http3_on_windows_x86_64": envoy_all_extensions(WINDOWS_SKIP_TARGETS),
"//bazel:enable_http3_on_linux_ppc": envoy_all_extensions(PPC_SKIP_TARGETS),
"//bazel:disable_http3_on_windows_x86_64": envoy_all_extensions(NO_HTTP3_SKIP_TARGETS + WINDOWS_SKIP_TARGETS),
"//bazel:disable_http3_on_linux_ppc": envoy_all_extensions(NO_HTTP3_SKIP_TARGETS + PPC_SKIP_TARGETS),
"//conditions:default": envoy_all_extensions(),
}),
)
Expand Down
7 changes: 4 additions & 3 deletions test/config_test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ envoy_cc_test_library(
"//test/test_common:simulated_time_system_lib",
"//test/test_common:threadsafe_singleton_injector_lib",
] + select({
"//bazel:windows_x86_64": envoy_all_extensions(WINDOWS_SKIP_TARGETS),
"//bazel:linux_ppc": envoy_all_extensions(PPC_SKIP_TARGETS),
"//bazel:disable_http3": envoy_all_extensions(NO_HTTP3_SKIP_TARGETS),
"//bazel:enable_http3_on_windows_x86_64": envoy_all_extensions(WINDOWS_SKIP_TARGETS),
"//bazel:enable_http3_on_linux_ppc": envoy_all_extensions(PPC_SKIP_TARGETS),
"//bazel:disable_http3_on_windows_x86_64": envoy_all_extensions(NO_HTTP3_SKIP_TARGETS + WINDOWS_SKIP_TARGETS),
"//bazel:disable_http3_on_linux_ppc": envoy_all_extensions(NO_HTTP3_SKIP_TARGETS + PPC_SKIP_TARGETS),
"//conditions:default": envoy_all_extensions(),
}),
)

0 comments on commit 964ea7d

Please sign in to comment.