aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnermolaev <snermolaev@yandex-team.com>2023-10-16 07:36:25 +0300
committersnermolaev <snermolaev@yandex-team.com>2023-10-16 07:59:32 +0300
commit98427c7781b0cd35e4e09533db9057220e50f637 (patch)
tree64c75087d81bad091b49a4ec948679b65b683d6c
parent03562c20be10d96a02cbd83773bf2f3a17c70142 (diff)
downloadydb-98427c7781b0cd35e4e09533db9057220e50f637.tar.gz
split RESOURCE and RESOURCE_FILES with very long lists of arguments
-rw-r--r--build/plugins/pybuild.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py
index 1823b82387..e684a11725 100644
--- a/build/plugins/pybuild.py
+++ b/build/plugins/pybuild.py
@@ -13,6 +13,14 @@ BUILTIN_PROTO = 'builtin_proto'
DEFAULT_FLAKE8_FILE_PROCESSING_TIME = "1.5" # in seconds
+def _split_macro_call(macro_call, data, item_size, chunk_size=1024):
+ index = 0
+ length = len(data)
+ offset = item_size*chunk_size
+ while index + 1 < length:
+ macro_call(data[index:index+offset])
+ index += offset
+
def is_arc_src(src, unit):
return (
src.startswith('${ARCADIA_ROOT}/')
@@ -559,7 +567,7 @@ def onpy_srcs(unit, *args):
ns_res += ['-', '{}="{}"'.format(key, namespaces)]
unit.onresource(ns_res)
- unit.onresource_files(res)
+ _split_macro_call(unit.onresource_files, res, (3 if with_py else 0) + (3 if with_pyc else 0))
add_python_lint_checks(
unit, 3, [path for path, mod in pys] + unit.get(['_PY_EXTRA_LINT_FILES_VALUE']).split()
)
@@ -580,7 +588,7 @@ def onpy_srcs(unit, *args):
unit.on_py_compile_bytecode([root_rel_path + '-', src, dst])
res += [dst + '.yapyc', '/py_code/' + mod]
- unit.onresource(res)
+ _split_macro_call(unit.onresource, res, (4 if with_py else 0) + (2 if with_pyc else 0))
add_python_lint_checks(
unit, 2, [path for path, mod in pys] + unit.get(['_PY_EXTRA_LINT_FILES_VALUE']).split()
)