diff --git a/MODULE.bazel b/MODULE.bazel index 81abe235f3..191d6bb6e6 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -19,6 +19,7 @@ bazel_dep(name = "platforms", version = "0.0.11") bazel_dep(name = "prometheus-cpp", version = "1.3.0", repo_name = "com_github_jupp0r_prometheus_cpp") bazel_dep(name = "protobuf", version = "29.0", repo_name = "com_google_protobuf") bazel_dep(name = "rapidyaml", version = "0.9.0") +bazel_dep(name = "rules_cc", version = "0.2.9") bazel_dep(name = "rules_proto", version = "7.0.2") bazel_dep(name = "zlib", version = "1.3.1.bcr.5") diff --git a/WORKSPACE b/WORKSPACE index a52788ece2..bad13670a5 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -3,6 +3,28 @@ workspace(name = "io_opentelemetry_cpp") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "platforms", + sha256 = "3384eb1c30762704fbe38e440204e114154086c8fc8a8c2e3e28441028c019a8", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/1.0.0/platforms-1.0.0.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/1.0.0/platforms-1.0.0.tar.gz", + ], +) + +http_archive( + name = "bazel_features", + sha256 = "adc8ddf121917f197f75c5245dfa8d7b1619f10a1002e25062b093b7957f2798", + strip_prefix = "bazel_features-1.37.0", + url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.37.0/bazel_features-v1.37.0.tar.gz", +) + +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + # Load our direct dependencies. load("//bazel:repository.bzl", "opentelemetry_cpp_deps") diff --git a/api/BUILD b/api/BUILD index fb31393569..bfd3af6014 100644 --- a/api/BUILD +++ b/api/BUILD @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "int_flag", "string_flag") +load("@rules_cc//cc:cc_library.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) diff --git a/api/test/baggage/BUILD b/api/test/baggage/BUILD index a3783a63c0..c25f21e34c 100644 --- a/api/test/baggage/BUILD +++ b/api/test/baggage/BUILD @@ -1,6 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") cc_test( diff --git a/api/test/baggage/propagation/BUILD b/api/test/baggage/propagation/BUILD index 2b820ed3c8..322953b8ef 100644 --- a/api/test/baggage/propagation/BUILD +++ b/api/test/baggage/propagation/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") +load("@rules_cc//cc:cc_test.bzl", "cc_test") cc_test( name = "baggage_propagator_test", diff --git a/api/test/common/BUILD b/api/test/common/BUILD index 5ea2d5d57d..3af58b5300 100644 --- a/api/test/common/BUILD +++ b/api/test/common/BUILD @@ -1,6 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") otel_cc_benchmark( diff --git a/api/test/context/BUILD b/api/test/context/BUILD index 64b2cb750f..8f3cc8e2dd 100644 --- a/api/test/context/BUILD +++ b/api/test/context/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") +load("@rules_cc//cc:cc_test.bzl", "cc_test") cc_test( name = "context_test", diff --git a/api/test/context/propagation/BUILD b/api/test/context/propagation/BUILD index d62d67649c..14b621af53 100644 --- a/api/test/context/propagation/BUILD +++ b/api/test/context/propagation/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") +load("@rules_cc//cc:cc_test.bzl", "cc_test") cc_test( name = "composite_propagator_test", diff --git a/api/test/core/BUILD b/api/test/core/BUILD index 38c65e6d31..ed0895a5c3 100644 --- a/api/test/core/BUILD +++ b/api/test/core/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") + cc_test( name = "timestamp_test", srcs = [ diff --git a/api/test/logs/BUILD b/api/test/logs/BUILD index 521620a209..1fa9c4884c 100644 --- a/api/test/logs/BUILD +++ b/api/test/logs/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") +load("@rules_cc//cc:cc_test.bzl", "cc_test") cc_test( name = "provider_test", diff --git a/api/test/metrics/BUILD b/api/test/metrics/BUILD index 86e20033b7..e601961d12 100644 --- a/api/test/metrics/BUILD +++ b/api/test/metrics/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") +load("@rules_cc//cc:cc_test.bzl", "cc_test") cc_test( name = "noop_sync_instrument_test", diff --git a/api/test/nostd/BUILD b/api/test/nostd/BUILD index 4f2b1d31fd..e8485194b3 100644 --- a/api/test/nostd/BUILD +++ b/api/test/nostd/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") + cc_test( name = "function_ref_test", srcs = [ diff --git a/api/test/plugin/BUILD b/api/test/plugin/BUILD index f20143ff77..dc57d6f6d7 100644 --- a/api/test/plugin/BUILD +++ b/api/test/plugin/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") + cc_test( name = "dynamic_load_test", srcs = [ diff --git a/api/test/singleton/BUILD b/api/test/singleton/BUILD index eae9f6b8c0..af24c17cdb 100644 --- a/api/test/singleton/BUILD +++ b/api/test/singleton/BUILD @@ -1,6 +1,10 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + # gcc and clang, assumed to be used on this platform DEFAULT_NOWIN_COPTS = [ "-fvisibility=default", diff --git a/api/test/trace/BUILD b/api/test/trace/BUILD index d233084597..fd39ec9ea5 100644 --- a/api/test/trace/BUILD +++ b/api/test/trace/BUILD @@ -1,6 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") cc_test( diff --git a/api/test/trace/propagation/BUILD b/api/test/trace/propagation/BUILD index 8e9718e80f..91535dc1be 100644 --- a/api/test/trace/propagation/BUILD +++ b/api/test/trace/propagation/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") +load("@rules_cc//cc:cc_test.bzl", "cc_test") cc_test( name = "http_text_format_test", diff --git a/api/test/trace/propagation/detail/BUILD b/api/test/trace/propagation/detail/BUILD index 322c892937..92accdc323 100644 --- a/api/test/trace/propagation/detail/BUILD +++ b/api/test/trace/propagation/detail/BUILD @@ -1,7 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 -load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") +load("@rules_cc//cc:cc_test.bzl", "cc_test") cc_test( name = "hex_test", diff --git a/bazel/extra_deps.bzl b/bazel/extra_deps.bzl index 3a0148b87b..08462465cd 100644 --- a/bazel/extra_deps.bzl +++ b/bazel/extra_deps.bzl @@ -5,7 +5,14 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") load("@com_github_jupp0r_prometheus_cpp//bazel:repositories.bzl", "prometheus_cpp_repositories") +load("@platforms//host:extension.bzl", "host_platform_repo") +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") +load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") def opentelemetry_extra_deps(): + rules_cc_dependencies() + rules_cc_toolchains() + compatibility_proxy_repo() prometheus_cpp_repositories() bazel_skylib_workspace() + host_platform_repo(name = "host_platform") diff --git a/bazel/otel_cc_benchmark.bzl b/bazel/otel_cc_benchmark.bzl index cb181f83c3..5e4cd1b7ac 100644 --- a/bazel/otel_cc_benchmark.bzl +++ b/bazel/otel_cc_benchmark.bzl @@ -1,6 +1,9 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + def otel_cc_benchmark(name, srcs, deps, tags = [""]): """ Creates targets for the benchmark and related targets. @@ -22,7 +25,7 @@ def otel_cc_benchmark(name, srcs, deps, tags = [""]): # This is the benchmark as a binary, it can be run manually, and is used # to generate the _result below. - native.cc_binary( + cc_binary( name = name, srcs = srcs, deps = deps + ["@com_github_google_benchmark//:benchmark"], @@ -42,7 +45,7 @@ def otel_cc_benchmark(name, srcs, deps, tags = [""]): # This is run as part of "bazel test ..." to smoke-test benchmarks. It's # meant to complete quickly rather than get accurate results. - native.cc_test( + cc_test( name = name + "_smoketest", srcs = srcs, deps = deps + ["@com_github_google_benchmark//:benchmark"], diff --git a/bazel/repository.bzl b/bazel/repository.bzl index 0c4b15e091..983fbb07ef 100644 --- a/bazel/repository.bzl +++ b/bazel/repository.bzl @@ -19,6 +19,13 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def opentelemetry_cpp_deps(): """Loads dependencies need to compile the opentelemetry-cpp library.""" + maybe( + http_archive, + name = "rules_cc", + sha256 = "ae244f400218f4a12ee81658ff246c0be5cb02c5ca2de5519ed505a6795431e9", + strip_prefix = "rules_cc-0.2.0", + url = "https://github.com/bazelbuild/rules_cc/releases/download/0.2.0/rules_cc-0.2.0.tar.gz", + ) # Google Benchmark library. # Only needed for benchmarks, not to build the OpenTelemetry library. @@ -76,10 +83,10 @@ def opentelemetry_cpp_deps(): maybe( http_archive, name = "com_github_grpc_grpc", - sha256 = "f40bde4ce2f31760f65dc49a2f50876f59077026494e67dccf23992548b1b04f", - strip_prefix = "grpc-1.62.0", + sha256 = "eacf07e6354b6a30056b0338027b20c7f5a1da556a674d108cea1b8938d7abec", + strip_prefix = "grpc-1.66.0", urls = [ - "https://github.com/grpc/grpc/archive/refs/tags/v1.62.0.tar.gz", + "https://github.com/grpc/grpc/archive/refs/tags/v1.66.0.tar.gz", ], ) diff --git a/examples/batch/BUILD b/examples/batch/BUILD index c5db0f4b65..557b5b6b8e 100644 --- a/examples/batch/BUILD +++ b/examples/batch/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "example_simple", srcs = [ diff --git a/examples/common/foo_library/BUILD b/examples/common/foo_library/BUILD index 541d78692b..684032cd81 100644 --- a/examples/common/foo_library/BUILD +++ b/examples/common/foo_library/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/examples/common/logs_foo_library/BUILD b/examples/common/logs_foo_library/BUILD index 3dc0ae9fba..644ecd15bb 100644 --- a/examples/common/logs_foo_library/BUILD +++ b/examples/common/logs_foo_library/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/examples/common/metrics_foo_library/BUILD b/examples/common/metrics_foo_library/BUILD index 55ab0154d8..90928d1a91 100644 --- a/examples/common/metrics_foo_library/BUILD +++ b/examples/common/metrics_foo_library/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/examples/configuration/BUILD b/examples/configuration/BUILD index 7c2245ca9c..f5855a4af1 100644 --- a/examples/configuration/BUILD +++ b/examples/configuration/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "example_yaml", srcs = glob(["*.cc"]) + glob(["*.h"]), diff --git a/examples/etw_threads/BUILD b/examples/etw_threads/BUILD index edb60080eb..1722c1a5f9 100644 --- a/examples/etw_threads/BUILD +++ b/examples/etw_threads/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "example_etw_threads", srcs = [ diff --git a/examples/grpc/BUILD b/examples/grpc/BUILD index 5fe8898ac8..94e19f7e58 100644 --- a/examples/grpc/BUILD +++ b/examples/grpc/BUILD @@ -2,6 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") +load("@rules_cc//cc:cc_library.bzl", "cc_library") load("@rules_proto//proto:defs.bzl", "proto_library") package(default_visibility = ["//visibility:public"]) diff --git a/examples/http/BUILD b/examples/http/BUILD index 2737a8823c..4dbf46f621 100644 --- a/examples/http/BUILD +++ b/examples/http/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "example_http_client", srcs = [ diff --git a/examples/logs_simple/BUILD b/examples/logs_simple/BUILD index 03073b429c..0481b1cfe8 100644 --- a/examples/logs_simple/BUILD +++ b/examples/logs_simple/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "example_logs_simple", srcs = [ diff --git a/examples/metrics_simple/BUILD b/examples/metrics_simple/BUILD index 029fda8a7a..b1042ad4b4 100644 --- a/examples/metrics_simple/BUILD +++ b/examples/metrics_simple/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "metrics_ostream_example", srcs = [ diff --git a/examples/multi_processor/BUILD b/examples/multi_processor/BUILD index 1c7a3789b5..c9125891aa 100644 --- a/examples/multi_processor/BUILD +++ b/examples/multi_processor/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "example_multi_processor", srcs = [ diff --git a/examples/multithreaded/BUILD b/examples/multithreaded/BUILD index 4ee1386298..4c40c16316 100644 --- a/examples/multithreaded/BUILD +++ b/examples/multithreaded/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "example_multithreaded", srcs = [ diff --git a/examples/otlp/BUILD b/examples/otlp/BUILD index b27cbef32d..b346630b09 100644 --- a/examples/otlp/BUILD +++ b/examples/otlp/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "example_otlp_grpc", srcs = [ diff --git a/examples/plugin/load/BUILD b/examples/plugin/load/BUILD index b129854a41..82e571add3 100644 --- a/examples/plugin/load/BUILD +++ b/examples/plugin/load/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "load_plugin", srcs = [ diff --git a/examples/plugin/plugin/BUILD b/examples/plugin/plugin/BUILD index 2f73980665..3d1f129b46 100644 --- a/examples/plugin/plugin/BUILD +++ b/examples/plugin/plugin/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "example_plugin.so", srcs = [ diff --git a/examples/prometheus/BUILD b/examples/prometheus/BUILD index 0a6789f21f..4548988623 100644 --- a/examples/prometheus/BUILD +++ b/examples/prometheus/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "prometheus_example", srcs = [ diff --git a/examples/simple/BUILD b/examples/simple/BUILD index 5a3c27c280..c155a736bc 100644 --- a/examples/simple/BUILD +++ b/examples/simple/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "example_simple", srcs = [ diff --git a/exporters/elasticsearch/BUILD b/exporters/elasticsearch/BUILD index 9990c25860..71ff5f39d2 100644 --- a/exporters/elasticsearch/BUILD +++ b/exporters/elasticsearch/BUILD @@ -1,6 +1,9 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/exporters/etw/BUILD b/exporters/etw/BUILD index ad8518bc25..fa121d9913 100644 --- a/exporters/etw/BUILD +++ b/exporters/etw/BUILD @@ -1,6 +1,9 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/exporters/memory/BUILD b/exporters/memory/BUILD index 033c85d369..e7a94ee7f3 100644 --- a/exporters/memory/BUILD +++ b/exporters/memory/BUILD @@ -1,6 +1,9 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/exporters/ostream/BUILD b/exporters/ostream/BUILD index a5bd1e2384..d31f6f0c6d 100644 --- a/exporters/ostream/BUILD +++ b/exporters/ostream/BUILD @@ -1,6 +1,9 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/exporters/otlp/BUILD b/exporters/otlp/BUILD index 7c1128d7b2..74aa818310 100644 --- a/exporters/otlp/BUILD +++ b/exporters/otlp/BUILD @@ -2,6 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") package(default_visibility = ["//visibility:public"]) diff --git a/exporters/prometheus/BUILD b/exporters/prometheus/BUILD index ef4da55a33..71d8b00031 100644 --- a/exporters/prometheus/BUILD +++ b/exporters/prometheus/BUILD @@ -1,6 +1,9 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/exporters/zipkin/BUILD b/exporters/zipkin/BUILD index aad6ebd4a4..9a02b132d8 100644 --- a/exporters/zipkin/BUILD +++ b/exporters/zipkin/BUILD @@ -1,6 +1,9 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/ext/BUILD b/ext/BUILD index b19ae921e5..52ed22afb5 100644 --- a/ext/BUILD +++ b/ext/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/ext/src/http/client/curl/BUILD b/ext/src/http/client/curl/BUILD index 51613ecf06..9d2f6f7637 100644 --- a/ext/src/http/client/curl/BUILD +++ b/ext/src/http/client/curl/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/ext/test/http/BUILD b/ext/test/http/BUILD index d030ec2847..c7d1dfde69 100644 --- a/ext/test/http/BUILD +++ b/ext/test/http/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") + cc_test( name = "curl_http_test", srcs = [ diff --git a/ext/test/w3c_tracecontext_http_test_server/BUILD b/ext/test/w3c_tracecontext_http_test_server/BUILD index 8c1c8c17e9..5c3b197155 100644 --- a/ext/test/w3c_tracecontext_http_test_server/BUILD +++ b/ext/test/w3c_tracecontext_http_test_server/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") + cc_binary( name = "w3c_tracecontext_http_test_server", srcs = [ diff --git a/opentracing-shim/BUILD b/opentracing-shim/BUILD index e7d90a4b4d..6daa05b621 100644 --- a/opentracing-shim/BUILD +++ b/opentracing-shim/BUILD @@ -1,6 +1,9 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/resource_detectors/BUILD b/resource_detectors/BUILD index d68c1a710d..f12e695647 100644 --- a/resource_detectors/BUILD +++ b/resource_detectors/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/resource_detectors/test/BUILD b/resource_detectors/test/BUILD index 0c12439654..b230901308 100644 --- a/resource_detectors/test/BUILD +++ b/resource_detectors/test/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") + cc_test( name = "resource_detector_test", srcs = [ diff --git a/sdk/BUILD b/sdk/BUILD index b19ae921e5..52ed22afb5 100644 --- a/sdk/BUILD +++ b/sdk/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/sdk/src/common/BUILD b/sdk/src/common/BUILD index 19b47034f7..5b47897c9b 100644 --- a/sdk/src/common/BUILD +++ b/sdk/src/common/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/sdk/src/common/platform/BUILD b/sdk/src/common/platform/BUILD index f089ebf718..bf4deb1713 100644 --- a/sdk/src/common/platform/BUILD +++ b/sdk/src/common/platform/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/sdk/src/configuration/BUILD b/sdk/src/configuration/BUILD index bdf45a3af1..8874327638 100644 --- a/sdk/src/configuration/BUILD +++ b/sdk/src/configuration/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/sdk/src/logs/BUILD b/sdk/src/logs/BUILD index 8c3e44e205..2ac88900a8 100644 --- a/sdk/src/logs/BUILD +++ b/sdk/src/logs/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/sdk/src/metrics/BUILD b/sdk/src/metrics/BUILD index aa8ed74b45..be1bdc73de 100644 --- a/sdk/src/metrics/BUILD +++ b/sdk/src/metrics/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/sdk/src/resource/BUILD b/sdk/src/resource/BUILD index 8845629990..e73e4c059a 100644 --- a/sdk/src/resource/BUILD +++ b/sdk/src/resource/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/sdk/src/trace/BUILD b/sdk/src/trace/BUILD index 7262a1c0a0..b5ed27a1aa 100644 --- a/sdk/src/trace/BUILD +++ b/sdk/src/trace/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/sdk/test/common/BUILD b/sdk/test/common/BUILD index de4c02ec56..2d792d4af6 100644 --- a/sdk/test/common/BUILD +++ b/sdk/test/common/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") cc_test( diff --git a/sdk/test/configuration/BUILD b/sdk/test/configuration/BUILD index ec14533b71..08a920875b 100644 --- a/sdk/test/configuration/BUILD +++ b/sdk/test/configuration/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") + cc_test( name = "yaml_logs_test", srcs = [ diff --git a/sdk/test/instrumentationscope/BUILD b/sdk/test/instrumentationscope/BUILD index 39a61564a7..34b5e0f4a0 100644 --- a/sdk/test/instrumentationscope/BUILD +++ b/sdk/test/instrumentationscope/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") + cc_test( name = "instrumentationscope_test", srcs = [ diff --git a/sdk/test/logs/BUILD b/sdk/test/logs/BUILD index 26c837ea89..ccf035c163 100644 --- a/sdk/test/logs/BUILD +++ b/sdk/test/logs/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") + cc_test( name = "logger_provider_sdk_test", srcs = [ diff --git a/sdk/test/metrics/BUILD b/sdk/test/metrics/BUILD index dcd7a323f1..40ffbc8b62 100644 --- a/sdk/test/metrics/BUILD +++ b/sdk/test/metrics/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") cc_library( diff --git a/sdk/test/metrics/exemplar/BUILD b/sdk/test/metrics/exemplar/BUILD index 413780b7d5..9b11a64b9c 100644 --- a/sdk/test/metrics/exemplar/BUILD +++ b/sdk/test/metrics/exemplar/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") + cc_test( name = "no_exemplar_reservoir_test", srcs = [ diff --git a/sdk/test/resource/BUILD b/sdk/test/resource/BUILD index 145ecf0b56..92005f3a0a 100644 --- a/sdk/test/resource/BUILD +++ b/sdk/test/resource/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") + cc_test( name = "resource_test", srcs = [ diff --git a/sdk/test/trace/BUILD b/sdk/test/trace/BUILD index 18a750a333..06ca595858 100644 --- a/sdk/test/trace/BUILD +++ b/sdk/test/trace/BUILD @@ -1,6 +1,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_test.bzl", "cc_test") load("//bazel:otel_cc_benchmark.bzl", "otel_cc_benchmark") cc_test( diff --git a/test_common/BUILD b/test_common/BUILD index b19ae921e5..52ed22afb5 100644 --- a/test_common/BUILD +++ b/test_common/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/test_common/src/http/client/nosend/BUILD b/test_common/src/http/client/nosend/BUILD index fa7ba623ab..9436ec0045 100644 --- a/test_common/src/http/client/nosend/BUILD +++ b/test_common/src/http/client/nosend/BUILD @@ -1,6 +1,8 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/tools/WORKSPACE b/tools/WORKSPACE index 3e90ba0c4f..404f317947 100644 --- a/tools/WORKSPACE +++ b/tools/WORKSPACE @@ -2,6 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 local_repository( - name = "vcpkg", - path = "./vcpkg", + name = "vcpkg", + path = "./vcpkg", )