Skip to content

Commit

Permalink
Split dll_deps into windows and non-windows (to ignore projects like …
Browse files Browse the repository at this point in the history
…etw on non-windows). Upgrade to latest modules
  • Loading branch information
malkia committed Jun 26, 2024
1 parent d4343d0 commit a65c1f2
Show file tree
Hide file tree
Showing 6 changed files with 1,936 additions and 2,272 deletions.
45 changes: 29 additions & 16 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ cc_library(
}),
deps = [
"//exporters/elasticsearch:es_log_record_exporter",
"//exporters/etw:etw_exporter",
"//exporters/memory:in_memory_span_exporter",
"//exporters/ostream:ostream_log_record_exporter",
"//exporters/ostream:ostream_metric_exporter",
Expand All @@ -79,8 +78,14 @@ cc_library(
"//exporters/otlp:otlp_file_log_record_exporter",
"//exporters/otlp:otlp_file_metric_exporter",
"//exporters/prometheus:prometheus_exporter",
"//exporters/prometheus:prometheus_push_exporter",
"//exporters/zipkin:zipkin_exporter",
],
] + select({
"@platforms//os:windows": [
"//exporters/etw:etw_exporter",
],
"//conditions:default": [],
}),
)

# Expands to all transitive project dependencies, excluding external projects (repos)
Expand Down Expand Up @@ -211,15 +216,19 @@ alias(
deps = [
"//api:headers",
"//exporters/elasticsearch:headers",
"//exporters/etw:headers",
"//exporters/memory:headers",
"//exporters/ostream:headers",
"//exporters/otlp:headers",
"//exporters/prometheus:headers",
"//exporters/zipkin:headers",
"//ext:headers",
"//sdk:headers",
],
] + select({
"@platforms//os:windows": [
"//exporters/etw:headers",
],
"//conditions:default": [],
}),
) for otel_sdk_binary in [
"otel_sdk_r",
"otel_sdk_d",
Expand Down Expand Up @@ -247,15 +256,19 @@ pkg_files(
srcs = [
"//api:header_files",
"//exporters/elasticsearch:header_files",
"//exporters/etw:header_files",
"//exporters/memory:header_files",
"//exporters/ostream:header_files",
"//exporters/otlp:header_files",
"//exporters/prometheus:header_files",
"//exporters/zipkin:header_files",
"//ext:header_files",
"//sdk:header_files",
],
] + select({
"@platforms//os:windows": [
"//exporters/etw:header_files",
],
"//conditions:default": [],
}),
prefix = otel_sdk_prefix, # + "include",
strip_prefix = pkg_strip_prefix.from_pkg(),
)
Expand Down Expand Up @@ -395,21 +408,21 @@ cc_binary(
deps = ["@bazel_tools//tools/cpp/runfiles"],
)

run_binary(
name = "dll_deps_update_run",
[run_binary(
name = "dll_deps_update_run_" + os,
srcs = [":otel_sdk_all_project_deps"],
outs = ["dll_deps_generated_internally.bzl"],
args = ["$(location dll_deps_generated_internally.bzl)"],
outs = ["dll_deps_generated_internally_" + os + ".bzl"],
args = ["$(location dll_deps_generated_internally_" + os + ".bzl)"],
tool = "dll_deps_update_binary",
)
) for os in ["non_windows", "windows"]]

# To update the dll_deps_generated.bzl files, do this:
# bazel run dll_deps_update
write_source_file(
name = "dll_deps_update",
in_file = "dll_deps_generated_internally.bzl",
out_file = "dll_deps_generated.bzl",
)
[write_source_file(
name = "dll_deps_update_" + os,
in_file = "dll_deps_generated_internally_" + os + ".bzl",
out_file = "dll_deps_generated_" + os + ".bzl",
) for os in ["non_windows", "windows"]]

platform(
name = "x64_windows-clang-cl",
Expand Down
19 changes: 8 additions & 11 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module(

bazel_dep(name = "curl", version = "8.7.1")
bazel_dep(name = "abseil-cpp", version = "20240116.2", repo_name = "com_google_absl")
bazel_dep(name = "aspect_bazel_lib", version = "2.7.7")
bazel_dep(name = "aspect_bazel_lib", version = "2.7.8")

bazel_dep(name = "rules_pkg", version = "0.10.1", dev_dependency = True)

Expand All @@ -27,16 +27,13 @@ single_version_override(
)

bazel_dep(name = "opentelemetry-proto", version = "1.3.1")
bazel_dep(name = "prometheus-cpp", version = "1.2.4")
#single_version_override(
#module_name = "prometheus-cpp",
#version = "1.2.4",
#patch_strip = 1,
#patches = [
#"bazel/prometheus_cpp_curl_bzlmod.patch",
#"bazel/prometheus_cpp_rm_bzlmod_lock.patch",
#],
#)
bazel_dep(name = "prometheus-cpp", version = "1.3.0")
archive_override(
module_name = "prometheus-cpp",
strip_prefix = "prometheus-cpp-6492e820cdff7e7345d46d82b43735aaea542098",
integrity = "sha256-uElFYvmIrzXsElYbbrNS0Mvtfj99aKae2nhsZhCvxG4=",
urls = "https://github.com/jupp0r/prometheus-cpp/archive/6492e820cdff7e7345d46d82b43735aaea542098.zip",
)

bazel_dep(name = "boringssl", version = "0.0.0-20240530-2db0eb3")
bazel_dep(name = "zlib", version = "1.3.1.bcr.1")
Expand Down
Loading

0 comments on commit a65c1f2

Please sign in to comment.