diff --git a/BUILD b/BUILD index 05ee49d8ba..deb409c921 100644 --- a/BUILD +++ b/BUILD @@ -6,7 +6,7 @@ load("@bazel_skylib//rules:run_binary.bzl", "run_binary") load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files", pkg_strip_prefix = "strip_prefix") load("@rules_pkg//pkg:zip.bzl", "pkg_zip") load("dll_deps.bzl", "force_compilation_mode") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") bool_flag( name = "with_dll", @@ -128,7 +128,7 @@ otel_cc_library( ) # Conveniently place all Open Telemetry C++ dependencies required to build otel_sdk -[cc_shared_library( +[otel_cc_shared_library( name = otel_sdk_binary, # Force generation of .pdb file for for opt builds features = [ @@ -143,10 +143,10 @@ otel_cc_library( "//conditions:default": ["@platforms//:incompatible"], }), # TODO: Add more missing headers to api_sdk_includes above and we'll no longer need /WHOLEARCHIVE - user_link_flags = select({ - "@@platforms//os:windows": ["/WHOLEARCHIVE"], - "//conditions:default": ["--whole-archive"], - }), + # user_link_flags = select({ + # "@@platforms//os:windows": ["/WHOLEARCHIVE"], + # "//conditions:default": ["--whole-archive"], + # }), visibility = ["//visibility:private"], deps = [ otel_sdk_binary + "_restrict_compilation_mode", @@ -194,7 +194,7 @@ alias( ]] # Import the otel_sdk.dll, and the two exposed otel_sdk.lib and otel_sdk.pdb files as one target -[cc_import( +[otel_cc_import( name = otel_sdk_binary + "_import", data = [otel_sdk_binary + "_pdb_file"], interface_library = otel_sdk_binary + "_lib_file", @@ -245,7 +245,7 @@ alias( visibility = ["//visibility:public"], ) -cc_test( +otel_cc_test( name = "dll_test", srcs = ["dll_test.cc"], deps = ["dll"], @@ -400,7 +400,7 @@ write_source_file( tags = ["manual"], ) -[cc_binary( +[otel_cc_binary( name = "dll_deps_update_binary_" + os, srcs = ["dll_deps_update.cc"], data = ["otel_sdk_all_deps_" + os], diff --git a/api/BUILD b/api/BUILD index a21adb5bf7..084e77d53e 100644 --- a/api/BUILD +++ b/api/BUILD @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) diff --git a/api/test/baggage/BUILD b/api/test/baggage/BUILD index c71e4cd69c..b9096f50c8 100644 --- a/api/test/baggage/BUILD +++ b/api/test/baggage/BUILD @@ -3,10 +3,11 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "baggage_test", srcs = [ "baggage_test.cc", diff --git a/api/test/baggage/propagation/BUILD b/api/test/baggage/propagation/BUILD index b9b026d7b9..f20e9c7901 100644 --- a/api/test/baggage/propagation/BUILD +++ b/api/test/baggage/propagation/BUILD @@ -3,10 +3,11 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "baggage_propagator_test", srcs = [ "baggage_propagator_test.cc", diff --git a/api/test/common/BUILD b/api/test/common/BUILD index b60c3cfdd5..d1d6936ef0 100644 --- a/api/test/common/BUILD +++ b/api/test/common/BUILD @@ -3,6 +3,7 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() @@ -17,7 +18,7 @@ otel_cc_benchmark( deps = dll_deps(["//api"]), ) -cc_test( +otel_cc_test( name = "kv_properties_test", srcs = [ "kv_properties_test.cc", @@ -32,7 +33,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "string_util_test", srcs = [ "string_util_test.cc", diff --git a/api/test/context/BUILD b/api/test/context/BUILD index 97364f9ca4..4e1ff61096 100644 --- a/api/test/context/BUILD +++ b/api/test/context/BUILD @@ -3,10 +3,11 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "context_test", srcs = [ "context_test.cc", @@ -21,7 +22,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "runtime_context_test", srcs = [ "runtime_context_test.cc", diff --git a/api/test/context/propagation/BUILD b/api/test/context/propagation/BUILD index d70c654ebc..fb04fe1157 100644 --- a/api/test/context/propagation/BUILD +++ b/api/test/context/propagation/BUILD @@ -3,10 +3,11 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "composite_propagator_test", srcs = [ "composite_propagator_test.cc", diff --git a/api/test/core/BUILD b/api/test/core/BUILD index 1895f226a3..55683d9b24 100644 --- a/api/test/core/BUILD +++ b/api/test/core/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "timestamp_test", srcs = [ "timestamp_test.cc", @@ -20,7 +21,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "version_test", srcs = [ "version_test.cc", diff --git a/api/test/logs/BUILD b/api/test/logs/BUILD index 8af7365b0a..3e2a15f013 100644 --- a/api/test/logs/BUILD +++ b/api/test/logs/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "provider_test", srcs = [ "provider_test.cc", @@ -21,7 +22,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "logger_test", srcs = [ "logger_test.cc", diff --git a/api/test/metrics/BUILD b/api/test/metrics/BUILD index 2b6339e532..95fbcdca2f 100644 --- a/api/test/metrics/BUILD +++ b/api/test/metrics/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "noop_sync_instrument_test", srcs = [ "noop_sync_instrument_test.cc", @@ -20,7 +21,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "meter_provider_test", srcs = [ "meter_provider_test.cc", diff --git a/api/test/nostd/BUILD b/api/test/nostd/BUILD index e9ff130947..82a196990d 100644 --- a/api/test/nostd/BUILD +++ b/api/test/nostd/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "function_ref_test", srcs = [ "function_ref_test.cc", @@ -20,7 +21,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "string_view_test", srcs = [ "string_view_test.cc", @@ -35,7 +36,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "variant_test", srcs = [ "variant_test.cc", @@ -50,7 +51,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "unique_ptr_test", srcs = [ "unique_ptr_test.cc", @@ -65,7 +66,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "utility_test", srcs = [ "utility_test.cc", @@ -80,7 +81,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "span_test", srcs = [ "span_test.cc", @@ -95,7 +96,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "shared_ptr_test", srcs = [ "shared_ptr_test.cc", diff --git a/api/test/plugin/BUILD b/api/test/plugin/BUILD index 5e793f941c..c83215e4af 100644 --- a/api/test/plugin/BUILD +++ b/api/test/plugin/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "dynamic_load_test", srcs = [ "dynamic_load_test.cc", diff --git a/api/test/singleton/BUILD b/api/test/singleton/BUILD index f758a1da40..b0372e6e6e 100644 --- a/api/test/singleton/BUILD +++ b/api/test/singleton/BUILD @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "avoid_dll_lock", "dll_deps") -# load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() @@ -22,7 +22,7 @@ HIDDEN_NOWIN_COPTS = [ "-fvisibility=hidden", ] -cc_library( +otel_cc_library( name = "component_a", srcs = [ "component_a.cc", @@ -36,7 +36,7 @@ cc_library( ]), ) -cc_library( +otel_cc_library( name = "component_b", srcs = [ "component_b.cc", @@ -50,7 +50,7 @@ cc_library( ]), ) -cc_library( +otel_cc_library( name = "component_c", srcs = [ "component_c.cc", @@ -68,7 +68,7 @@ cc_library( ]), ) -cc_library( +otel_cc_library( name = "component_d", srcs = [ "component_d.cc", @@ -86,7 +86,7 @@ cc_library( ]), ) -cc_library( +otel_cc_library( name = "component_e", srcs = [ "component_e.cc", @@ -104,7 +104,7 @@ cc_library( ]), ) -cc_library( +otel_cc_library( name = "component_f", srcs = [ "component_f.cc", @@ -122,8 +122,8 @@ cc_library( ]), ) -# no cc_shared_library in bazel 4.2 -cc_binary( +# no otel_cc_shared_library in bazel 4.2 +otel_cc_binary( name = "component_g", srcs = [ "component_g.cc", @@ -138,8 +138,8 @@ cc_binary( ]), ) -# no cc_shared_library in bazel 4.2 -cc_binary( +# no otel_cc_shared_library in bazel 4.2 +otel_cc_binary( name = "component_h", srcs = [ "component_h.cc", @@ -167,7 +167,7 @@ cc_binary( # bazel test //api/test/singleton:singleton_test # -cc_test( +otel_cc_test( name = "singleton_test", srcs = [ "singleton_test.cc", diff --git a/api/test/trace/BUILD b/api/test/trace/BUILD index 573db355c5..294b041b50 100644 --- a/api/test/trace/BUILD +++ b/api/test/trace/BUILD @@ -3,10 +3,11 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "default_span_test", srcs = [ "default_span_test.cc", @@ -22,7 +23,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "noop_test", srcs = [ "noop_test.cc", @@ -38,7 +39,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "key_value_iterable_view_test", srcs = [ "key_value_iterable_view_test.cc", @@ -82,7 +83,7 @@ otel_cc_benchmark( ]), ) -cc_test( +otel_cc_test( name = "provider_test", srcs = [ "provider_test.cc", @@ -98,7 +99,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "span_id_test", srcs = [ "span_id_test.cc", @@ -114,7 +115,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "trace_flags_test", srcs = [ "trace_flags_test.cc", @@ -130,7 +131,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "trace_id_test", srcs = [ "trace_id_test.cc", @@ -146,7 +147,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "span_context_test", srcs = [ "span_context_test.cc", @@ -162,7 +163,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "trace_state_test", srcs = [ "trace_state_test.cc", @@ -178,7 +179,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "scope_test", srcs = [ "scope_test.cc", @@ -194,7 +195,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "tracer_test", srcs = [ "tracer_test.cc", diff --git a/api/test/trace/propagation/BUILD b/api/test/trace/propagation/BUILD index 089d96385e..b214e65916 100644 --- a/api/test/trace/propagation/BUILD +++ b/api/test/trace/propagation/BUILD @@ -3,10 +3,11 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "http_text_format_test", srcs = [ "http_text_format_test.cc", @@ -23,7 +24,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "b3_propagation_test", srcs = [ "b3_propagation_test.cc", @@ -40,7 +41,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "jaeger_propagation_test", srcs = [ "jaeger_propagation_test.cc", diff --git a/api/test/trace/propagation/detail/BUILD b/api/test/trace/propagation/detail/BUILD index 2042f1fcd1..52f8962cc1 100644 --- a/api/test/trace/propagation/detail/BUILD +++ b/api/test/trace/propagation/detail/BUILD @@ -3,10 +3,11 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "hex_test", srcs = [ "hex_test.cc", diff --git a/bazel/otel_cc.bzl b/bazel/otel_cc.bzl new file mode 100644 index 0000000000..73e8adf8fb --- /dev/null +++ b/bazel/otel_cc.bzl @@ -0,0 +1,31 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +load("@rules_cc//cc:defs.bzl", + rules_cc_library = "cc_library", + rules_cc_binary = "cc_binary", + rules_cc_test = "cc_test", + rules_cc_import = "cc_import", +) + +def otel_cc_library(**kwargs): + # Link as .o (.obj) files, not .a (.lib) + kwargs["alwayslink"] = kwargs.get("alwayslink", True) + + # Don't create .so files for dbg/fastbuild, always create static libs + kwargs["linkstatic"] = kwargs.get("linkstatic", True) + + rules_cc_library(**kwargs) + +def otel_cc_binary(**kwargs): + rules_cc_binary(**kwargs) + +def otel_cc_test(**kwargs): + rules_cc_test(**kwargs) + +def otel_cc_import(**kwargs): + rules_cc_import(**kwargs) + +def otel_cc_shared_library(**kwargs): + native.cc_shared_library(**kwargs) + \ No newline at end of file diff --git a/bazel/otel_cc_library.bzl b/bazel/otel_cc_library.bzl deleted file mode 100644 index fe12a296d0..0000000000 --- a/bazel/otel_cc_library.bzl +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - -def otel_cc_library(**kwargs): - native.cc_library( - # Link as .o (.obj) files, not .a (.lib) - alwayslink = True, - # Don't create .so files for dbg/fastbuild, always create static libs - linkstatic = True, - **kwargs) diff --git a/examples/batch/BUILD b/examples/batch/BUILD index 7c0ba3e053..a8636c2fbe 100644 --- a/examples/batch/BUILD +++ b/examples/batch/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "example_simple", srcs = [ "main.cc", diff --git a/examples/common/foo_library/BUILD b/examples/common/foo_library/BUILD index a172c56a16..987075b82d 100644 --- a/examples/common/foo_library/BUILD +++ b/examples/common/foo_library/BUILD @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "avoid_dll_lock", "dll_deps") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() diff --git a/examples/common/logs_foo_library/BUILD b/examples/common/logs_foo_library/BUILD index 94424a92af..cf43f621ff 100644 --- a/examples/common/logs_foo_library/BUILD +++ b/examples/common/logs_foo_library/BUILD @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "avoid_dll_lock", "dll_deps") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() diff --git a/examples/common/metrics_foo_library/BUILD b/examples/common/metrics_foo_library/BUILD index d2da8c532a..b921a84c33 100644 --- a/examples/common/metrics_foo_library/BUILD +++ b/examples/common/metrics_foo_library/BUILD @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "avoid_dll_lock", "dll_deps") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() diff --git a/examples/etw_threads/BUILD b/examples/etw_threads/BUILD index 9cb951d440..0dfe29491d 100644 --- a/examples/etw_threads/BUILD +++ b/examples/etw_threads/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "etw_threadpool", srcs = [ "main.cc", diff --git a/examples/grpc/BUILD b/examples/grpc/BUILD index 5954d6bb8e..e34a796a41 100644 --- a/examples/grpc/BUILD +++ b/examples/grpc/BUILD @@ -6,7 +6,7 @@ package(default_visibility = ["//visibility:public"]) load("@rules_proto//proto:defs.bzl", "proto_library") load("@@grpc~//bazel:cc_grpc_library.bzl", "cc_grpc_library") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() @@ -45,7 +45,7 @@ otel_cc_library( ]), ) -cc_binary( +otel_cc_binary( name = "client_grpc", srcs = [ "client.cc", @@ -60,7 +60,7 @@ cc_binary( ]), ) -cc_binary( +otel_cc_binary( name = "server_grpc", srcs = [ "server.cc", diff --git a/examples/http/BUILD b/examples/http/BUILD index 4e5bba7daf..680578c389 100644 --- a/examples/http/BUILD +++ b/examples/http/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") - +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") + avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "example_http_client", srcs = [ "client.cc", @@ -32,7 +33,7 @@ cc_binary( ]), ) -cc_binary( +otel_cc_binary( name = "example_http_server", srcs = [ "server.cc", diff --git a/examples/logs_simple/BUILD b/examples/logs_simple/BUILD index 8c5cfbeedf..26031aea82 100644 --- a/examples/logs_simple/BUILD +++ b/examples/logs_simple/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "example_logs_simple", srcs = [ "main.cc", diff --git a/examples/metrics_simple/BUILD b/examples/metrics_simple/BUILD index b9cad446de..d9d13f69ab 100644 --- a/examples/metrics_simple/BUILD +++ b/examples/metrics_simple/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "metrics_ostream_example", srcs = [ "metrics_ostream.cc", diff --git a/examples/multi_processor/BUILD b/examples/multi_processor/BUILD index 4189843f06..64b012ad55 100644 --- a/examples/multi_processor/BUILD +++ b/examples/multi_processor/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "example_multi_processor", srcs = [ "main.cc", diff --git a/examples/multithreaded/BUILD b/examples/multithreaded/BUILD index 84b2dbc6ce..b104fcf302 100644 --- a/examples/multithreaded/BUILD +++ b/examples/multithreaded/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "example_multithreaded", srcs = [ "main.cc", diff --git a/examples/otlp/BUILD b/examples/otlp/BUILD index 5be8d94a48..9f40e56ef5 100644 --- a/examples/otlp/BUILD +++ b/examples/otlp/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "example_otlp_grpc", srcs = [ "grpc_main.cc", @@ -23,7 +24,7 @@ cc_binary( ]), ) -cc_binary( +otel_cc_binary( name = "example_otlp_http", srcs = [ "http_main.cc", @@ -41,7 +42,7 @@ cc_binary( ]), ) -cc_binary( +otel_cc_binary( name = "example_otlp_file", srcs = [ "file_main.cc", @@ -59,7 +60,7 @@ cc_binary( ]), ) -cc_binary( +otel_cc_binary( name = "example_otlp_http_log", srcs = [ "http_log_main.cc", @@ -78,7 +79,7 @@ cc_binary( ]), ) -cc_binary( +otel_cc_binary( name = "example_otlp_grpc_log", srcs = [ "grpc_log_main.cc", @@ -97,7 +98,7 @@ cc_binary( ]), ) -cc_binary( +otel_cc_binary( name = "example_otlp_file_log", srcs = [ "file_log_main.cc", @@ -116,7 +117,7 @@ cc_binary( ]), ) -cc_binary( +otel_cc_binary( name = "example_otlp_grpc_metric", srcs = [ "grpc_metric_main.cc", @@ -135,7 +136,7 @@ cc_binary( ]), ) -cc_binary( +otel_cc_binary( name = "example_otlp_http_metric", srcs = [ "http_metric_main.cc", @@ -154,7 +155,7 @@ cc_binary( ]), ) -cc_binary( +otel_cc_binary( name = "example_otlp_file_metric", srcs = [ "file_metric_main.cc", diff --git a/examples/plugin/load/BUILD b/examples/plugin/load/BUILD index 0772298692..a6a254e009 100644 --- a/examples/plugin/load/BUILD +++ b/examples/plugin/load/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "load_plugin", srcs = [ "main.cc", diff --git a/examples/plugin/plugin/BUILD b/examples/plugin/plugin/BUILD index fb7e21519c..8f02292bed 100644 --- a/examples/plugin/plugin/BUILD +++ b/examples/plugin/plugin/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "example_plugin.so", srcs = [ "factory_impl.cc", diff --git a/examples/prometheus/BUILD b/examples/prometheus/BUILD index eeedd309aa..ce8bee9c7e 100644 --- a/examples/prometheus/BUILD +++ b/examples/prometheus/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "prometheus_example", srcs = [ "main.cc", diff --git a/examples/simple/BUILD b/examples/simple/BUILD index 2c597338cf..8e46add651 100644 --- a/examples/simple/BUILD +++ b/examples/simple/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "example_simple", srcs = [ "main.cc", diff --git a/examples/zipkin/BUILD b/examples/zipkin/BUILD index fe8a78eff8..3fe5bacdf4 100644 --- a/examples/zipkin/BUILD +++ b/examples/zipkin/BUILD @@ -2,12 +2,13 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() package(default_visibility = ["//visibility:public"]) -cc_binary( +otel_cc_binary( name = "example_zipkin", srcs = [ "main.cc", diff --git a/exporters/elasticsearch/BUILD b/exporters/elasticsearch/BUILD index 93295511ff..9e2342e79e 100644 --- a/exporters/elasticsearch/BUILD +++ b/exporters/elasticsearch/BUILD @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() @@ -37,7 +37,7 @@ otel_cc_library( ], ) -cc_test( +otel_cc_test( name = "es_log_record_exporter_test", srcs = ["test/es_log_record_exporter_test.cc"], tags = [ diff --git a/exporters/etw/BUILD b/exporters/etw/BUILD index 3a9e11abc0..851178f29a 100644 --- a/exporters/etw/BUILD +++ b/exporters/etw/BUILD @@ -3,7 +3,7 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() @@ -27,7 +27,7 @@ otel_cc_library( ], ) -cc_test( +otel_cc_test( name = "etw_provider_test", srcs = ["test/etw_provider_test.cc"], local_defines = [ @@ -45,7 +45,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "etw_tracer_test", srcs = ["test/etw_tracer_test.cc"], local_defines = [ @@ -63,7 +63,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "etw_logger_test", srcs = ["test/etw_logger_test.cc"], local_defines = [ diff --git a/exporters/memory/BUILD b/exporters/memory/BUILD index 2500fc45be..04541130dc 100644 --- a/exporters/memory/BUILD +++ b/exporters/memory/BUILD @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() @@ -23,7 +23,7 @@ otel_cc_library( ], ) -cc_test( +otel_cc_test( name = "in_memory_span_data_test", srcs = ["test/in_memory_span_data_test.cc"], tags = [ @@ -56,7 +56,7 @@ otel_cc_library( ], ) -cc_test( +otel_cc_test( name = "in_memory_span_exporter_test", srcs = ["test/in_memory_span_exporter_test.cc"], tags = [ diff --git a/exporters/ostream/BUILD b/exporters/ostream/BUILD index 5cbe198d10..d62511740e 100644 --- a/exporters/ostream/BUILD +++ b/exporters/ostream/BUILD @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) @@ -26,7 +26,7 @@ otel_cc_library( ], ) -cc_test( +otel_cc_test( name = "ostream_log_test", srcs = ["test/ostream_log_test.cc"], tags = [ @@ -60,7 +60,7 @@ otel_cc_library( ], ) -cc_test( +otel_cc_test( name = "ostream_metric_test", srcs = ["test/ostream_metric_test.cc"], tags = [ @@ -103,7 +103,7 @@ otel_cc_library( ]), ) -cc_test( +otel_cc_test( name = "ostream_span_test", srcs = ["test/ostream_span_test.cc"], tags = [ diff --git a/exporters/otlp/BUILD b/exporters/otlp/BUILD index 721a9a6f99..7cee7c6ace 100644 --- a/exporters/otlp/BUILD +++ b/exporters/otlp/BUILD @@ -3,7 +3,7 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() @@ -403,7 +403,7 @@ otel_cc_library( ], ) -cc_test( +otel_cc_test( name = "otlp_recordable_test", srcs = ["test/otlp_recordable_test.cc"], tags = [ @@ -419,7 +419,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_metrics_serialization_test", srcs = ["test/otlp_metrics_serialization_test.cc"], tags = [ @@ -433,7 +433,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_log_recordable_test", srcs = [ "test/otlp_log_recordable_test.cc", @@ -449,7 +449,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_file_client_test", srcs = ["test/otlp_file_client_test.cc"], tags = [ @@ -469,7 +469,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_grpc_exporter_test", srcs = ["test/otlp_grpc_exporter_test.cc"], tags = [ @@ -484,7 +484,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_grpc_exporter_factory_test", srcs = ["test/otlp_grpc_exporter_factory_test.cc"], tags = [ @@ -499,7 +499,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_http_exporter_test", srcs = ["test/otlp_http_exporter_test.cc"], tags = [ @@ -515,7 +515,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_http_exporter_factory_test", srcs = ["test/otlp_http_exporter_factory_test.cc"], tags = [ @@ -531,7 +531,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_file_exporter_test", srcs = ["test/otlp_file_exporter_test.cc"], tags = [ @@ -549,7 +549,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_file_exporter_factory_test", srcs = ["test/otlp_file_exporter_factory_test.cc"], tags = [ @@ -564,7 +564,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_http_log_record_exporter_test", srcs = ["test/otlp_http_log_record_exporter_test.cc"], tags = [ @@ -580,7 +580,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_http_log_record_exporter_factory_test", srcs = ["test/otlp_http_log_record_exporter_factory_test.cc"], tags = [ @@ -596,7 +596,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_file_log_record_exporter_test", srcs = ["test/otlp_file_log_record_exporter_test.cc"], tags = [ @@ -613,7 +613,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_file_log_record_exporter_factory_test", srcs = ["test/otlp_file_log_record_exporter_factory_test.cc"], tags = [ @@ -628,7 +628,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_grpc_log_record_exporter_test", srcs = ["test/otlp_grpc_log_record_exporter_test.cc"], tags = [ @@ -648,7 +648,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_grpc_log_record_exporter_factory_test", srcs = ["test/otlp_grpc_log_record_exporter_factory_test.cc"], tags = [ @@ -664,7 +664,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_grpc_metric_exporter_test", srcs = ["test/otlp_grpc_metric_exporter_test.cc"], tags = [ @@ -680,7 +680,7 @@ cc_test( ], ) -cc_test( +otel_cc_test( name = "otlp_grpc_metric_exporter_factory_test", srcs = ["test/otlp_grpc_metric_exporter_factory_test.cc"], tags = [ @@ -695,7 +695,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_http_metric_exporter_test", srcs = ["test/otlp_http_metric_exporter_test.cc"], tags = [ @@ -713,7 +713,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_http_metric_exporter_factory_test", srcs = ["test/otlp_http_metric_exporter_factory_test.cc"], tags = [ @@ -729,7 +729,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "otlp_file_metric_exporter_test", srcs = ["test/otlp_file_metric_exporter_test.cc"], tags = [ @@ -744,7 +744,7 @@ cc_test( ], ) -cc_test( +otel_cc_test( name = "otlp_file_metric_exporter_factory_test", srcs = ["test/otlp_file_metric_exporter_factory_test.cc"], tags = [ diff --git a/exporters/prometheus/BUILD b/exporters/prometheus/BUILD index 8c040b58a0..4d497f5d9f 100644 --- a/exporters/prometheus/BUILD +++ b/exporters/prometheus/BUILD @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() @@ -84,7 +84,7 @@ otel_cc_library( ]), ) -cc_test( +otel_cc_test( name = "prometheus_exporter_test", srcs = [ "test/exporter_test.cc", @@ -103,7 +103,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "prometheus_collector_test", srcs = [ "test/collector_test.cc", @@ -122,7 +122,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "prometheus_exporter_utils_test", srcs = [ "test/exporter_utils_test.cc", @@ -178,7 +178,7 @@ otel_cc_library( ]), ) -cc_test( +otel_cc_test( name = "prometheus_push_exporter_test", flaky = True, srcs = [ diff --git a/exporters/zipkin/BUILD b/exporters/zipkin/BUILD index c3c91dd6d4..8747a4a3ac 100644 --- a/exporters/zipkin/BUILD +++ b/exporters/zipkin/BUILD @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() @@ -47,7 +47,7 @@ otel_cc_library( ], ) -cc_test( +otel_cc_test( name = "zipkin_recordable_test", srcs = ["test/zipkin_recordable_test.cc"], tags = [ @@ -61,7 +61,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "zipkin_exporter_test", srcs = ["test/zipkin_exporter_test.cc"], tags = [ diff --git a/ext/BUILD b/ext/BUILD index c263aef10b..ebb0aab152 100644 --- a/ext/BUILD +++ b/ext/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) diff --git a/ext/src/http/client/curl/BUILD b/ext/src/http/client/curl/BUILD index c70176f3dc..a924dde685 100644 --- a/ext/src/http/client/curl/BUILD +++ b/ext/src/http/client/curl/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) diff --git a/ext/test/http/BUILD b/ext/test/http/BUILD index 5944c2d849..580e264c9a 100644 --- a/ext/test/http/BUILD +++ b/ext/test/http/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "curl_http_test", srcs = [ "curl_http_test.cc", @@ -20,7 +21,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "url_parser_test", srcs = [ "url_parser_test.cc", diff --git a/ext/test/w3c_tracecontext_test/BUILD b/ext/test/w3c_tracecontext_test/BUILD index 91f15b435b..a592951e36 100644 --- a/ext/test/w3c_tracecontext_test/BUILD +++ b/ext/test/w3c_tracecontext_test/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_binary( +otel_cc_binary( name = "w3c_tracecontext_test", srcs = [ "main.cc", diff --git a/functional/otlp/BUILD b/functional/otlp/BUILD index 2de6d3686e..279067c729 100644 --- a/functional/otlp/BUILD +++ b/functional/otlp/BUILD @@ -3,12 +3,13 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "avoid_dll_lock", "dll_deps") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() package(default_visibility = ["//visibility:public"]) -cc_binary( +otel_cc_binary( name = "func_otlp_http", srcs = [ "func_http_main.cc", diff --git a/opentracing-shim/BUILD b/opentracing-shim/BUILD index ff67d2863e..562733c161 100644 --- a/opentracing-shim/BUILD +++ b/opentracing-shim/BUILD @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() @@ -31,7 +31,7 @@ otel_cc_library( ], ) -cc_test( +otel_cc_test( name = "propagation_test", srcs = [ "test/propagation_test.cc", @@ -47,7 +47,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "shim_utils_test", srcs = [ "test/shim_mocks.h", @@ -63,7 +63,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "span_shim_test", srcs = [ "test/shim_mocks.h", @@ -79,7 +79,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "span_context_shim_test", srcs = [ "test/span_context_shim_test.cc", @@ -94,7 +94,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "tracer_shim_test", srcs = [ "test/shim_mocks.h", diff --git a/sdk/BUILD b/sdk/BUILD index c263aef10b..ebb0aab152 100644 --- a/sdk/BUILD +++ b/sdk/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) diff --git a/sdk/src/common/BUILD b/sdk/src/common/BUILD index 7f4850ceab..e14e0b1820 100644 --- a/sdk/src/common/BUILD +++ b/sdk/src/common/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) diff --git a/sdk/src/common/platform/BUILD b/sdk/src/common/platform/BUILD index bfc6ad3e64..ce5a741fd9 100644 --- a/sdk/src/common/platform/BUILD +++ b/sdk/src/common/platform/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) diff --git a/sdk/src/logs/BUILD b/sdk/src/logs/BUILD index eee0994841..87288aac6d 100644 --- a/sdk/src/logs/BUILD +++ b/sdk/src/logs/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) diff --git a/sdk/src/metrics/BUILD b/sdk/src/metrics/BUILD index f56eb01442..2e7ff46508 100644 --- a/sdk/src/metrics/BUILD +++ b/sdk/src/metrics/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) diff --git a/sdk/src/resource/BUILD b/sdk/src/resource/BUILD index 2201785f08..286b55130b 100644 --- a/sdk/src/resource/BUILD +++ b/sdk/src/resource/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) diff --git a/sdk/src/trace/BUILD b/sdk/src/trace/BUILD index 0b655ebc13..4fd10a4f89 100644 --- a/sdk/src/trace/BUILD +++ b/sdk/src/trace/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) diff --git a/sdk/test/common/BUILD b/sdk/test/common/BUILD index a6735a37b9..3cc9ec5222 100644 --- a/sdk/test/common/BUILD +++ b/sdk/test/common/BUILD @@ -3,11 +3,11 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "random_test", srcs = [ "random_test.cc", @@ -19,7 +19,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "base64_test", srcs = [ "base64_test.cc", @@ -31,7 +31,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "fast_random_number_generator_test", srcs = [ "fast_random_number_generator_test.cc", @@ -63,7 +63,7 @@ otel_cc_benchmark( deps = dll_deps(["//sdk/src/common:random"]), ) -cc_test( +otel_cc_test( name = "atomic_unique_ptr_test", srcs = [ "atomic_unique_ptr_test.cc", @@ -76,7 +76,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "circular_buffer_range_test", srcs = [ "circular_buffer_range_test.cc", @@ -89,7 +89,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "random_fork_test", srcs = [ "random_fork_test.cc", @@ -125,7 +125,7 @@ otel_cc_benchmark( ]), ) -cc_test( +otel_cc_test( name = "empty_attributes_test", srcs = [ "empty_attributes_test.cc", @@ -138,7 +138,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "attribute_utils_test", srcs = [ "attribute_utils_test.cc", @@ -151,7 +151,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "global_log_handle_test", srcs = [ "global_log_handle_test.cc", @@ -165,7 +165,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "attributemap_hash_test", srcs = [ "attributemap_hash_test.cc", @@ -191,7 +191,7 @@ otel_cc_benchmark( ]), ) -cc_test( +otel_cc_test( name = "env_var_test", srcs = [ "env_var_test.cc", diff --git a/sdk/test/instrumentationscope/BUILD b/sdk/test/instrumentationscope/BUILD index 90e6de9301..2258e7658f 100644 --- a/sdk/test/instrumentationscope/BUILD +++ b/sdk/test/instrumentationscope/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "instrumentationscope_test", srcs = [ "instrumentationscope_test.cc", diff --git a/sdk/test/logs/BUILD b/sdk/test/logs/BUILD index b6fadf9150..712ec0273b 100644 --- a/sdk/test/logs/BUILD +++ b/sdk/test/logs/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "logger_provider_sdk_test", srcs = [ "logger_provider_sdk_test.cc", @@ -21,7 +22,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "logger_sdk_test", srcs = [ "logger_sdk_test.cc", @@ -37,7 +38,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "simple_log_record_processor_test", srcs = [ "simple_log_record_processor_test.cc", @@ -52,7 +53,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "log_record_test", srcs = [ "log_record_test.cc", @@ -67,7 +68,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "batch_log_record_processor_test", srcs = [ "batch_log_record_processor_test.cc", diff --git a/sdk/test/metrics/BUILD b/sdk/test/metrics/BUILD index 7853f62198..23310074dc 100644 --- a/sdk/test/metrics/BUILD +++ b/sdk/test/metrics/BUILD @@ -3,7 +3,7 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() @@ -23,7 +23,7 @@ otel_cc_library( ]), ) -cc_test( +otel_cc_test( name = "meter_test", srcs = [ "meter_test.cc", @@ -38,7 +38,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "meter_provider_sdk_test", srcs = [ "meter_provider_sdk_test.cc", @@ -54,7 +54,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "metric_reader_test", srcs = [ "metric_reader_test.cc", @@ -70,7 +70,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "histogram_test", srcs = [ "histogram_test.cc", @@ -86,7 +86,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "view_registry_test", srcs = [ "view_registry_test.cc", @@ -102,7 +102,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "aggregation_test", srcs = [ "aggregation_test.cc", @@ -118,7 +118,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "sync_metric_storage_counter_test", srcs = [ "sync_metric_storage_counter_test.cc", @@ -134,7 +134,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "sync_metric_storage_up_down_counter_test", srcs = [ "sync_metric_storage_up_down_counter_test.cc", @@ -150,7 +150,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "sync_metric_storage_histogram_test", srcs = [ "sync_metric_storage_histogram_test.cc", @@ -166,7 +166,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "sync_instruments_test", srcs = [ "sync_instruments_test.cc", @@ -182,7 +182,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "async_instruments_test", srcs = [ "async_instruments_test.cc", @@ -197,7 +197,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "async_metric_storage_test", srcs = [ "async_metric_storage_test.cc", @@ -213,7 +213,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "observer_result_test", srcs = [ "observer_result_test.cc", @@ -229,7 +229,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "multi_metric_storage_test", srcs = [ "multi_metric_storage_test.cc", @@ -245,7 +245,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "attributes_processor_test", srcs = [ "attributes_processor_test.cc", @@ -260,7 +260,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "attributes_hashmap_test", srcs = [ "attributes_hashmap_test.cc", @@ -275,7 +275,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "circular_buffer_counter_test", srcs = [ "circular_buffer_counter_test.cc", @@ -290,7 +290,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( #name = "base2_exponential_histogram_indexer_test", name = "b2exphist_idx_test", srcs = [ @@ -306,7 +306,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "histogram_aggregation_test", srcs = [ "histogram_aggregation_test.cc", @@ -321,7 +321,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "sum_aggregation_test", srcs = [ "sum_aggregation_test.cc", diff --git a/sdk/test/metrics/exemplar/BUILD b/sdk/test/metrics/exemplar/BUILD index 885c46c5ea..37461ecc03 100644 --- a/sdk/test/metrics/exemplar/BUILD +++ b/sdk/test/metrics/exemplar/BUILD @@ -1,10 +1,11 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "no_exemplar_reservoir_test", srcs = [ "no_exemplar_reservoir_test.cc", @@ -21,7 +22,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "reservoir_cell_test", srcs = [ "reservoir_cell_test.cc", @@ -38,7 +39,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "aligned_histogram_bucket_exemplar_reservoir_test", srcs = [ "aligned_histogram_bucket_exemplar_reservoir_test.cc", diff --git a/sdk/test/resource/BUILD b/sdk/test/resource/BUILD index 28042c96ab..c0a322a172 100644 --- a/sdk/test/resource/BUILD +++ b/sdk/test/resource/BUILD @@ -2,10 +2,11 @@ # SPDX-License-Identifier: Apache-2.0 load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "resource_test", srcs = [ "resource_test.cc", diff --git a/sdk/test/trace/BUILD b/sdk/test/trace/BUILD index af52ac7768..91a4d83ca2 100644 --- a/sdk/test/trace/BUILD +++ b/sdk/test/trace/BUILD @@ -3,10 +3,11 @@ load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") load("//:dll_deps.bzl", "dll_deps", "avoid_dll_lock") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") avoid_dll_lock() -cc_test( +otel_cc_test( name = "tracer_provider_test", srcs = [ "tracer_provider_test.cc", @@ -22,7 +23,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "span_data_test", srcs = [ "span_data_test.cc", @@ -37,7 +38,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "simple_processor_test", srcs = [ "simple_processor_test.cc", @@ -53,7 +54,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "batch_span_processor_test", srcs = [ "batch_span_processor_test.cc", @@ -68,7 +69,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "tracer_test", srcs = [ "tracer_test.cc", @@ -85,7 +86,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "always_on_sampler_test", srcs = [ "always_on_sampler_test.cc", @@ -100,7 +101,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "always_off_sampler_test", srcs = [ "always_off_sampler_test.cc", @@ -115,7 +116,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "parent_sampler_test", srcs = [ "parent_sampler_test.cc", @@ -130,7 +131,7 @@ cc_test( ]), ) -cc_test( +otel_cc_test( name = "trace_id_ratio_sampler_test", srcs = [ "trace_id_ratio_sampler_test.cc", diff --git a/test_common/BUILD b/test_common/BUILD index 1773078eb3..998d954a66 100644 --- a/test_common/BUILD +++ b/test_common/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"]) diff --git a/test_common/src/http/client/nosend/BUILD b/test_common/src/http/client/nosend/BUILD index 56e8843351..e372179eb3 100644 --- a/test_common/src/http/client/nosend/BUILD +++ b/test_common/src/http/client/nosend/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_library.bzl", "otel_cc_library") +load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_binary", "otel_cc_test", "otel_cc_import", "otel_cc_shared_library") package(default_visibility = ["//visibility:public"])