diff options
author | reshilkin <reshilkin@yandex-team.com> | 2023-08-02 14:07:40 +0300 |
---|---|---|
committer | reshilkin <reshilkin@yandex-team.com> | 2023-08-02 14:07:40 +0300 |
commit | e59e20ae2d1e498c1a2ee4c6f9036475b45b8329 (patch) | |
tree | 3d13375b78f4564e6750704a4b538dd3da5e2a9f | |
parent | a98df246dd365c2c1ce33e8d65a5a1ec2f175bff (diff) | |
download | ydb-e59e20ae2d1e498c1a2ee4c6f9036475b45b8329.tar.gz |
Using deprecated flatc for compiling PY2FBS
-rw-r--r-- | build/plugins/pybuild.py | 8 | ||||
-rw-r--r-- | build/ymake.core.conf | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py index 3fc8f5e66e..bd66b1ef70 100644 --- a/build/plugins/pybuild.py +++ b/build/plugins/pybuild.py @@ -611,8 +611,12 @@ def onpy_srcs(unit, *args): if fbss: unit.onpeerdir(unit.get('_PY_FBS_DEPS').split()) pysrc_base_name = listid(fbss) - unit.onfbs_to_pysrc([pysrc_base_name] + [path for path, _ in fbss]) - unit.onsrcs(['GLOBAL', '{}.fbs.pysrc'.format(pysrc_base_name)]) + if py3: + unit.onfbs_to_pysrc([pysrc_base_name] + [path for path, _ in fbss]) + unit.onsrcs(['GLOBAL', '{}.py3.fbs.pysrc'.format(pysrc_base_name)]) + else: + unit.onfbs_to_py2src([pysrc_base_name] + [path for path, _ in fbss]) + unit.onsrcs(['GLOBAL', '{}.py2.fbs.pysrc'.format(pysrc_base_name)]) def _check_test_srcs(*args): diff --git a/build/ymake.core.conf b/build/ymake.core.conf index c5a48a78e6..3f1a1e9e26 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -953,7 +953,11 @@ _PY_FBS_DEPS=contrib/python/flatbuffers ### processed when --add-flatbuf-result flag is specified on the command line ### for 'ya make ...' (tar archive is extracted to output directory). macro FBS_TO_PYSRC(OUT_NAME, IN_FBS_FILES...) { - .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --python --gen-mutable ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR} ${input:IN_FBS_FILES} && $YMAKE_PYTHON3 ${input:"build/scripts/tar_sources.py"} --exts .py --input $BINDIR --output ${output;noauto;tared:OUT_NAME.fbs.pysrc} ${kv;hide:"p FP"} ${kv;hide:"pc light-green"} ${kv;hide:"tared_kind nodir"} + .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --python --gen-mutable ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR} ${input:IN_FBS_FILES} && $YMAKE_PYTHON3 ${input:"build/scripts/tar_sources.py"} --exts .py --input $BINDIR --output ${output;noauto;tared:OUT_NAME.py3.fbs.pysrc} ${kv;hide:"p FP"} ${kv;hide:"pc light-green"} ${kv;hide:"tared_kind nodir"} +} + +macro FBS_TO_PY2SRC(OUT_NAME, IN_FBS_FILES...) { + .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/deprecated/flatc"} --python --gen-mutable ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR} ${input:IN_FBS_FILES} && $YMAKE_PYTHON3 ${input:"build/scripts/tar_sources.py"} --exts .py --input $BINDIR --output ${output;noauto;tared:OUT_NAME.py2.fbs.pysrc} ${kv;hide:"p FP"} ${kv;hide:"pc light-green"} ${kv;hide:"tared_kind nodir"} } # tag:fbs tag:go-specific |