Skip to content

Commit 2cf6b0f

Browse files
committed
feat: adding permanent fix for absl in src/core/util/log.cc for grpc, adding meson wrapper for grpcio
1 parent 070b2f5 commit 2cf6b0f

File tree

7 files changed

+291
-199
lines changed

7 files changed

+291
-199
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ bins
55
gens
66
libs
77
objs
8+
eugo_build/
89

910
# Python items
1011
.coverage*

meson.build

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# === @begin: General ===
2+
project(
3+
'grpcio',
4+
'c', 'cpp', 'cython',
5+
default_options: [
6+
'c_std=gnu17',
7+
'cpp_std=gnu++23',
8+
'buildtype=release',
9+
],
10+
meson_version: '>=1.3.0',
11+
version: '1.75.0.dev0' # Must match pyproject.toml#project
12+
)
13+
# === @end: General ===
14+
15+
16+
# === @begin: Meson modules imports ===
17+
py = import('python').find_installation(pure: false)
18+
# === @end: Meson modules imports ===
19+
20+
21+
# === @begin: Dependencies ===
22+
# grpc = dependency('gRPC', method: 'cmake', modules: ['gRPC::gpr', 'gRPC::grpc']) # TODO+ Run-time dependency grpc (modules: gRPC::gpr, gRPC::grpc) found: YES 8.11.0-DEV
23+
# openssl = dependency('openssl')
24+
# zlib = dependency('zlib-ng', method: 'cmake', modules: ['zlib-ng::zlib'])
25+
# cares = dependency('c-ares', method: 'cmake', modules: ['c-ares::cares'])
26+
# absl = dependency('absl', method: 'cmake', modules: ['absl::core_headers'])
27+
# re2 = dependency('re2', method: 'cmake')
28+
# === @end: Dependencies ===
29+
30+
31+
32+
# === @begin: cygrpc.so ===
33+
py.extension_module(
34+
'cygrpc',
35+
[
36+
'src/python/grpcio/grpc/_cython/cygrpc.pyx',
37+
],
38+
cpp_args: [
39+
'-DPyMODINIT_FUNC=extern "C" __attribute__((visibility ("default"))) PyObject*',
40+
# '-DPyMODINIT_FUNC=extern \\"C\\" __attribute__((visibility (\\"default\\"))) PyObject*',
41+
#'-D__STDC_FORMAT_MACROS',
42+
],
43+
include_directories: [
44+
'src/python/grpcio/grpc/_cython/',
45+
'src/python/grpcio/',
46+
'src/core/ext/upb-gen/',
47+
'src/core/ext/upbdefs-gen/',
48+
],
49+
install: true,
50+
subdir: 'grpc/_cython/',
51+
dependencies: [
52+
# Package-managed
53+
# grpc,
54+
# openssl,
55+
# zlib,
56+
# cares,
57+
# absl,
58+
# re2
59+
],
60+
override_options : ['cython_language=cpp'], # See: https://github.com/mesonbuild/meson/blob/master/mesonbuild/compilers/cython.py and https://github.com/mesonbuild/meson/blob/master/mesonbuild/build.py#L995-L1003
61+
cython_args: ['--3str'], # See: https://github.com/mesonbuild/meson/blob/master/test%20cases/cython/3%20cython_args/meson.build
62+
)
63+
# === @end: cygrpc.so ===
64+
65+
66+
# === @begin: Pure Python ===
67+
install_subdir(
68+
'src/python/grpcio/grpc/',
69+
install_dir: py.get_install_dir(),
70+
install_tag: 'python-runtime',
71+
72+
exclude_directories: [
73+
'protobuf/internal/import_test_package/',
74+
'protobuf/internal/numpy/',
75+
],
76+
77+
exclude_files: [
78+
'__init__.py',
79+
80+
'protobuf/link_error_fast_cpp.cc',
81+
'protobuf/link_error_pure_python.cc',
82+
'protobuf/link_error_upb.cc',
83+
'protobuf/proto_api.h',
84+
'protobuf/python_protobuf.h',
85+
'protobuf/use_fast_cpp_protos.cc',
86+
'protobuf/use_pure_python.cc',
87+
'protobuf/use_upb_protos.cc',
88+
89+
'protobuf/any.py',
90+
'protobuf/duration.py',
91+
'protobuf/timestamp.py',
92+
93+
# C++ bindings (fast cpp)
94+
'protobuf/pyext/descriptor.cc',
95+
'protobuf/pyext/descriptor.h',
96+
'protobuf/pyext/descriptor_containers.cc',
97+
'protobuf/pyext/descriptor_containers.h',
98+
'protobuf/pyext/descriptor_database.cc',
99+
'protobuf/pyext/descriptor_database.h',
100+
'protobuf/pyext/descriptor_pool.cc',
101+
'protobuf/pyext/descriptor_pool.h',
102+
'protobuf/pyext/extension_dict.cc',
103+
'protobuf/pyext/extension_dict.h',
104+
'protobuf/pyext/field.cc',
105+
'protobuf/pyext/field.h',
106+
'protobuf/pyext/map_container.cc',
107+
'protobuf/pyext/map_container.h',
108+
'protobuf/pyext/message.cc',
109+
'protobuf/pyext/message.h',
110+
'protobuf/pyext/message_factory.cc',
111+
'protobuf/pyext/message_factory.h',
112+
'protobuf/pyext/message_module.cc',
113+
'protobuf/pyext/python.proto',
114+
'protobuf/pyext/README',
115+
'protobuf/pyext/repeated_composite_container.cc',
116+
'protobuf/pyext/repeated_composite_container.h',
117+
'protobuf/pyext/repeated_scalar_container.cc',
118+
'protobuf/pyext/repeated_scalar_container.h',
119+
'protobuf/pyext/safe_numerics.h',
120+
'protobuf/pyext/scoped_pyobject_ptr.h',
121+
'protobuf/pyext/unknown_field_set.cc',
122+
'protobuf/pyext/unknown_field_set.h',
123+
124+
'protobuf/internal/any_test.py',
125+
'protobuf/internal/api_implementation.cc',
126+
'protobuf/internal/decoder_test.py',
127+
'protobuf/internal/descriptor_database_test.py',
128+
'protobuf/internal/descriptor_pool_test.py',
129+
'protobuf/internal/descriptor_pool_test1.proto',
130+
'protobuf/internal/descriptor_pool_test2.proto',
131+
'protobuf/internal/descriptor_test.py',
132+
'protobuf/internal/duration_test.py',
133+
'protobuf/internal/factory_test1.proto',
134+
'protobuf/internal/factory_test2.proto',
135+
'protobuf/internal/field_mask_test.py',
136+
'protobuf/internal/file_options_test.proto',
137+
'protobuf/internal/generator_test.py',
138+
'protobuf/internal/import_test.py',
139+
'protobuf/internal/json_format_test.py',
140+
'protobuf/internal/keywords_test.py',
141+
'protobuf/internal/message_factory_test.py',
142+
'protobuf/internal/message_set_extensions.proto',
143+
'protobuf/internal/message_test.py',
144+
'protobuf/internal/missing_enum_values.proto',
145+
'protobuf/internal/more_extensions.proto',
146+
'protobuf/internal/more_extensions_dynamic.proto',
147+
'protobuf/internal/more_messages.proto',
148+
'protobuf/internal/no_package.proto',
149+
'protobuf/internal/packed_field_test.proto',
150+
'protobuf/internal/proto_builder_test.py',
151+
'protobuf/internal/proto_json_test.py',
152+
'protobuf/internal/proto_test.py',
153+
'protobuf/internal/pybind11_test_module.cc',
154+
'protobuf/internal/python_edition_defaults.py.template',
155+
'protobuf/internal/python_protobuf.cc',
156+
'protobuf/internal/recursive_message_pybind11_test.py',
157+
'protobuf/internal/reflection_cpp_test.py',
158+
'protobuf/internal/reflection_test.py',
159+
'protobuf/internal/runtime_version_test.py',
160+
'protobuf/internal/self_recursive.proto',
161+
'protobuf/internal/self_recursive_from_py.proto',
162+
'protobuf/internal/service_reflection_test.py',
163+
'protobuf/internal/symbol_database_test.py',
164+
'protobuf/internal/test_bad_identifiers.proto',
165+
'protobuf/internal/test_proto2.proto',
166+
'protobuf/internal/test_proto3_optional.proto',
167+
'protobuf/internal/test_util.py',
168+
'protobuf/internal/text_encoding_test.py',
169+
'protobuf/internal/text_format_test.py',
170+
'protobuf/internal/thread_safe_test.py',
171+
'protobuf/internal/timestamp_test.py',
172+
'protobuf/internal/unknown_fields_test.py',
173+
'protobuf/internal/well_known_types_test.proto',
174+
'protobuf/internal/well_known_types_test.py',
175+
'protobuf/internal/wire_format_test.py',
176+
]
177+
)
178+
# === @end: Pure Python ===

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[build-system]
2+
build-backend = 'mesonpy'
3+
requires = ['meson-python']
4+
5+
[project]
6+
name = 'grpcio'
7+
readme = 'README.md'
8+
requires-python = '>=3.12'
9+
10+
# Must match `./meson.build#project#version` and `./grpc/src/python/grpcio/grpc_version.py`.
11+
#
12+
# The latter is managed by `grpc` mainteners, so it should be treated as a single source of truth for the package version.
13+
version = '1.75.0.dev0'

0 commit comments

Comments
 (0)