-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
meta.yaml
258 lines (242 loc) · 9.24 KB
/
meta.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
{% set version = "1.67.0" %}
# core package & vendored libs use different version scheme than CPP libs, see
# https://github.com/grpc/grpc/blob/v1.48.1/CMakeLists.txt#L28-L32
# the difference of 23 is empirical and most recently changed with 1.54
{% set core_major = version.split(".")[1] | int - 23 %}
{% set core_version = core_major | string ~ ".0.0" %}
{% set core_libs = ["gpr", "grpc", "grpc_unsecure"] %}
{% set core_cpp_libs = ["grpc++", "grpc++_unsecure"] %}
{% set vendored_libs = ["address_sorting"] %}
{% set binaries_plugin_langs = [
"cpp", "csharp", "node", "objective_c", "php", "python", "ruby"
] %}
package:
name: grpc-split
version: {{ version }}
source:
- url: https://github.com/grpc/grpc/archive/v{{ version.replace(".pre", "-pre") }}.tar.gz
sha256: af0638f73e4452e22e295f8b3f452518234254104713a08497f3d3aaa76733ad
patches:
- patches/0001-windows-ssl-lib-names.patch
- patches/0002-fix-win-setup-cmds.patch
- patches/0003-Link-against-grpc.patch
- patches/0004-force-protoc-executable.patch
- patches/0005-switch-to-C-17-for-grpcio.patch
- patches/0006-fix-abseil-setup.patch
# mark c-ares, re2 & zlib as private, so they don't need to be found
# at runtime just to link to grp, see grpc/grpc#30838;
# not much point in marking baselibs or vendored libs (e.g. upb) as private
- patches/0007-mark-linkage-of-c-ares-re2-zlib-as-private.patch
# see https://github.com/grpc/grpc/issues/35794
- patches/0008-fix-missing-DLL-exports-in-vendored-upb.patch
# fix symbol visibility regression on windows
- patches/0009-for-main-targets-set-_DLL_EXPORTS-when-building-and-.patch
# work-around for https://github.com/grpc/grpc/issues/36654
- patches/0010-set-Wl-undefined-dynamic_lookup-for-upb_-json-textfo.patch
- patches/0011-add-missing-GRPC_DLL-macro.patch
- url: https://pypi.io/packages/source/g/grpcio-tools/grpcio_tools-{{ version }}.tar.gz
sha256: 181b3d4e61b83142c182ec366f3079b0023509743986e54c9465ca38cac255f8
folder: grpcio_tools
build:
number: 0
outputs:
- name: libgrpc
script: build-cpp.sh # [not win]
script: build-cpp.bat # [win]
build:
run_exports:
- {{ pin_subpackage('libgrpc', max_pin='x.x') }}
requirements:
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
- cmake
- ninja
# During cross-compilation, we need to build the grpc_cpp_plugin for the
# architecture of the build agent (where it will be executed afterwards),
# thus we need the respective host dependencies also in the build env.
- c-ares # [build_platform != target_platform]
- libabseil # [build_platform != target_platform]
- libprotobuf # [build_platform != target_platform]
- openssl # [build_platform != target_platform]
- re2 # [build_platform != target_platform]
- zlib # [build_platform != target_platform]
host:
- libabseil
- c-ares
- libprotobuf
- re2
- openssl
- zlib
run:
- ucrt # [win]
run_constrained:
# make sure we don't co-install with old version of previous package name
- grpc-cpp ={{ version }}
test:
requires:
# protoc needs compiler; cmake also needs one to run package detection, see
# https://discourse.cmake.org/t/questions-about-find-package-cli-msvc/6194
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- cmake
- ninja
- pkg-config
# only required for pkg-config test (which wants to find zlib.pc)
- zlib
files:
- cmake_test/
- hello.proto
- test_grpc.sh
- test_grpc.bat
source_files:
- examples/cpp/helloworld/
# the example needs these other files to compile:
- examples/cpp/cmake/
- examples/protos/helloworld.proto
commands:
# libraries
{% for each_lib in core_libs + core_cpp_libs + vendored_libs %}
# presence of shared libs
- test -f $PREFIX/lib/lib{{ each_lib }}.so # [linux]
- test -f $PREFIX/lib/lib{{ each_lib }}.dylib # [osx]
- if not exist %LIBRARY_BIN%\{{ each_lib }}.dll exit 1 # [win]
- if not exist %LIBRARY_LIB%\{{ each_lib }}.lib exit 1 # [win]
# absence of static libs (unix)
- test ! -f $PREFIX/lib/lib{{ each_lib }}.a # [unix]
{% endfor %}
# binaries
{% for each_lang in binaries_plugin_langs %}
- test -f $PREFIX/bin/grpc_{{ each_lang }}_plugin # [unix]
- if not exist %LIBRARY_BIN%\grpc_{{ each_lang }}_plugin.exe exit 1 # [win]
{% endfor %}
# pkg-config (no metadata for vendored libs)
{% for each_lib in core_libs %}
- pkg-config --print-errors --exact-version "{{ core_version }}" {{ each_lib }}
{% endfor %}
{% for each_lib in core_cpp_libs %}
- pkg-config --print-errors --exact-version "{{ version }}" {{ each_lib }}
{% endfor %}
# CMake test: compile upstream example
- ./test_grpc.sh # [unix]
- ./test_grpc.bat # [win]
# test availability of symbol needed by arrow (esp. on windows)
- cd cmake_test
- cmake -GNinja -DCMAKE_CXX_STANDARD=17 $CMAKE_ARGS . # [unix]
- cmake -GNinja -DCMAKE_CXX_STANDARD=17 %CMAKE_ARGS% . # [win]
- cmake --build .
- name: grpcio
script: build-grpcio.sh # [not win]
script: build-grpcio.bat # [win]
requirements:
build:
- python # [build_platform != target_platform]
- cross-python_{{ target_platform }} # [build_platform != target_platform]
- cython # [build_platform != target_platform]
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
host:
- python
- pip
- setuptools
- cython
- {{ pin_subpackage('libgrpc', exact=True) }}
- pthread-stubs # [linux]
- zlib
run:
- python
- {{ pin_subpackage('libgrpc', exact=True) }}
test:
source_files:
- examples/python/helloworld/
- examples/protos/helloworld.proto
files:
- grpcio_distribtest.py
- test_grpcio_helloworld.py
requires:
- pip
- grpcio-tools
imports:
- grpc
- grpc._cython
- grpc._cython._cygrpc
- grpc.beta
- grpc.framework
- grpc.framework.common
- grpc.framework.foundation
- grpc.framework.interfaces
- grpc.framework.interfaces.base
- grpc.framework.interfaces.face
commands:
- python -m pip check
- python grpcio_distribtest.py
{% if build_platform == target_platform %}
# test actual RPC pattern (client & server); other tests did not catch
# https://github.com/conda-forge/grpc-cpp-feedstock/issues/281
- cd examples/python/helloworld
# generate helloworld, see https://grpc.io/docs/languages/python/quickstart/#generate-grpc-code
- python -m grpc_tools.protoc -I../../protos --python_out=. --pyi_out=. --grpc_python_out=. ../../protos/helloworld.proto
# copy test defined in feedstock to where it needs to run
- cp ../../../test_grpcio_helloworld.py .
- python test_grpcio_helloworld.py
{% endif %}
- name: grpcio-tools
build:
script:
- cd grpcio_tools
- export GRPC_PYTHON_BUILD_WITH_CYTHON=true # [unix]
- set GRPC_PYTHON_BUILD_WITH_CYTHON=true # [win]
- python -m pip install . -vv
requirements:
build:
- python # [build_platform != target_platform]
- cython # [build_platform != target_platform]
- cross-python_{{ target_platform }} # [build_platform != target_platform]
- {{ stdlib('c') }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
- grpcio ={{ version }}=*_{{ PKG_BUILDNUM }}
- python
- cython
- pip
- setuptools
run:
- grpcio ={{ version }}=*_{{ PKG_BUILDNUM }}
- python
- protobuf
- setuptools
test:
requires:
- pip
commands:
- pip check
imports:
- grpc_tools
about:
home: https://grpc.io/
license: Apache-2.0
license_family: APACHE
license_file: LICENSE
summary: gRPC - A high-performance, open-source universal RPC framework
description: |
gRPC is a modern, open source, high-performance remote procedure call
(RPC) framework that can run anywhere. gRPC enables client and server
applications to communicate transparently, and simplifies the building
of connected systems.
This package contains the gRPC C++ libraries and header files, as well
as the code generation plugins.
doc_url: https://grpc.io/docs/
dev_url: https://github.com/grpc/grpc
extra:
recipe-maintainers:
- pitrou
- xhochy
- wesm
- h-vetinari
- mariusvniekerk
- jjerphan
- JohanMabille
feedstock-name: grpc-cpp