Skip to content

Commit 69be018

Browse files
committed
grpcio: Add patches for versions 1.80.0, 1.81.0, 1.81.1, 1.82.2, 1.83.0, 1.83.1
Trigger: grpcio:1.80.0 Trigger: grpcio:1.81.0 Trigger: grpcio:1.81.1 Trigger: grpcio:1.82.2 Trigger: grpcio:1.83.0 Trigger: grpcio:1.83.1
1 parent b36ab70 commit 69be018

33 files changed

Lines changed: 2516 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From 67901366eea10b98c29dc57a72c796ec786a210e Mon Sep 17 00:00:00 2001
2+
From: Trevor Gamblin <tgamblin@baylibre.com>
3+
Date: Thu, 13 Aug 2026 13:31:27 -0400
4+
Subject: [PATCH] don't build grpcio in install_all_python_modules.sh
5+
6+
We run this script in CIBW_TEST_COMMAND to install grpcio's other Python
7+
packages and their test dependencies, but we don't want it to reinstall
8+
grpcio itself from source - we want the test environment to use the
9+
wheel built (and about to be distributed) in this same cibuildwheel
10+
invocation.
11+
12+
This is a rework of the older patches from Mark to handle upstream's
13+
change to using pyproject.toml instead of setup.py.
14+
15+
Upstream-Status: Inappropriate [upstream tests in a different way]
16+
17+
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
18+
---
19+
tools/distrib/install_all_python_modules.sh | 2 +-
20+
1 file changed, 1 insertion(+), 1 deletion(-)
21+
22+
diff --git a/tools/distrib/install_all_python_modules.sh b/tools/distrib/install_all_python_modules.sh
23+
index 5652580c76..acab4f9d6f 100755
24+
--- a/tools/distrib/install_all_python_modules.sh
25+
+++ b/tools/distrib/install_all_python_modules.sh
26+
@@ -30,7 +30,7 @@ function maybe_run_command () {
27+
}
28+
29+
python3 -m pip install --upgrade "cython==3.1.1";
30+
-python3 -m pip install .;
31+
+#python3 -m pip install .;
32+
33+
# Build and install grpcio_tools
34+
pushd tools/distrib/python/grpcio_tools;
35+
--
36+
2.55.0
37+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From 052eae2d33743cf67847521309c0201dc0bee9aa Mon Sep 17 00:00:00 2001
2+
From: Trevor Gamblin <tgamblin@baylibre.com>
3+
Date: Wed, 19 Aug 2026 12:59:15 -0400
4+
Subject: [PATCH] grpcio_tests: anchor GatherProto's proto paths to GRPC_STEM
5+
6+
commands.py's GRPC_PROTO_STEM/PROTO_STEM/PYTHON_PROTO_TOP_LEVEL were made
7+
cwd-relative by the pyproject.toml migration (#40833), which is fine for
8+
the new PEP517 build path (BuildPackageProtos), but breaks the legacy
9+
"preprocess" command (GatherProto) used by
10+
tools/distrib/install_all_python_modules.sh. That script pushd's into
11+
src/python/grpcio_tests before invoking `setup.py preprocess`, so the
12+
relative path "src/proto" no longer resolves:
13+
14+
running preprocess
15+
error: [Errno 2] No such file or directory: 'src/proto'
16+
17+
Upstream-Status: To upstream
18+
19+
AI-Generated: Uses Claude Sonnet 5
20+
21+
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
22+
---
23+
src/python/grpcio_tests/commands.py | 6 +++---
24+
1 file changed, 3 insertions(+), 3 deletions(-)
25+
26+
diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py
27+
index 997bd2a906..d3bbd0f733 100644
28+
--- a/src/python/grpcio_tests/commands.py
29+
+++ b/src/python/grpcio_tests/commands.py
30+
@@ -32,9 +32,9 @@ from setuptools.command import test
31+
PYTHON_STEM = os.path.dirname(os.path.abspath(__file__))
32+
GRPC_STEM = os.path.abspath(PYTHON_STEM + "../../../../")
33+
PYTHON_REL_PATH = os.path.relpath(PYTHON_STEM, start=GRPC_STEM)
34+
-GRPC_PROTO_STEM = os.path.join("src", "proto")
35+
-PROTO_STEM = os.path.join(PYTHON_REL_PATH, "src", "proto")
36+
-PYTHON_PROTO_TOP_LEVEL = os.path.join(PYTHON_REL_PATH, "src")
37+
+GRPC_PROTO_STEM = os.path.join(GRPC_STEM, "src", "proto")
38+
+PROTO_STEM = os.path.join(GRPC_STEM, PYTHON_REL_PATH, "src", "proto")
39+
+PYTHON_PROTO_TOP_LEVEL = os.path.join(GRPC_STEM, PYTHON_REL_PATH, "src")
40+
41+
42+
class CommandError(object):
43+
--
44+
2.55.0
45+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
From 3b1b82e17e21b4b6b59c6240fb233b2f2f0175ea Mon Sep 17 00:00:00 2001
2+
From: Mark Ryan <markdryan@rivosinc.com>
3+
Date: Mon, 3 Nov 2025 09:27:22 +0000
4+
Subject: [PATCH 2/2] Skip test_sunny_day
5+
6+
The test
7+
8+
tests.unit._dynamic_stubs_test.DynamicStubTest.test_sunny_day
9+
10+
seems to be hanging on the riscv64 builders.
11+
12+
Use the nuclear option and strip the test out entirely to ensure no
13+
strange import interactions happen.
14+
15+
Upstream-Status: To upstream [ Further investigation needed ]
16+
17+
Signed-off-by: Mark Ryan <markdryan@rivosinc.com>
18+
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
19+
---
20+
src/python/grpcio_tests/tests/tests.json | 1 -
21+
.../tests/unit/_dynamic_stubs_test.py | 18 ------------------
22+
2 files changed, 19 deletions(-)
23+
24+
diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json
25+
index 86b359e2d2..8ab1ead2c2 100644
26+
--- a/src/python/grpcio_tests/tests/tests.json
27+
+++ b/src/python/grpcio_tests/tests/tests.json
28+
@@ -60,7 +60,6 @@
29+
"tests.unit._cython.cygrpc_test.SecureServerSecureClient",
30+
"tests.unit._cython.cygrpc_test.TypeSmokeTest",
31+
"tests.unit._dns_resolver_test.DNSResolverTest",
32+
- "tests.unit._dynamic_stubs_test.DynamicStubTest",
33+
"tests.unit._empty_message_test.EmptyMessageTest",
34+
"tests.unit._error_message_encoding_test.ErrorMessageEncodingTest",
35+
"tests.unit._exit_test.ExitTest",
36+
diff --git a/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py b/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py
37+
index 98bdb19a2f..108db35ea3 100644
38+
--- a/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py
39+
+++ b/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py
40+
@@ -136,24 +136,6 @@ def _test_grpc_tools_unimportable():
41+
_assert_unimplemented("grpcio-tools")
42+
43+
44+
-# NOTE(rbellevi): multiprocessing.Process fails to pickle function objects
45+
-# when they do not come from the "__main__" module, so this test passes
46+
-# if run directly on Windows or MacOS, but not if started by the test runner.
47+
-@unittest.skipIf(
48+
- os.name == "nt" or "darwin" in sys.platform,
49+
- "Windows and MacOS multiprocessing unsupported",
50+
-)
51+
-class DynamicStubTest(unittest.TestCase):
52+
- def test_sunny_day(self):
53+
- _run_in_subprocess(_test_sunny_day)
54+
-
55+
- def test_well_known_types(self):
56+
- _run_in_subprocess(_test_well_known_types)
57+
-
58+
- def test_grpc_tools_unimportable(self):
59+
- _run_in_subprocess(_test_grpc_tools_unimportable)
60+
-
61+
-
62+
if __name__ == "__main__":
63+
logging.basicConfig()
64+
unittest.main(verbosity=2)
65+
--
66+
2.34.1
67+
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
From: RISE python-wheels <noreply@riseproject.dev>
2+
Subject: [PATCH] fix per-package command cwd-relative path regression from #40833
3+
4+
Same regression as the grpcio_tests/commands.py GatherProto fix
5+
(0003-fix-GatherProto-cwd-relative-path-regression.patch): the
6+
pyproject.toml migration (#40833) made these per-package "preprocess"/
7+
"build_package_protos" setuptools Command classes cwd-relative instead
8+
of anchored to GRPC_ROOT_ABS_PATH/ROOT_DIR (both already computed
9+
absolute in each file). install_all_python_modules.sh pushd's into each
10+
package's own directory before running these commands, so the relative
11+
paths ("src/proto/...", "./LICENSE", ROOT_REL_DIR) don't resolve there -
12+
symptoms range from a silently-skipped proto copy to
13+
grpc_tools.command.build_package_protos() finding zero .proto files and
14+
silently emitting no *_pb2.py, e.g.:
15+
16+
ImportError: cannot import name 'health_pb2' from 'grpc_health.v1'
17+
18+
Fixes the same way as 0003: revert each file's constants/run() bodies to
19+
use the already-computed absolute ROOT_DIR/GRPC_ROOT_ABS_PATH instead of
20+
the relative ROOT_REL_DIR, matching pre-#40833 behavior. Affects every
21+
per-package command module install_all_python_modules.sh's PACKAGES loop
22+
touches that generates protos or copies LICENSE: grpcio_channelz,
23+
grpcio_health_checking, grpcio_reflection, grpcio_status, grpcio_testing.
24+
(grpcio_tests/commands.py is 0003; grpcio/commands.py and grpcio_csds/
25+
grpcio_admin/grpcio_csm_observability are unaffected - the former is
26+
invoked from repo root, the latter three carry no such module.)
27+
28+
Upstream-Status: To upstream
29+
30+
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
31+
---
32+
diff --git a/src/python/grpcio_channelz/channelz_commands.py b/src/python/grpcio_channelz/channelz_commands.py
33+
index 3a1cc26..8c2cae5 100644
34+
--- a/src/python/grpcio_channelz/channelz_commands.py
35+
+++ b/src/python/grpcio_channelz/channelz_commands.py
36+
@@ -20,9 +20,10 @@ import setuptools
37+
38+
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
39+
GRPC_ROOT_ABS_PATH = os.path.join(ROOT_DIR, "../../..")
40+
-ROOT_REL_DIR = os.path.relpath(ROOT_DIR, start=GRPC_ROOT_ABS_PATH)
41+
-CHANNELZ_PROTO = "src/proto/grpc/channelz/channelz.proto"
42+
-LICENSE = "./LICENSE"
43+
+CHANNELZ_PROTO = os.path.join(
44+
+ GRPC_ROOT_ABS_PATH, "src/proto/grpc/channelz/channelz.proto"
45+
+)
46+
+LICENSE = os.path.join(GRPC_ROOT_ABS_PATH, "LICENSE")
47+
48+
49+
class Preprocess(setuptools.Command):
50+
@@ -43,10 +44,10 @@ class Preprocess(setuptools.Command):
51+
if os.path.isfile(CHANNELZ_PROTO):
52+
shutil.copyfile(
53+
CHANNELZ_PROTO,
54+
- os.path.join(ROOT_REL_DIR, "grpc_channelz/v1/channelz.proto"),
55+
+ os.path.join(ROOT_DIR, "grpc_channelz/v1/channelz.proto"),
56+
)
57+
if os.path.isfile(LICENSE):
58+
- shutil.copyfile(LICENSE, os.path.join(ROOT_REL_DIR, "LICENSE"))
59+
+ shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, "LICENSE"))
60+
61+
62+
class BuildPackageProtos(setuptools.Command):
63+
@@ -65,4 +66,4 @@ class BuildPackageProtos(setuptools.Command):
64+
from grpc_tools import command
65+
66+
# find and build all protos in the current package
67+
- command.build_package_protos(ROOT_REL_DIR, strict_mode=True)
68+
+ command.build_package_protos(ROOT_DIR, strict_mode=True)
69+
diff --git a/src/python/grpcio_health_checking/health_commands.py b/src/python/grpcio_health_checking/health_commands.py
70+
index 6b90962..d8a7bc9 100644
71+
--- a/src/python/grpcio_health_checking/health_commands.py
72+
+++ b/src/python/grpcio_health_checking/health_commands.py
73+
@@ -20,9 +20,10 @@ import setuptools
74+
75+
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
76+
GRPC_ROOT_ABS_PATH = os.path.join(ROOT_DIR, "../../..")
77+
-ROOT_REL_DIR = os.path.relpath(ROOT_DIR, start=GRPC_ROOT_ABS_PATH)
78+
-HEALTH_PROTO = "src/proto/grpc/health/v1/health.proto"
79+
-LICENSE = "./LICENSE"
80+
+HEALTH_PROTO = os.path.join(
81+
+ GRPC_ROOT_ABS_PATH, "src/proto/grpc/health/v1/health.proto"
82+
+)
83+
+LICENSE = os.path.join(GRPC_ROOT_ABS_PATH, "LICENSE")
84+
85+
86+
class Preprocess(setuptools.Command):
87+
@@ -43,10 +44,10 @@ class Preprocess(setuptools.Command):
88+
if os.path.isfile(HEALTH_PROTO):
89+
shutil.copyfile(
90+
HEALTH_PROTO,
91+
- os.path.join(ROOT_REL_DIR, "grpc_health/v1/health.proto"),
92+
+ os.path.join(ROOT_DIR, "grpc_health/v1/health.proto"),
93+
)
94+
if os.path.isfile(LICENSE):
95+
- shutil.copyfile(LICENSE, os.path.join(ROOT_REL_DIR, "LICENSE"))
96+
+ shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, "LICENSE"))
97+
98+
99+
class BuildPackageProtos(setuptools.Command):
100+
@@ -65,4 +66,4 @@ class BuildPackageProtos(setuptools.Command):
101+
from grpc_tools import command
102+
103+
# find and build all protos in the current package
104+
- command.build_package_protos(ROOT_REL_DIR, strict_mode=True)
105+
+ command.build_package_protos(ROOT_DIR, strict_mode=True)
106+
diff --git a/src/python/grpcio_reflection/reflection_commands.py b/src/python/grpcio_reflection/reflection_commands.py
107+
index 49cd4c4..af443b8 100644
108+
--- a/src/python/grpcio_reflection/reflection_commands.py
109+
+++ b/src/python/grpcio_reflection/reflection_commands.py
110+
@@ -20,9 +20,10 @@ import setuptools
111+
112+
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
113+
GRPC_ROOT_ABS_PATH = os.path.join(ROOT_DIR, "../../..")
114+
-ROOT_REL_DIR = os.path.relpath(ROOT_DIR, start=GRPC_ROOT_ABS_PATH)
115+
-REFLECTION_PROTO = "src/proto/grpc/reflection/v1alpha/reflection.proto"
116+
-LICENSE = "./LICENSE"
117+
+REFLECTION_PROTO = os.path.join(
118+
+ GRPC_ROOT_ABS_PATH, "src/proto/grpc/reflection/v1alpha/reflection.proto"
119+
+)
120+
+LICENSE = os.path.join(GRPC_ROOT_ABS_PATH, "LICENSE")
121+
122+
123+
class Preprocess(setuptools.Command):
124+
@@ -44,11 +45,11 @@ class Preprocess(setuptools.Command):
125+
shutil.copyfile(
126+
REFLECTION_PROTO,
127+
os.path.join(
128+
- ROOT_REL_DIR, "grpc_reflection/v1alpha/reflection.proto"
129+
+ ROOT_DIR, "grpc_reflection/v1alpha/reflection.proto"
130+
),
131+
)
132+
if os.path.isfile(LICENSE):
133+
- shutil.copyfile(LICENSE, os.path.join(ROOT_REL_DIR, "LICENSE"))
134+
+ shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, "LICENSE"))
135+
136+
137+
class BuildPackageProtos(setuptools.Command):
138+
@@ -67,4 +68,4 @@ class BuildPackageProtos(setuptools.Command):
139+
from grpc_tools import command
140+
141+
# find and build all protos in the current package
142+
- command.build_package_protos(ROOT_REL_DIR, strict_mode=True)
143+
+ command.build_package_protos(ROOT_DIR, strict_mode=True)
144+
diff --git a/src/python/grpcio_status/status_commands.py b/src/python/grpcio_status/status_commands.py
145+
index dec7c78..d2705b2 100644
146+
--- a/src/python/grpcio_status/status_commands.py
147+
+++ b/src/python/grpcio_status/status_commands.py
148+
@@ -20,10 +20,11 @@ import setuptools
149+
150+
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
151+
GRPC_ROOT_ABS_PATH = os.path.join(ROOT_DIR, "../../..")
152+
-ROOT_REL_DIR = os.path.relpath(ROOT_DIR, start=GRPC_ROOT_ABS_PATH)
153+
-STATUS_PROTO = "third_party/googleapis/google/rpc/status.proto"
154+
+STATUS_PROTO = os.path.join(
155+
+ GRPC_ROOT_ABS_PATH, "third_party/googleapis/google/rpc/status.proto"
156+
+)
157+
PACKAGE_STATUS_PROTO_DIR = "grpc_status/google/rpc"
158+
-LICENSE = "./LICENSE"
159+
+LICENSE = os.path.join(GRPC_ROOT_ABS_PATH, "LICENSE")
160+
161+
162+
class Preprocess(setuptools.Command):
163+
@@ -40,7 +41,7 @@ class Preprocess(setuptools.Command):
164+
165+
def run(self):
166+
package_status_proto_rel_path = os.path.join(
167+
- ROOT_REL_DIR, PACKAGE_STATUS_PROTO_DIR
168+
+ ROOT_DIR, PACKAGE_STATUS_PROTO_DIR
169+
)
170+
171+
if os.path.isfile(STATUS_PROTO):
172+
@@ -51,4 +52,4 @@ class Preprocess(setuptools.Command):
173+
os.path.join(package_status_proto_rel_path, "status.proto"),
174+
)
175+
if os.path.isfile(LICENSE):
176+
- shutil.copyfile(LICENSE, os.path.join(ROOT_REL_DIR, "LICENSE"))
177+
+ shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, "LICENSE"))
178+
diff --git a/src/python/grpcio_testing/testing_commands.py b/src/python/grpcio_testing/testing_commands.py
179+
index cf8594b..2931837 100644
180+
--- a/src/python/grpcio_testing/testing_commands.py
181+
+++ b/src/python/grpcio_testing/testing_commands.py
182+
@@ -20,8 +20,7 @@ import setuptools
183+
184+
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
185+
GRPC_ROOT_ABS_PATH = os.path.join(ROOT_DIR, "../../..")
186+
-ROOT_REL_DIR = os.path.relpath(ROOT_DIR, start=GRPC_ROOT_ABS_PATH)
187+
-LICENSE = "./LICENSE"
188+
+LICENSE = os.path.join(GRPC_ROOT_ABS_PATH, "LICENSE")
189+
190+
191+
class Preprocess(setuptools.Command):
192+
@@ -38,4 +37,4 @@ class Preprocess(setuptools.Command):
193+
194+
def run(self):
195+
if os.path.isfile(LICENSE):
196+
- shutil.copyfile(LICENSE, os.path.join(ROOT_REL_DIR, "LICENSE"))
197+
+ shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, "LICENSE"))
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From: RISE python-wheels <noreply@riseproject.dev>
2+
Subject: [PATCH] Skip testTestsJsonUpToDate
3+
4+
tests.unit._sanity._sanity_test.SanityTest.testTestsJsonUpToDate compares
5+
the checked-in tests.json against the test classes discovered at runtime
6+
and fails if they don't match exactly. Upstream's tests.json for the
7+
v1.80.0 tag was never regenerated after tests.interop._secure_intraop_test
8+
gained SecureInteropWithSyncPrivateKeyOffloadingTest and
9+
SecureInteropWithAsyncPrivateKeyOffloadingTest, and after
10+
tests.interop.security_test.SecurityTest was added - all three classes
11+
exist in the shipped test files but are absent from tests.json. Confirmed
12+
against a plain checkout (no riscv64-specific behavior involved).
13+
14+
Skip rather than hand-maintain a tests.json diff that would need updating
15+
on every version bump if upstream keeps adding tests without regenerating
16+
this file.
17+
18+
Upstream-Status: To upstream [tests.json out of date for this tag]
19+
20+
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
21+
---
22+
diff --git a/src/python/grpcio_tests/tests/_sanity/_sanity_test.py b/src/python/grpcio_tests/tests/_sanity/_sanity_test.py
23+
index 66d920b..2a1fdfa 100644
24+
--- a/src/python/grpcio_tests/tests/_sanity/_sanity_test.py
25+
+++ b/src/python/grpcio_tests/tests/_sanity/_sanity_test.py
26+
@@ -29,6 +29,11 @@ class SanityTest(unittest.TestCase):
27+
28+
def testTestsJsonUpToDate(self):
29+
"""Autodiscovers all test suites and checks that tests.json is up to date"""
30+
+ raise unittest.SkipTest(
31+
+ "tests.json is stale upstream at this tag (missing"
32+
+ " SecureInteropWith{Sync,Async}PrivateKeyOffloadingTest and"
33+
+ " security_test.SecurityTest); not riscv64-specific."
34+
+ )
35+
loader = tests.Loader()
36+
loader.loadTestsFromNames([self.TEST_PKG_MODULE_NAME])
37+
test_suite_names = sorted(

0 commit comments

Comments
 (0)