Skip to content

Commit 4a6ae3e

Browse files
rjogradycopybara-github
authored andcommitted
Update grpc to most recent version, 1.74.
This has the effect of needing to update its various dependencies accordingly. Add 2 more patches to ScaNN to account for the changes in absl (endian library is now visibility-restricted) and protobuf libraries (py_proto_library build rule has changed). PiperOrigin-RevId: 788913911 Change-Id: I0fc8e72e37554a4e1beb41ee0566d4ae436c548c
1 parent 6f530dd commit 4a6ae3e

File tree

3 files changed

+122
-7
lines changed

3 files changed

+122
-7
lines changed

MODULE.bazel

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ module(name = "com_google_fleetbench")
1616

1717
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1818

19-
bazel_dep(name = "protoc-gen-validate", version = "1.0.4.bcr.2")
20-
bazel_dep(name = "protobuf", version = "29.1", repo_name = "com_google_protobuf")
21-
bazel_dep(name = "platforms", version = "0.0.10")
22-
bazel_dep(name = "rules_python", version = "0.40.0")
23-
bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2", repo_name = "com_google_absl")
19+
bazel_dep(name = "protoc-gen-validate", version = "1.2.1.bcr.1")
20+
bazel_dep(name = "protobuf", version = "31.1", repo_name = "com_google_protobuf")
21+
bazel_dep(name = "platforms", version = "0.0.11")
22+
bazel_dep(name = "rules_python", version = "1.0.0")
23+
bazel_dep(name = "abseil-cpp", version = "20250512.1", repo_name = "com_google_absl")
2424
bazel_dep(name = "bazel_skylib", version = "1.7.1")
2525
bazel_dep(name = "abseil-py", version = "2.1.0", repo_name = "com_google_absl_py")
26-
bazel_dep(name = "googletest", version = "1.15.2", repo_name = "com_google_googletest")
26+
bazel_dep(name = "googletest", version = "1.17.0", repo_name = "com_google_googletest")
2727
bazel_dep(name = "google_benchmark", version = "1.8.5", repo_name = "com_google_benchmark")
2828
bazel_dep(name = "tcmalloc", version = "0.0.0-20240411-5ed309d", repo_name = "com_google_tcmalloc")
2929
bazel_dep(name = "brotli", version = "1.1.0")
3030
bazel_dep(name = "snappy", version = "1.2.1")
3131
bazel_dep(name = "highway", version = "1.2.0", repo_name = "com_google_highway")
32-
bazel_dep(name = "grpc", version = "1.68.0", repo_name = "com_github_grpc_grpc")
32+
bazel_dep(name = "grpc", version = "1.74.0", repo_name = "com_github_grpc_grpc")
3333
bazel_dep(name = "libpfm", version = "4.11.0")
3434

