Files
tensorflow--tensorflow/third_party/grpc.patch
T
wehub-resource-sync 8a852e4b4e
cffconvert / validate (push) Has been skipped
License Check / license-check (push) Failing after 2s
chore: import upstream snapshot with attribution
2026-07-13 12:14:16 +08:00

129 lines
4.5 KiB
Diff

diff --git a/bazel/cc_grpc_library.bzl b/bazel/cc_grpc_library.bzl
--- a/bazel/cc_grpc_library.bzl
+++ b/bazel/cc_grpc_library.bzl
@@ -28,6 +28,7 @@ def cc_grpc_library(
allow_deprecated = False,
use_external = False, # @unused
grpc_only = False,
+ plugin_flags = [],
**kwargs):
"""Generates C++ grpc classes for services defined in a proto file.
@@ -109,6 +110,7 @@ def cc_grpc_library(
well_known_protos = well_known_protos,
generate_mocks = generate_mocks,
allow_deprecated = allow_deprecated,
+ flags = plugin_flags,
**kwargs
)
diff --git a/src/core/lib/promise/party.h b/src/core/lib/promise/party.h
--- a/src/core/lib/promise/party.h
+++ b/src/core/lib/promise/party.h
@@ -21,6 +21,7 @@
#include <stdint.h>
#include <atomic>
+#include <cinttypes>
#include <limits>
#include <string>
#include <utility>
@@ -685,7 +686,7 @@ class Party : public Activity, private Wakeable {
DebugLocation loc = {}) {
GRPC_TRACE_LOG(party_state, INFO).AtLocation(loc.file(), loc.line())
<< this << " " << op << " "
- << absl::StrFormat("%016" PRIx64 " -> %016" PRIx64, prev_state,
+ << absl::StrFormat("%016lx -> %016lx", prev_state,
new_state);
}
diff --git a/src/python/grpcio/grpc/BUILD.bazel b/src/python/grpcio/grpc/BUILD.bazel
--- a/src/python/grpcio/grpc/BUILD.bazel
+++ b/src/python/grpcio/grpc/BUILD.bazel
@@ -104,9 +104,9 @@ py_library(
py_library(
name = "grpcio",
srcs = ["__init__.py"],
- data = [
- "//:grpc",
- ],
+# data = [
+# "//:grpc",
+# ],
imports = ["../"],
deps = [
":_observability",
diff --git a/MODULE.bazel b/MODULE.bazel
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -60,7 +60,7 @@ bazel_dep(name = "rules_shell", version = "0.4.0", dev_dependency = True)
# Python dependencies
# ===================
-bazel_dep(name = "rules_python", version = "1.5.4")
+bazel_dep(name = "rules_python", version = "1.6.3")
PYTHON_VERSIONS = [
"3.9",
@@ -68,7 +68,7 @@ PYTHON_VERSIONS = [
"3.11",
"3.12",
"3.13",
- "3.14.0b2",
+ "3.14",
]
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
diff --git a/bazel/cython_library.bzl b/bazel/cython_library.bzl
--- a/bazel/cython_library.bzl
+++ b/bazel/cython_library.bzl
@@ -69,5 +69,6 @@ def pyx_library(name, deps = [], py_deps
shared_objects = []
defines = kwargs.pop("defines", [])
+ copts = kwargs.pop("copts", [])
for src in pyx_srcs:
stem = src.split(".")[0]
@@ -81,9 +81,16 @@ def pyx_library(name, deps = [], py_deps
defines = defines,
+ copts = copts,
+ features = kwargs.get("features", []),
linkshared = 1,
- linkopts = select({
- # The "-undefined dynamic_lookup" flag allows the shared library to use symbols
- # that are not defined at link time but will be resolved at runtime.
- # This is necessary for Python extensions on macOS to access Python C API symbols.
- "@platforms//os:macos": ["-undefined", "dynamic_lookup"],
- "//conditions:default": [],
- }),
+ linkopts = select({
+ # The "-undefined dynamic_lookup" flag allows the shared library to use symbols
+ # that are not defined at link time but will be resolved at runtime.
+ # This is necessary for Python extensions on macOS to access Python C API symbols.
+ "@platforms//os:macos": ["-undefined", "dynamic_lookup"],
+ "@platforms//os:windows": [
+ "/NODEFAULTLIB:python3.lib",
+ "/OPT:REF",
+ "/OPT:ICF",
+ ],
+ "//conditions:default": [],
+ }),
)
shared_objects.append(shared_object_name)
diff --git a/src/python/grpcio/grpc/_cython/BUILD.bazel b/src/python/grpcio/grpc/_cython/BUILD.bazel
--- a/src/python/grpcio/grpc/_cython/BUILD.bazel
+++ b/src/python/grpcio/grpc/_cython/BUILD.bazel
@@ -35,1 +35,10 @@
defines = ["GRPC_PYTHON_BUILD=1"],
+ # -Wno-unused-result is needed because Cython generated code triggers unused result warnings.
+ copts = select({
+ "@platforms//os:windows": [],
+ "//conditions:default": ["-Wno-unused-result"],
+ }),
+ features = select({
+ "@platforms//os:windows": ["-layering_check", "force_no_whole_archive"],
+ "//conditions:default": ["-layering_check"],
+ }),