-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bazel Build alterations #416
Changes from 4 commits
c62649f
bb6c9bc
4569828
42e49a8
235965c
ca476bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
def opentelemetry_cpp_deps(): | ||
"""Loads dependencies need to compile the opentelemetry-cpp library.""" | ||
|
||
# Google Benchmark library. | ||
# Only needed for benchmarks, not to build the OpenTelemetry library. | ||
maybe( | ||
native.local_repository, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are consumers of otel-cpp meant to load e.g. benchmark before calling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah. I need to write the "INSTALLING" section for bazel, but basic gist is if you want to configure your own version/build that you can do so if you load BEFORE calling our macro, but you'll be on your own ensuring the version is compatible with us. |
||
name = "com_github_google_benchmark", | ||
path = "third_party/benchmark", | ||
) | ||
|
||
# GoogleTest framework. | ||
# Only needed for tests, not to build the OpenTelemetry library. | ||
maybe( | ||
native.local_repository, | ||
name = "com_google_googletest", | ||
path = "third_party/googletest", | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. We are using google-test and benchmark from submodules directory now : ) |
||
|
||
# Load gRPC dependency | ||
maybe( | ||
http_archive, | ||
name = "com_github_grpc_grpc", | ||
sha256 = "d6277f77e0bb922d3f6f56c0f93292bb4cfabfc3c92b31ee5ccea0e100303612", | ||
strip_prefix = "grpc-1.28.0", | ||
urls = [ | ||
"https://github.com/grpc/grpc/archive/v1.28.0.tar.gz", | ||
], | ||
) | ||
|
||
# Uses older protobuf version because of | ||
# https://github.com/protocolbuffers/protobuf/issues/7179 | ||
maybe( | ||
http_archive, | ||
name = "com_google_protobuf", | ||
sha256 = "b679cef31102ed8beddc39ecfd6368ee311cbee6f50742f13f21be7278781821", | ||
strip_prefix = "protobuf-3.11.2", | ||
urls = [ | ||
"https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protobuf-all-3.11.2.tar.gz", | ||
], | ||
) | ||
|
||
# OTLP Protocol definition | ||
maybe( | ||
native.new_local_repository, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems coming from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's the difference between something that HAS a bazel-build already, or one where we're adapting it to be a BAZEL workspace. OTLP does NOT have a bazel build, so we're provding our own build file. |
||
name = "com_github_opentelemetry_proto", | ||
build_file = "//bazel:opentelemetry_proto.BUILD", | ||
path = "third_party/opentelemetry-proto", | ||
) | ||
|
||
# JSON library | ||
maybe( | ||
http_archive, | ||
name = "github_nlohmann_json", | ||
build_file = "//bazel:nlohmann_json.BUILD", | ||
sha256 = "69cc88207ce91347ea530b227ff0776db82dcb8de6704e1a3d74f4841bc651cf", | ||
urls = [ | ||
"https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip", | ||
], | ||
) | ||
|
||
# C++ Prometheus Client library. | ||
maybe( | ||
native.local_repository, | ||
name = "com_github_jupp0r_prometheus_cpp", | ||
path = "third_party/prometheus-cpp", | ||
) | ||
|
||
# libcurl (optional) | ||
maybe( | ||
http_archive, | ||
name = "curl", | ||
build_file = "@//bazel:curl.BUILD", | ||
sha256 = "ba98332752257b47b9dea6d8c0ad25ec1745c20424f1dd3ff2c99ab59e97cf91", | ||
strip_prefix = "curl-7.73.0", | ||
urls = ["https://curl.haxx.se/download/curl-7.73.0.tar.gz"], | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on these changes. The root
WORKSPACE
looks much cleaner now : )