From e7e9c15dab6b9d821a267ba1d0a873cc41a254a6 Mon Sep 17 00:00:00 2001 From: Jonh Wendell Date: Wed, 17 Apr 2024 18:54:54 -0400 Subject: [PATCH] Fix build error with `maxmind` if http3 is disabled `maxmind` is causing the build to not honor the flag `--//bazel:http3=False`: The define `ENVOY_ENABLE_QUIC` is still being passed to the compiler. This causes code that rely on the presence (or not) of that define to behave wrongly. I am not 100% sure of what causes it, but Bazel doc says 1) to not use `bind` and 2) that `bind` and `select` do not play well together: https://bazel.build/reference/be/workspace#bind By removing the `bind` and pointing directly to the actual dependency in `maxmind` BUILD file, we fix this issue. Signed-off-by: Jonh Wendell --- bazel/repositories.bzl | 4 ---- source/extensions/geoip_providers/maxmind/BUILD | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index f54f23632d93..97197780819e 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -1471,7 +1471,3 @@ def _com_github_maxmind_libmaxminddb(): name = "com_github_maxmind_libmaxminddb", build_file_content = BUILD_ALL_CONTENT, ) - native.bind( - name = "maxmind", - actual = "@envoy//bazel/foreign_cc:maxmind_linux_darwin", - ) diff --git a/source/extensions/geoip_providers/maxmind/BUILD b/source/extensions/geoip_providers/maxmind/BUILD index c73809203bb7..d0a9fc323375 100644 --- a/source/extensions/geoip_providers/maxmind/BUILD +++ b/source/extensions/geoip_providers/maxmind/BUILD @@ -39,9 +39,9 @@ envoy_cc_library( "//conditions:default": [], }), hdrs = ["geoip_provider.h"], - external_deps = ["maxmind"], tags = ["skip_on_windows"], deps = [ + "//bazel/foreign_cc:maxmind_linux_darwin", "//envoy/geoip:geoip_provider_driver_interface", "@envoy_api//envoy/extensions/geoip_providers/maxmind/v3:pkg_cc_proto", ],