blob: 24eeb7f047a246010f5eb10611679f335e6377ef (
plain) (
blame)
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
259
260
261
262
263
264
265
266
|
when ($SANITIZER_TYPE || $USE_ARCADIA_PYTHON == "no" || $UDF_NO_PROBE == "yes" || $MUSL == "yes" || $TIDY == "yes") {
YQL_UDF_LINK_CMD=$LINK_DYN_LIB
YQL_UDF_LINK_PRG_CMD=$LINK_EXEC_DYN_LIB
}
otherwise {
YQL_UDF_LINK_CMD=$LINK_DYN_LIB && ${tool:"yql/tools/udf_probe"} $TARGET ${kv;hide:"p UD"}
YQL_UDF_LINK_PRG_CMD=$LINK_EXEC_DYN_LIB && ${tool:"yql/tools/udf_probe"} $TARGET ${kv;hide:"p UD"}
}
### @usage: UDF_BASE(name [EXPORTS symlist_file] [PREFIX prefix]) #internal
###
### The base logic of all UDF extension modules (User-Defined Functions).
### Processing EXPORTS and PREFIX is the same as for DLL.
###
### https://wiki.yandex-team.ru/robot/manual/kiwi/userguide/#polzovatelskiefunkciiudftriggerykwcalc
module UDF_BASE: DLL_UNIT {
PRINT_MODULE_TYPE(UDF $REALPRJNAME)
when ($MSVC != "yes" && $DARWIN != "yes") {
LDFLAGS+= -Wl,-Bsymbolic
}
}
### @usage: UDF(name [EXPORTS symlist_file] [PREFIX prefix]) # deprecated
###
### The KiWi UDF module.
### Processing EXPORTS and PREFIX is the same as for DLL.
###
### https://wiki.yandex-team.ru/robot/manual/kiwi/userguide/#polzovatelskiefunkciiudftriggerykwcalc
module UDF: UDF_BASE {
PEERDIR(yweb/robot/kiwi/kwcalc/udflib)
}
### @usage: UDF_LIB([name]) # deprecated
###
### The LIBRARY module for KiWi UDF, so has default PEERDIR to yweb/robot/kiwi/kwcalc/udflib.
module UDF_LIB: LIBRARY {
PEERDIR(yweb/robot/kiwi/kwcalc/udflib)
}
UDF_NO_PROBE="no"
### @usage: UDF_NO_PROBE()
###
### Disable UDF import check at build stage
macro UDF_NO_PROBE() {
ENABLE(UDF_NO_PROBE)
}
### @usage: YQL_UDF_TEST([name])
###
### The module to test YQL C++ UDF.
###
### Documentation: https://yql.yandex-team.ru/docs/yt/libraries/testing/
### Documentation about the Arcadia test system: https://wiki.yandex-team.ru/yatool/test/
module YQL_UDF_TEST: PY2TEST {
PEERDIR(yql/library/udf_test)
PEERDIR(yt/python/client_lite)
DEPENDS(yql/tools/astdiff)
DEPENDS(yql/tools/udf_resolver)
DEPENDS(yql/tools/yqlrun)
DATA(arcadia/ydb/library/yql/mount)
DATA(arcadia/yql/cfg/tests)
}
### @usage: _ADD_YQL_UDF_DEPS()
###
### Add all needed PEERDIRs to a YQL_UDF.
###
### https://yql.yandex-team.ru/docs/yt/udf/cpp/
macro _ADD_YQL_UDF_DEPS() {
PEERDIR(ydb/library/yql/public/udf)
PEERDIR(ydb/library/yql/public/udf/support)
}
### @usage: _MAKE_YQL_UDF()
###
### Make module definition an YQL UDF: add all needed dependencies, properties and flags
###
### https://yql.yandex-team.ru/docs/yt/udf/cpp/
macro _MAKE_YQL_UDF() {
_ADD_YQL_UDF_DEPS()
SET_APPEND(USER_CXXFLAGS -DBUILD_UDF)
# For Windows using declspecs
DEFAULT(YQL_UDF_EXPORT ${ARCADIA_ROOT}/ydb/library/yql/public/udf/udfs_exports.exports)
when ($WINDOWS == "yes") {
YQL_UDF_EXPORT=
}
SET(EXPORTS_FILE $YQL_UDF_EXPORT)
}
### @usage: YQL_UDF_MODULE(name)
###
### The extension module for YQL with C++ UDF (User Defined Function YQL)
###
### https://yql.yandex-team.ru/docs/yt/udf/cpp/
module YQL_UDF_MODULE: UDF_BASE {
.CMD=YQL_UDF_LINK_CMD
_MAKE_YQL_UDF()
PROVIDES(YqlServicePolicy)
}
module _YQL_UDF_PROGRAM_BASE: SO_PROGRAM {
.CMD=YQL_UDF_LINK_PRG_CMD
_MAKE_YQL_UDF()
}
UDF_SHARED_SEM=IGNORED
### @usage: YQL_UDF(name)
###
### User-defined function for YQL
###
### Multimodule which is YQL_UDF_MODULE when built directly or referred by BUNDLE and DEPENDS macros.
### If used by PEERDIRs it is usual static LIBRARY with default YQL dependencies, allowing code reuse between UDFs.
###
### @see: [YQL_UDF_MODULE()](#module_YQL_UDF_MODULE)
multimodule YQL_UDF {
module YQL_UDF_SHARED: YQL_UDF_MODULE {
.SEM=UDF_SHARED_SEM
NO_CLANG_TIDY()
}
module YQL_UDF_STATIC: _DLL_COMPATIBLE_LIBRARY {
.ALIASES=SRCS=GLOBAL_SRCS
.SEM=CPP_LIBRARY_SEM
.GLOBAL_SEM=CPP_OBJ_LIBRARY_SEM
OBJ_SUF=.udfs
_ADD_YQL_UDF_DEPS()
# disable credits generation for static library
SET(CREDITS_FLAGS)
when ($MSVC == "yes" || $CYGWIN == "yes") {
MODULE_SUFFIX=.static.lib
}
}
}
### @usage: YQL_ABI_VERSION(major minor release))
###
### Specifying the supported ABI for YQL_UDF.
###
### @see: [YQL_UDF()](#multimodule_YQL_UDF)
macro YQL_ABI_VERSION(Major, Minor, Patch) {
YQL_ABI_FLAGS=-DUDF_ABI_VERSION_MAJOR=$Major -DUDF_ABI_VERSION_MINOR=$Minor -DUDF_ABI_VERSION_PATCH=$Patch
SET_APPEND(USER_CXXFLAGS $YQL_ABI_FLAGS)
}
### @usage: YQL_LAST_ABI_VERSION()
###
### Use the last ABI for YQL_UDF
###
macro YQL_LAST_ABI_VERSION() {
YQL_ABI_FLAGS=-DUSE_CURRENT_UDF_ABI_VERSION
SET_APPEND(USER_CXXFLAGS $YQL_ABI_FLAGS)
}
### @usage: YQL_PYTHON_UDF(name)
###
### Definition of the extension module for YQL with Python 2.x UDF (User Defined Function for YQL).
### Unlike YQL_UDF this is plain DLL module, so PEERDIRs to it are not allowed.
###
### https://yql.yandex-team.ru/docs/yt/udf/python/
module YQL_PYTHON_UDF: YQL_UDF_MODULE {
.IGNORED=USE_PYTHON2
.RESTRICTED=PYTHON3_ADDINCL USE_PYTHON3 PYTHON2_ADDINCL
USE_PYTHON2()
_ARCADIA_PYTHON_ADDINCL()
PEERDIR(build/platform/python/ldflags)
PEERDIR(library/python/type_info)
DEFAULT(YQL_PYTHON_UDF_EXPORT ${ARCADIA_ROOT}/yql/udfs/common/python/python_udf/python_udfs_exports.exports)
when ($WINDOWS == "yes") {
YQL_PYTHON_UDF_EXPORT=
}
### FIXME: XXX the statement below uncoditionally set EXPORTS_FILE (due to incorrect behaviour of old ConfReader
###when ($USE_ARCADIA_PYTHON == "yes") SET(EXPORTS_FILE $YQL_PYTHON_UDF_EXPORT)
SET(EXPORTS_FILE $YQL_PYTHON_UDF_EXPORT)
}
### @usage: YQL_PYTHON_UDF_PROGRAM(name)
###
### Definition of the extension module for YQL with Python 2.x UDF (User Defined Function for YQL).
### Unlike YQL_UDF this is plain DLL module, so PEERDIRs to it are not allowed.
###
### https://yql.yandex-team.ru/docs/yt/udf/python/
module YQL_PYTHON_UDF_PROGRAM: _YQL_UDF_PROGRAM_BASE {
.IGNORED=USE_PYTHON2
.RESTRICTED=PYTHON3_ADDINCL USE_PYTHON3 PYTHON2_ADDINCL
USE_PYTHON2()
_ARCADIA_PYTHON_ADDINCL()
PEERDIR(build/platform/python/ldflags)
PEERDIR(library/python/type_info)
DEFAULT(YQL_PYTHON_UDF_EXPORT ${ARCADIA_ROOT}/yql/udfs/common/python/python_udf/python_udfs_exports.exports)
when ($WINDOWS == "yes") {
YQL_PYTHON_UDF_EXPORT=
}
### FIXME: XXX the statement below uncoditionally set EXPORTS_FILE (due to incorrect behaviour of old ConfReader
###when ($USE_ARCADIA_PYTHON == "yes") SET(EXPORTS_FILE $YQL_PYTHON_UDF_EXPORT)
SET(EXPORTS_FILE $YQL_PYTHON_UDF_EXPORT)
}
### @usage: YQL_PYTHON3_UDF(name)
###
### The extension module for YQL with Python 3.x UDF (User Defined Function for YQL).
### Unlike YQL_UDF this is plain DLL module, so PEERDIRs to it are not allowed.
###
### Documentation: https://yql.yandex-team.ru/docs/yt/udf/python/
module YQL_PYTHON3_UDF: YQL_UDF_MODULE {
.RESTRICTED=PYTHON2_ADDINCL PYTHON3_ADDINCL USE_PYTHON2 USE_PYTHON3
_ARCADIA_PYTHON3_ADDINCL()
PEERDIR(build/platform/python/ldflags)
PEERDIR(library/python/type_info)
DEFAULT(YQL_PYTHON_UDF_EXPORT ${ARCADIA_ROOT}/yql/udfs/common/python/python_udf/python_udfs_exports.exports)
when ($WINDOWS == "yes") {
YQL_PYTHON_UDF_EXPORT=
}
### FIXME: XXX the statement below uncoditionally set EXPORTS_FILE (due to incorrect behaviour of old ConfReader
###when ($USE_ARCADIA_PYTHON == "yes") SET(EXPORTS_FILE $YQL_PYTHON_UDF_EXPORT)
SET(EXPORTS_FILE $YQL_PYTHON_UDF_EXPORT)
}
macro _MAKE_YQL_PYTHON_UDF_TEST() {
PEERDIR(library/python/pytest)
DEPENDS(yql/tools/run_python_udf)
SETUP_PYTEST_BIN(RUNNER_BIN $(BUILD_ROOT)/yql/tools/run_python_udf/run_python_udf)
}
### @usage: YQL_PYTHON_UDF_TEST(name)
###
### The Python test for Python YQL UDF (Python User Defined Function for YQL). The code should be a proper YQL_PYTHON_UDF.
###
### This module will basically build itself as UDF and run as test using yql/tools/run_python_udf/run_python_udf tool.
###
### Documentation: https://yql.yandex-team.ru/docs/yt/udf/python/
###
### @example: https://a.yandex-team.ru/arc/trunk/arcadia/yql/udfs/test/simple/ya.make
###
### @see: [YQL_PYTHON_UDF()](#module_YQL_PYTHON_UDF)
module YQL_PYTHON_UDF_TEST: YQL_PYTHON_UDF {
_MAKE_YQL_PYTHON_UDF_TEST()
SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json)
}
### @usage: YQL_PYTHON3_UDF_TEST(name)
###
### The Python test for Python 3.x YQL UDF (User Defined Function for YQL). The code should be a proper YQL_PYTHON3_UDF.
###
### This module will basically build itself as UDF and run as test using yql/tools/run_python_udf/run_python_udf tool.
###
### Documentation: https://yql.yandex-team.ru/docs/yt/udf/python/
###
### @see: [YQL_PYTHON3_UDF()](#module_YQL_PYTHON3_UDF)
module YQL_PYTHON3_UDF_TEST: YQL_PYTHON3_UDF {
_MAKE_YQL_PYTHON_UDF_TEST()
SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json)
}
|