Skip to content

Commit 41d8b56

Browse files
committed
avoid absolute paths in grpcio-tools install script
1 parent d767ef8 commit 41d8b56

5 files changed

+15
-11
lines changed

recipe/patches/0011-build-grpcio-tools-from-source.patch

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From 980d72c700f10ed22db92a51c6a3f925e0325f62 Mon Sep 17 00:00:00 2001
1+
From de307ec15e9179105ed903a50e206088dd890fa0 Mon Sep 17 00:00:00 2001
22
From: "H. Vetinari" <h.vetinari@gmx.com>
33
Date: Tue, 4 Mar 2025 08:53:30 +1100
44
Subject: [PATCH 11/15] build grpcio-tools from source
55

66
---
7-
tools/distrib/python/grpcio_tools/setup.py | 43 ++++++++++++++++------
8-
1 file changed, 31 insertions(+), 12 deletions(-)
7+
tools/distrib/python/grpcio_tools/setup.py | 47 ++++++++++++++++------
8+
1 file changed, 35 insertions(+), 12 deletions(-)
99

1010
diff --git a/tools/distrib/python/grpcio_tools/setup.py b/tools/distrib/python/grpcio_tools/setup.py
11-
index fb6c416c96..033a2fe304 100644
11+
index fb6c416c96..c761c3670e 100644
1212
--- a/tools/distrib/python/grpcio_tools/setup.py
1313
+++ b/tools/distrib/python/grpcio_tools/setup.py
1414
@@ -15,6 +15,7 @@
@@ -54,7 +54,7 @@ index fb6c416c96..033a2fe304 100644
5454

5555
GRPC_PYTHON_TOOLS_PACKAGE = "grpc_tools"
5656
GRPC_PYTHON_PROTO_RESOURCES_NAME = "_proto"
57-
@@ -293,16 +293,34 @@ def package_data():
57+
@@ -293,16 +293,38 @@ def package_data():
5858
return {GRPC_PYTHON_TOOLS_PACKAGE: proto_files}
5959

6060

@@ -81,7 +81,11 @@ index fb6c416c96..033a2fe304 100644
8181
else:
8282
plugin_sources = [os.path.join("grpc_tools", "_protoc_compiler.cpp")]
8383

84-
+ grpc_root = os.environ["SRC_DIR"]
84+
+ # setuptools requires relative paths; calculate it
85+
+ src_dir = pathlib.Path(os.environ["SRC_DIR"]).resolve()
86+
+ setup_dir = pathlib.Path(__file__).resolve().parent
87+
+ # cannot use pathlib's Path.relative_to to go _out_; see https://github.com/python/cpython/issues/88244
88+
+ grpc_root = pathlib.Path(os.path.relpath(src_dir, setup_dir)).as_posix()
8589
plugin_sources += [
8690
os.path.join("grpc_tools", "main.cc"),
8791
- os.path.join("grpc_root", "src", "compiler", "python_generator.cc"),
@@ -91,7 +95,7 @@ index fb6c416c96..033a2fe304 100644
9195
] + CC_FILES
9296

9397
plugin_ext = Extension(
94-
@@ -310,10 +328,11 @@ def extension_modules():
98+
@@ -310,10 +332,11 @@ def extension_modules():
9599
sources=plugin_sources,
96100
include_dirs=[
97101
".",

recipe/patches/0012-reduce-grpc-symbol-explosion-with-autogenerated-expo.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 8d5305b2d1ea793c60a5103901586a996ac53980 Mon Sep 17 00:00:00 2001
1+
From 8ae0edebd28369b16c4ade7b46b1300871534bbf Mon Sep 17 00:00:00 2001
22
From: "H. Vetinari" <h.vetinari@gmx.com>
33
Date: Wed, 5 Mar 2025 13:21:01 +1100
44
Subject: [PATCH 12/15] reduce grpc symbol explosion with autogenerated export

recipe/patches/0013-update-GRPC_DLL-instances-where-necessary.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From ec104bab4b2071cbcdad3b39cc551c98243c3fde Mon Sep 17 00:00:00 2001
1+
From e9a4afe16f406e3e5e8826fce49a0d17a8b8fed1 Mon Sep 17 00:00:00 2001
22
From: "H. Vetinari" <h.vetinari@gmx.com>
33
Date: Sun, 2 Mar 2025 07:16:19 +1100
44
Subject: [PATCH 13/15] update GRPC_DLL instances where necessary

recipe/patches/0014-use-protobuf-s-libutf8_range.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 37ade4a10dc8f3454686876368bc61fcbba3e174 Mon Sep 17 00:00:00 2001
1+
From b55af7374bd39b75cb7a598ef7cac6db17c648be Mon Sep 17 00:00:00 2001
22
From: "H. Vetinari" <h.vetinari@gmx.com>
33
Date: Sat, 10 Jan 2026 20:43:11 +1100
44
Subject: [PATCH 14/15] use protobuf's libutf8_range

recipe/patches/0015-disable-grpc-_unsecure.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 0f87806467d72a1c0bfbe3c1f2f035910ac01e52 Mon Sep 17 00:00:00 2001
1+
From a2bd84cb1484a775e7b934d4b3568d0185b4e838 Mon Sep 17 00:00:00 2001
22
From: "H. Vetinari" <h.vetinari@gmx.com>
33
Date: Sun, 11 Jan 2026 22:45:25 +1100
44
Subject: [PATCH 15/15] disable grpc{,++}_unsecure

0 commit comments

Comments
 (0)