Skip to content

Commit 41a7c50

Browse files
malkiagjasny
authored andcommitted
Remove duplicate, but unused downloads of googletest/benchmark, zlib and boringssl. This was due to function reused for both legacy repo download, and exposed as new bzlmod one. When it was used in the second case, these were pulled like: _main~data_deps_ext~zlib (and similar for the rest). The reduction is visible in the MODULE.bazel.lock file
1 parent 5295636 commit 41a7c50

File tree

2 files changed

+28
-76
lines changed

2 files changed

+28
-76
lines changed

MODULE.bazel.lock

Lines changed: 1 addition & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/repositories.bzl

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
22
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
33

4-
def prometheus_cpp_repositories():
4+
def _legacy_and_bzlmod_repositories():
55
maybe(
66
http_archive,
77
name = "civetweb",
@@ -13,16 +13,6 @@ def prometheus_cpp_repositories():
1313
build_file = "@com_github_jupp0r_prometheus_cpp//bazel:civetweb.BUILD",
1414
)
1515

16-
maybe(
17-
http_archive,
18-
name = "com_google_googletest",
19-
sha256 = "81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2",
20-
strip_prefix = "googletest-release-1.12.1",
21-
urls = [
22-
"https://github.com/google/googletest/archive/release-1.12.1.tar.gz",
23-
],
24-
)
25-
2616
maybe(
2717
http_archive,
2818
name = "com_github_curl",
@@ -35,27 +25,28 @@ def prometheus_cpp_repositories():
3525
build_file = "@com_github_jupp0r_prometheus_cpp//bazel:curl.BUILD",
3626
)
3727

28+
def prometheus_cpp_repositories():
29+
_legacy_and_bzlmod_repositories()
30+
31+
# These legacy style repos have bzlmod support, they are re-added here for legacy support
3832
maybe(
3933
http_archive,
40-
name = "com_github_google_benchmark",
41-
sha256 = "6bc180a57d23d4d9515519f92b0c83d61b05b5bab188961f36ac7b06b0d9e9ce",
42-
strip_prefix = "benchmark-1.8.3",
34+
name = "com_google_googletest",
35+
sha256 = "81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2",
36+
strip_prefix = "googletest-release-1.12.1",
4337
urls = [
44-
"https://github.com/google/benchmark/archive/v1.8.3.tar.gz",
38+
"https://github.com/google/googletest/archive/release-1.12.1.tar.gz",
4539
],
4640
)
4741

4842
maybe(
4943
http_archive,
50-
name = "zlib",
51-
sha256 = "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30",
52-
strip_prefix = "zlib-1.2.13",
44+
name = "com_github_google_benchmark",
45+
sha256 = "6bc180a57d23d4d9515519f92b0c83d61b05b5bab188961f36ac7b06b0d9e9ce",
46+
strip_prefix = "benchmark-1.8.3",
5347
urls = [
54-
"https://mirror.bazel.build/zlib.net/zlib-1.2.13.tar.gz",
55-
"https://zlib.net/zlib-1.2.13.tar.gz",
56-
"https://storage.googleapis.com/bazel-mirror/zlib.net/zlib-1.2.13.tar.gz",
48+
"https://github.com/google/benchmark/archive/v1.8.3.tar.gz",
5749
],
58-
build_file = "@com_github_jupp0r_prometheus_cpp//bazel:zlib.BUILD",
5950
)
6051

6152
maybe(
@@ -71,8 +62,21 @@ def prometheus_cpp_repositories():
7162
],
7263
)
7364

65+
maybe(
66+
http_archive,
67+
name = "zlib",
68+
sha256 = "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30",
69+
strip_prefix = "zlib-1.2.13",
70+
urls = [
71+
"https://mirror.bazel.build/zlib.net/zlib-1.2.13.tar.gz",
72+
"https://zlib.net/zlib-1.2.13.tar.gz",
73+
"https://storage.googleapis.com/bazel-mirror/zlib.net/zlib-1.2.13.tar.gz",
74+
],
75+
build_file = "@com_github_jupp0r_prometheus_cpp//bazel:zlib.BUILD",
76+
)
77+
7478
def _data_deps_extension_impl(ctx):
75-
prometheus_cpp_repositories()
79+
_legacy_and_bzlmod_repositories()
7680

7781
data_deps_ext = module_extension(
7882
implementation = _data_deps_extension_impl,

0 commit comments

Comments
 (0)