From 4e6983c35dca8efd4a412ecb7c030e688e04f150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 15 Dec 2020 22:27:12 +0000 Subject: [PATCH] [test_common/BUILD] Start dissolving :printers_include rule. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A rule that exports a header without defining all the symbols declared by that header causes ODR violations. Basically, Bazel rules should never contain "include" rules like this. Rather, printer.h and printer.cc should be served from the same library. This change is a cautious, local first step. A second step can later remove the printer_include rule and replace its uses with printer_lib. Signed-off-by: Thomas Köppe --- test/test_common/BUILD | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/test_common/BUILD b/test/test_common/BUILD index 8e175627ab9c6..0ba5bf70ebc96 100644 --- a/test/test_common/BUILD +++ b/test/test_common/BUILD @@ -15,6 +15,7 @@ envoy_basic_cc_library( name = "printers_includes", hdrs = ["printers.h"], deps = [ + ":printers_lib", "//include/envoy/network:address_interface", ], ) @@ -86,9 +87,12 @@ envoy_cc_test_library( envoy_cc_library( name = "printers_lib", - srcs = ["printers.cc"], + srcs = [ + "printers.cc", + "printers.h", + ], deps = [ - ":printers_includes", + "//include/envoy/network:address_interface", "//source/common/buffer:buffer_lib", "//source/common/http:header_map_lib", ],