3535
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
@@ -103,6 +103,8 @@ http_archive(
103103
"//fleetbench/patches:0001-Remove-more_deps-argument.patch",
104104
"//fleetbench/patches:0002-Replace-gtest_main-with-gtest.patch",
105105
"//fleetbench/patches:0003-Replace-non-standard-uint32-with-uint32_t.patch",
106+
"//fleetbench/patches:0004-Remove-dependency-on-absl-endian.patch",
107+
"//fleetbench/patches:0005-Update-path-to-py_proto_library.patch",
106108
],
107109
strip_prefix = "google-research-084accd3286a43da7f43b4a1bf0bba7fddd90527/scann",
108110
urls = ["https://github.com/google-research/google-research/archive/084accd3286a43da7f43b4a1bf0bba7fddd90527.zip"],
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
From 330fa95cc9ab3edd7cec4709a7199f634a6cb48c Mon Sep 17 00:00:00 2001
2+
From: Richard O'Grady <[email protected]>
3+
Date: Tue, 29 Jul 2025 10:40:16 -0700
4+
Subject: Remove dependency on absl/endian.
5+
6+
absl/endian has internal-only visibility, so use native headers
7+
instead.
8+
---
9+
scann/scann/oss_wrappers/BUILD.bazel | 1 -
10+
scann/scann/oss_wrappers/scann_serialize.cc | 9 ++++-----
11+
2 files changed, 4 insertions(+), 6 deletions(-)
12+
13+
diff --git a/scann/scann/oss_wrappers/BUILD.bazel b/scann/scann/oss_wrappers/BUILD.bazel
14+
index 3ced2b0f5..0e9cd1b12 100644
15+
--- a/scann/scann/oss_wrappers/BUILD.bazel
16+
+++ b/scann/scann/oss_wrappers/BUILD.bazel
17+
@@ -88,7 +88,6 @@ cc_library(
18+
hdrs = ["scann_serialize.h"],
19+
deps = [
20+
"@com_google_absl//absl/base",
21+
- "@com_google_absl//absl/base:endian",
22+
"@com_google_absl//absl/strings",
23+
],
24+
)
25+
diff --git a/scann/scann/oss_wrappers/scann_serialize.cc b/scann/scann/oss_wrappers/scann_serialize.cc
26+
index 0a63c7a36..35d5157f8 100644
27+
--- a/scann/scann/oss_wrappers/scann_serialize.cc
28+
+++ b/scann/scann/oss_wrappers/scann_serialize.cc
29+
@@ -18,7 +18,7 @@
30+
#include <string>
31+
32+
#include "absl/base/casts.h"
33+
-#include "absl/base/internal/endian.h"
34+
+#include <endian.h>
35+
#include "absl/strings/string_view.h"
36+
37+
namespace research_scann {
38+
@@ -60,19 +59,19 @@ inline std::string Uint64ToKey(uint64_t u64) {
39+
}
40+
41+
inline void KeyFromUint32(uint32_t u32, std::string* key) {
42+
- uint32_t norder = absl::ghtonl(u32);
43+
+ uint32_t norder = htobe32(u32);
44+
key->assign(reinterpret_cast<const char*>(&norder), sizeof(norder));
45+
}
46+
47+
inline void KeyFromUint64(uint64_t u64, std::string* key) {
48+
- uint64_t norder = absl::ghtonll(u64);
49+
+ uint64_t norder = htobe64(u64);
50+
key->assign(reinterpret_cast<const char*>(&norder), sizeof(norder));
51+
}
52+
53+
inline uint32_t KeyToUint32(absl::string_view key) {
54+
uint32_t value;
55+
memcpy(&value, key.data(), sizeof(value));
56+
- return absl::gntohl(value);
57+
+ return be32toh(value);
58+
}
59+
60+
int32_t KeyToInt32(absl::string_view key) { return KeyToUint32(key); }
61+
@@ -80,7 +79,7 @@ int32_t KeyToInt32(absl::string_view key) { return KeyToUint32(key); }
62+
inline uint64_t KeyToUint64(absl::string_view key) {
63+
uint64_t value;
64+
memcpy(&value, key.data(), sizeof(value));
65+
- return absl::gntohll(value);
66+
+ return be64toh(value);
67+
}
68+
69+
void KeyFromFloat(float x, std::string* key) {
70+
--
71+
2.50.1.552.g942d659e1b-goog
72+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 1f3b442a5f19f6a861de0df57c75c9aa0c064a3c Mon Sep 17 00:00:00 2001
2+
From: Richard O'Grady <[email protected]>
3+
Date: Tue, 29 Jul 2025 10:49:01 -0700
4+
Subject: Update path to py_proto_library
5+
6+
The py_proto_library in protobuf moved to a bazel/ directory.
7+
Adjust scann_py_proto_library wrapper for changes to the upstream build
8+
rule.
9+
---
10+
scann/scann/oss_wrappers/build_defs.bzl | 8 ++------
11+
1 file changed, 2 insertions(+), 6 deletions(-)
12+
13+
diff --git a/scann/scann/oss_wrappers/build_defs.bzl b/scann/scann/oss_wrappers/build_defs.bzl
14+
index 5259dd160..825e913df 100644
15+
--- a/scann/scann/oss_wrappers/build_defs.bzl
16+
+++ b/scann/scann/oss_wrappers/build_defs.bzl
17+
@@ -1,6 +1,6 @@
18+
""".bzl file for ScaNN open source build configs."""
19+
20+
-load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
21+
+load("@com_google_protobuf//bazel:py_proto_library.bzl", "py_proto_library")
22+
23+
def scann_py_proto_library(
24+
name,
25+
@@ -18,12 +18,8 @@ def scann_py_proto_library(
26+
proto_deps: a list of dependency labels for internal use.
27+
**kwargs: other keyword arguments that are passed to py_proto_library.
28+
"""
29+
- _ignore = [proto_deps] # buildifier: disable=unused-variable
30+
py_proto_library(
31+
name = name,
32+
- srcs = srcs,
33+
- deps = py_proto_deps,
34+
- default_runtime = "@com_google_protobuf//:protobuf_python",
35+
- protoc = "@com_google_protobuf//:protoc",
36+
+ deps = proto_deps,
37+
**kwargs
38+
)
39+
--
40+
2.50.1.552.g942d659e1b-goog
41+

0 commit comments

Comments
 (0)