diff options
author | iniklyaev <iniklyaev@yandex-team.com> | 2024-11-18 09:20:42 +0300 |
---|---|---|
committer | iniklyaev <iniklyaev@yandex-team.com> | 2024-11-18 09:33:24 +0300 |
commit | 5111ad584756ce8d369dee46319b232b0b6abce2 (patch) | |
tree | 23bb9251940f17eff673745aa9a283511e666467 /build/conf | |
parent | 0868f381344a3ff1c5ad6e1ec566960ac51e301b (diff) | |
download | ydb-5111ad584756ce8d369dee46319b232b0b6abce2.tar.gz |
PROTO_SCHEMA() module
commit_hash:3c9b927dbb3ddefcaa455eccb51ae1ded847c736
Diffstat (limited to 'build/conf')
-rw-r--r-- | build/conf/go.conf | 12 | ||||
-rw-r--r-- | build/conf/java.conf | 6 | ||||
-rw-r--r-- | build/conf/proto.conf | 390 | ||||
-rw-r--r-- | build/conf/python.conf | 14 | ||||
-rw-r--r-- | build/conf/ts/ts.conf | 2 | ||||
-rw-r--r-- | build/conf/ts/ts_test.conf | 8 |
6 files changed, 263 insertions, 169 deletions
diff --git a/build/conf/go.conf b/build/conf/go.conf index ab87169dd4..4943bce8c0 100644 --- a/build/conf/go.conf +++ b/build/conf/go.conf @@ -225,17 +225,17 @@ GO_TOOL=$YMAKE_PYTHON3 ${input:"build/scripts/go_tool.py"} $_PROCESS_WHOLE_ARCHI # tag:go-specific macro _GO_LINK_LIB_IMPL(CGO_FILES[], EXTRA_INPUTS[], EXTRA_TEXT_INPUTS[], GO_FILES...) { - .CMD=${hide:_GO_FAKEID} $GO_TOOL ${hide;input:EXTRA_INPUTS} ${hide;context=TEXT;input:EXTRA_TEXT_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_FBS:PEERS} --ya-end-command-file ${hide;kv:"p GO"} ${hide;kv:"pc light-red"} ${hide;kv:"show_out"} + .CMD=${hide:_GO_FAKEID} $GO_TOOL ${hide;input:EXTRA_INPUTS} ${hide;context=TEXT;input:EXTRA_TEXT_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_PROTO_FROM_SCHEMA|local,GO_FBS:PEERS} --ya-end-command-file ${hide;kv:"p GO"} ${hide;kv:"pc light-red"} ${hide;kv:"show_out"} } # tag:go-specific macro _GO_LINK_EXE_IMPL(CGO_FILES[], EXTRA_INPUTS[], EXTRA_TEXT_INPUTS[], GO_FILES...) { - .CMD=${hide:_GO_FAKEID} $GO_TOOL ${hide;input:EXTRA_INPUTS} ${hide;context=TEXT;input:EXTRA_TEXT_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++vcs $VCS_GO $GO_WITH_MUSL $GO_EXTLD ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_FBS:PEERS} ++non-local-peers ${rootrel;tags_in=GO|GO_PROTO|GO_FBS|;tags_out=local:PEERS} ++cgo-peers ${VCS_C_OBJ_RR} ${_EXTRA_OBJS} ${rootrel;tags_out=GO|GO_PROTO|GO_FBS|RESOURCE_LIB:PEERS} --ya-end-command-file ${hide;kv:"p LD"} ${hide;kv:"pc light-red"} ${hide;kv:"show_out"} && $_GO_LINK_EXE_EXT_CMD + .CMD=${hide:_GO_FAKEID} $GO_TOOL ${hide;input:EXTRA_INPUTS} ${hide;context=TEXT;input:EXTRA_TEXT_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++vcs $VCS_GO $GO_WITH_MUSL $GO_EXTLD ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_PROTO_FROM_SCHEMA|local,GO_FBS:PEERS} ++non-local-peers ${rootrel;tags_in=GO|GO_PROTO|GO_PROTO_FROM_SCHEMA|GO_FBS|;tags_out=local:PEERS} ++cgo-peers ${VCS_C_OBJ_RR} ${_EXTRA_OBJS} ${rootrel;tags_out=GO|GO_PROTO|GO_PROTO_FROM_SCHEMA|GO_FBS|RESOURCE_LIB:PEERS} --ya-end-command-file ${hide;kv:"p LD"} ${hide;kv:"pc light-red"} ${hide;kv:"show_out"} && $_GO_LINK_EXE_EXT_CMD } # tag:go-specific macro _GO_LINK_TEST_IMPL(CGO_FILES[], EXTRA_INPUTS[], EXTRA_TEXT_INPUTS[], GO_TEST_FILES[], GO_XTEST_FILES[], GO_FILES...) { - .CMD=${hide:_GO_FAKEID} $GO_TOOL ${hide;input:EXTRA_INPUTS} ${hide;context=TEXT;input:EXTRA_TEXT_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++vcs $VCS_GO $GO_WITH_MUSL $GO_EXTLD ++test-miner $GO_TEST_MINER ++test-import-path $GO_TEST_IMPORT_PATH ++peers ${rootrel;tags_in=local,GO|local,GO_PROGRAM|local,GO_PROTO|local,GO_FBS:PEERS} ++non-local-peers ${rootrel;tags_in=GO|GO_PROTO|GO_FBS;tags_out=local:PEERS} ++cgo-peers ${VCS_C_OBJ_RR} ${rootrel;tags_out=GO|GO_PROGRAM|GO_PROTO|GO_FBS|RESOURCE_LIB:PEERS} ++test_srcs ${input:GO_TEST_FILES} ++xtest_srcs ${input:GO_XTEST_FILES} ++cover_info $GO_COVER_INFO_VALUE ++skip-tests $_GO_SKIP_TEST_VALUE --ya-end-command-file ${hide;kv:"p GO"} ${hide;kv:"pc light-red"} ${hide;kv:"show_out"} + .CMD=${hide:_GO_FAKEID} $GO_TOOL ${hide;input:EXTRA_INPUTS} ${hide;context=TEXT;input:EXTRA_TEXT_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++vcs $VCS_GO $GO_WITH_MUSL $GO_EXTLD ++test-miner $GO_TEST_MINER ++test-import-path $GO_TEST_IMPORT_PATH ++peers ${rootrel;tags_in=local,GO|local,GO_PROGRAM|local,GO_PROTO|local,GO_PROTO_FROM_SCHEMA|local,GO_FBS:PEERS} ++non-local-peers ${rootrel;tags_in=GO|GO_PROTO|GO_PROTO_FROM_SCHEMA|GO_FBS;tags_out=local:PEERS} ++cgo-peers ${VCS_C_OBJ_RR} ${rootrel;tags_out=GO|GO_PROGRAM|GO_PROTO|GO_PROTO_FROM_SCHEMA|GO_FBS|RESOURCE_LIB:PEERS} ++test_srcs ${input:GO_TEST_FILES} ++xtest_srcs ${input:GO_XTEST_FILES} ++cover_info $GO_COVER_INFO_VALUE ++skip-tests $_GO_SKIP_TEST_VALUE --ya-end-command-file ${hide;kv:"p GO"} ${hide;kv:"pc light-red"} ${hide;kv:"show_out"} } # tag:go-specific @@ -649,7 +649,7 @@ module _GO_BASE_UNIT: _BASE_UNIT { ENABLE(_GO_MODULE) SET(MODULE_TAG GO) - SET(PEERDIR_TAGS GO GO_PROTO GO_FBS __EMPTY__ RESOURCE_LIB) + SET(PEERDIR_TAGS GO GO_PROTO GO_PROTO_FROM_SCHEMA GO_FBS __EMPTY__ RESOURCE_LIB) DEFAULT(_GO_VET_TOOL) DEFAULT(_GO_VET_FLAGS) DEFAULT(_GO_VET_EXTS) @@ -815,7 +815,7 @@ module GO_LIBRARY: _GO_BASE_UNIT { .FINAL_TARGET=no SET(_GO_TOOL_MODE lib) SET(MODULE_TYPE LIBRARY) - SET(PEERDIR_TAGS GO GO_PROTO GO_FBS __EMPTY__ RESOURCE_LIB PACKAGE_UNION) + SET(PEERDIR_TAGS GO GO_PROTO GO_PROTO_FROM_SCHEMA GO_FBS __EMPTY__ RESOURCE_LIB PACKAGE_UNION) MODULE_SUFFIX=.a } @@ -956,7 +956,7 @@ module GO_TEST: GO_PROGRAM { .ALLOWED=GO_SKIP_TESTS YT_SPEC .FINAL_TARGET=no SET(MODULE_TAG GO_TEST) - SET(PEERDIR_TAGS GO GO_PROGRAM GO_PROTO GO_FBS __EMPTY__ RESOURCE_LIB) + SET(PEERDIR_TAGS GO GO_PROGRAM GO_PROTO GO_PROTO_FROM_SCHEMA GO_FBS __EMPTY__ RESOURCE_LIB) SET(_GO_TOOL_MODE test) SET(MODULE_TYPE PROGRAM) ENABLE(GO_TEST_MODULE) diff --git a/build/conf/java.conf b/build/conf/java.conf index d029f6a379..4a7d5df844 100644 --- a/build/conf/java.conf +++ b/build/conf/java.conf @@ -375,7 +375,7 @@ module EXTERNAL_JAVA_LIBRARY: _BASE_UNIT { MAVEN_EXPORT_COORDS_GLOBAL=$MAVEN_EXPORT_GROUP_ID:${MODULE_PREFIX}${REALPRJNAME}:${MAVEN_EXPORT_VERSION}: } - PEERDIR_TAGS=JAVA JAVA_PROTO JAVA_FBS JAVA_IDL PACKAGE_UNION + PEERDIR_TAGS=JAVA JAVA_PROTO JAVA_PROTO_FROM_SCHEMA JAVA_FBS JAVA_IDL PACKAGE_UNION HAS_MANAGEABLE_PEERS=yes DYNAMIC_LINK=yes _PROTO_CMDLINE=$_JAVA_PROTO_CMDLINE @@ -563,7 +563,7 @@ module _JAR_BASE: _BARE_UNIT { SET(MODULE_TAG JAVA) - PEERDIR_TAGS=JAVA JAVA_PROTO JAVA_FBS JAVA_IDL DLL JAR_COMPILATION __EMPTY__ RESOURCE_LIB + PEERDIR_TAGS=JAVA JAVA_PROTO JAVA_PROTO_FROM_SCHEMA JAVA_FBS JAVA_IDL DLL JAR_COMPILATION __EMPTY__ RESOURCE_LIB HAS_MANAGEABLE_PEERS=yes DYNAMIC_LINK=yes @@ -2087,7 +2087,7 @@ module JSRC_LIBRARY: _BARE_UNIT { .PEERDIR_POLICY=as_include .FINAL_TARGET=no .ALIASES=SRCS=FILES - PEERDIR_TAGS=JAVA JAVA_PROTO JAVA_FBS JAVA_IDL + PEERDIR_TAGS=JAVA JAVA_PROTO JAVA_PROTO_FROM_SCHEMA JAVA_FBS JAVA_IDL MODULE_TYPE=LIBRARY SET(MODULE_SUFFIX .jsrc) SET(DONT_RESOLVE_INCLUDES yes) diff --git a/build/conf/proto.conf b/build/conf/proto.conf index a55bfbe7bd..17704bdfd0 100644 --- a/build/conf/proto.conf +++ b/build/conf/proto.conf @@ -655,6 +655,162 @@ CPP_PROTO_LIBRARY_SEM=$CPP_LIBRARY_SEM JAVA_PROTO_LIBRARY_SEM=$BUILD_PROTO_JAR_SEM $_GRADLE_EXPORT_PUBLISHING_SEM +module _CPP_PROTO : LIBRARY { + .ALLOWED=_EXPOSE LIST_PROTO + # TODO(svidyuk): think about marker which forces semantics inheritance + .SEM=CPP_PROTO_LIBRARY_SEM + FORCE_COVERAGE_DISABLED=yes + ENABLE(CPP_PROTO) + ENABLE(GEN_PROTO) + NO_CLANG_TIDY() + CPP_PROTOLIBS_DEBUG_INFO() + SET(PEERDIR_TAGS) + + when ($BUILD_PROTO_AS_EVLOG == "yes" && $USE_VANILLA_PROTOC == "yes") { + _OK=no + } + ASSERT(_OK BUILD_PROTO_AS_EVLOG and USE_VANILLA_PROTOC are incompatible yet) + + MODULE_SUFFIX=$_CPP_PROTO_MODULE_SUFFIX + MODULE_PREFIX=$_CPP_PROTO_MODULE_PREFIX + + when ($_COMMON_GOOGLE_APIS != "None") { + PEERDIR += contrib/libs/googleapis-common-protos + } +} + +module _JAVA_PROTO: EXTERNAL_JAVA_LIBRARY { + .EXTS=.jsrc + .ALLOWED=GRPC + .SEM=JAVA_PROTO_LIBRARY_SEM + SET(PEERDIR_TAGS JAVA) + ENABLE(JAVA_PROTO) + DISABLE(_NEED_SBOM_INFO) + PEERDIR+=$JAVA_PROTOBUF_PEERS + + when ($KOTLIN_PROTO == "yes") { + KOTLIN_PROTO_PEERS=contrib/java/com/google/protobuf/protobuf-kotlin/${JAVA_PROTO_RUNTIME_VERSION} + KOTLIN_PROTO_FLAGS=--kotlin_out=$ARCADIA_BUILD_ROOT/java_out + } + when ($GRADLE_EXPORT_PUBLISHING == "yes") { + _GRADLE_EXPORT_PUBLISHING_SEM=$_DO_GRADLE_EXPORT_PUBLISHING_SEM + } + + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_SKIFF CPP_PROTO_PLUGIN2 PY_PROTO_PLUGIN YMAPS_SPROTO RESOURCE + ADDINCL(FOR proto $PROTOBUF_INCLUDE_PATH) + + when ($_COMMON_GOOGLE_APIS != "None") { + PEERDIR += contrib/java/com/google/api/grpc/proto-google-common-protos/${JAVA_PROTO_COMMON_VERSION} + ADDINCL += GLOBAL FOR proto ${ARCADIA_ROOT}/contrib/libs/googleapis-common-protos + } +} + +module _PY_PROTO: PY2_LIBRARY { + .ALIASES=SRCS=PY_SRCS + .ALLOWED=OPTIMIZE_PY_PROTOS NO_OPTIMIZE_PY_PROTOS + .SEM=IGNORED + SET(PEERDIR_TAGS PY2) + ENABLE(PY_PROTO) + DISABLE(_NEED_SBOM_INFO) + OPTIMIZE_PY_PROTOS() + OBJ_SUF=.py2 + # Can not use NO_LINT(), because is not allowed outside of contrib directory + SET(_NO_LINT_VALUE none_internal) + + when ($_COMMON_GOOGLE_APIS != "None") { + PEERDIR += contrib/libs/googleapis-common-protos + } + + _IGNORE_SELF_PEERS= + _CPP_PROTO_LIBRARY=${MODDIR}/$_CPP_PROTO_MODULE_PREFIX$REALPRJNAME$_CPP_PROTO_MODULE_SUFFIX + when ($OPTIMIZE_PY_PROTOS_FLAG == "no") { + _IGNORE_PEERDIRSELF=CPP_PROTO + } + SET_APPEND(_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL $_CPP_PROTO_LIBRARY) +} + +module _PY3_PROTO: PY3_LIBRARY { + .ALIASES=SRCS=PY_SRCS + .ALLOWED=OPTIMIZE_PY_PROTOS NO_OPTIMIZE_PY_PROTOS + .SEM=IGNORED + SET(PEERDIR_TAGS PY3) + ENABLE(PY3_PROTO) + DISABLE(_NEED_SBOM_INFO) + OPTIMIZE_PY_PROTOS() + OBJ_SUF=.py3 + # Can not use NO_LINT(), because is not allowed outside of contrib directory + SET(_NO_LINT_VALUE none_internal) + + when ($_COMMON_GOOGLE_APIS != "None") { + PEERDIR += contrib/libs/googleapis-common-protos + } + + _IGNORE_SELF_PEERS= + _CPP_PROTO_LIBRARY=${MODDIR}/$_CPP_PROTO_MODULE_PREFIX$REALPRJNAME$_CPP_PROTO_MODULE_SUFFIX + when ($OPTIMIZE_PY_PROTOS_FLAG == "no") { + _IGNORE_PEERDIRSELF=CPP_PROTO + } + SET_APPEND(_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL $_CPP_PROTO_LIBRARY) +} + +module _GO_PROTO: GO_LIBRARY { + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER YMAPS_SPROTO + .SEM=IGNORED + SET(PEERDIR_TAGS GO) + ENABLE(GO_PROTO) + + when ($_COMMON_GOOGLE_APIS == "None") { + } + elsewhen ($_COMMON_GOOGLE_APIS == "") { + PEERDIR += $_GO_COMMON_GOOGLE_APIS + ADDINCL += GLOBAL FOR proto ${ARCADIA_ROOT}/contrib/libs/googleapis-common-protos + } + otherwise { + PEERDIR += $_COMMON_GOOGLE_APIS + ADDINCL += GLOBAL FOR proto ${ARCADIA_ROOT}/contrib/libs/googleapis-common-protos + } +} + +module _TS_PROTO: _TS_PROTO_IMPL { + DISABLE(_NEED_SBOM_INFO) +} + +module _TS_PREPARE_DEPS: _PREPARE_DEPS_BASE { + .IGNORED=PEERDIR + DISABLE(_NEED_SBOM_INFO) +} + +module _DESC_PROTO: _BARE_UNIT { + .CMD=_PROTO_DESC_MERGE_CMD + .SEM=IGNORED + .EXTS=.desc .rawproto + .NODE_TYPE=Library + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER YMAPS_SPROTO RESOURCE GO_PROTO_PLUGIN GRPC + .ALIASES=SRCS=_SRCS_NO_GLOBAL + + ENABLE(DESC_PROTO) + DISABLE(_NEED_SBOM_INFO) + MODULE_SUFFIX=.self.protodesc + SET(MODULE_TYPE LIBRARY) + SET(_MODDIR_HASH ${hash:MODDIR}) + + _EVLOG_CMDLINE=$_PROTO_DESC_CMDLINE + _PROTO_CMDLINE=$_PROTO_DESC_CMDLINE + + when ($_COMMON_GOOGLE_APIS != "None") { + PEERDIR += contrib/libs/googleapis-common-protos + } + + when ($NEED_GOOGLE_PROTO_PEERDIRS == "yes") { + when ($USE_VANILLA_PROTOC == "yes") { + PEERDIR += contrib/libs/protobuf_std/builtin_proto/protos_from_protobuf + } + otherwise { + PEERDIR += contrib/libs/protobuf/builtin_proto/protos_from_protoc + } + } +} + # tag:proto ### @usage: PROTO_LIBRARY() ### @@ -674,173 +830,44 @@ JAVA_PROTO_LIBRARY_SEM=$BUILD_PROTO_JAR_SEM $_GRADLE_EXPORT_PUBLISHING_SEM ### ### See: [GRPC()](#macro_GRPC), [OPTIMIZE_PY_PROTOS()](#macro_OPTIMIZE_PY_PROTOS), [INCLUDE_TAGS()](#macro_INCLUDE_TAGS), [EXCLUDE_TAGS()](#macro_EXCLUDE_TAGS) multimodule PROTO_LIBRARY { - module CPP_PROTO : LIBRARY { - .ALLOWED=_EXPOSE LIST_PROTO - # TODO(svidyuk): think about marker which forces semantics inheritance - .SEM=CPP_PROTO_LIBRARY_SEM - FORCE_COVERAGE_DISABLED=yes - ENABLE(CPP_PROTO) - ENABLE(GEN_PROTO) - NO_CLANG_TIDY() - CPP_PROTOLIBS_DEBUG_INFO() - SET(PEERDIR_TAGS CPP_PROTO) - - when ($BUILD_PROTO_AS_EVLOG == "yes" && $USE_VANILLA_PROTOC == "yes") { - _OK=no - } - ASSERT(_OK BUILD_PROTO_AS_EVLOG and USE_VANILLA_PROTOC are incompatible yet) - - MODULE_SUFFIX=$_CPP_PROTO_MODULE_SUFFIX - MODULE_PREFIX=$_CPP_PROTO_MODULE_PREFIX - - when ($_COMMON_GOOGLE_APIS != "None") { - PEERDIR += contrib/libs/googleapis-common-protos - } + module CPP_PROTO: _CPP_PROTO { + SET_APPEND(PEERDIR_TAGS CPP_PROTO) } - module JAVA_PROTO: EXTERNAL_JAVA_LIBRARY { - .EXTS=.jsrc - .ALLOWED=GRPC - .SEM=JAVA_PROTO_LIBRARY_SEM - SET(PEERDIR_TAGS JAVA JAVA_PROTO) - ENABLE(JAVA_PROTO) - DISABLE(_NEED_SBOM_INFO) - PEERDIR+=$JAVA_PROTOBUF_PEERS - - when ($KOTLIN_PROTO == "yes") { - KOTLIN_PROTO_PEERS=contrib/java/com/google/protobuf/protobuf-kotlin/${JAVA_PROTO_RUNTIME_VERSION} - KOTLIN_PROTO_FLAGS=--kotlin_out=$ARCADIA_BUILD_ROOT/java_out - } - when ($GRADLE_EXPORT_PUBLISHING == "yes") { - _GRADLE_EXPORT_PUBLISHING_SEM=$_DO_GRADLE_EXPORT_PUBLISHING_SEM - } - - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_SKIFF CPP_PROTO_PLUGIN2 PY_PROTO_PLUGIN YMAPS_SPROTO RESOURCE - ADDINCL(FOR proto $PROTOBUF_INCLUDE_PATH) - - when ($_COMMON_GOOGLE_APIS != "None") { - PEERDIR += contrib/java/com/google/api/grpc/proto-google-common-protos/${JAVA_PROTO_COMMON_VERSION} - ADDINCL += GLOBAL FOR proto ${ARCADIA_ROOT}/contrib/libs/googleapis-common-protos - } + module JAVA_PROTO: _JAVA_PROTO { + SET_APPEND(PEERDIR_TAGS JAVA_PROTO) } - module PY_PROTO: PY2_LIBRARY { - .ALIASES=SRCS=PY_SRCS - .ALLOWED=OPTIMIZE_PY_PROTOS NO_OPTIMIZE_PY_PROTOS + module PY_PROTO: _PY_PROTO { + SET_APPEND(PEERDIR_TAGS PY_PROTO) .PEERDIRSELF=CPP_PROTO - .SEM=IGNORED - SET(PEERDIR_TAGS PY2 PY_PROTO) - ENABLE(PY_PROTO) - DISABLE(_NEED_SBOM_INFO) - OPTIMIZE_PY_PROTOS() - OBJ_SUF=.py2 - # Can not use NO_LINT(), because is not allowed outside of contrib directory - SET(_NO_LINT_VALUE none_internal) - - when ($_COMMON_GOOGLE_APIS != "None") { - PEERDIR += contrib/libs/googleapis-common-protos - } - - _IGNORE_SELF_PEERS= - _CPP_PROTO_LIBRARY=${MODDIR}/$_CPP_PROTO_MODULE_PREFIX$REALPRJNAME$_CPP_PROTO_MODULE_SUFFIX - when ($OPTIMIZE_PY_PROTOS_FLAG == "no") { - _IGNORE_PEERDIRSELF=CPP_PROTO - } - SET_APPEND(_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL $_CPP_PROTO_LIBRARY) } - module PY3_PROTO: PY3_LIBRARY { - .ALIASES=SRCS=PY_SRCS - .ALLOWED=OPTIMIZE_PY_PROTOS NO_OPTIMIZE_PY_PROTOS + module PY3_PROTO: _PY3_PROTO { + SET_APPEND(PEERDIR_TAGS PY3_PROTO) .PEERDIRSELF=CPP_PROTO - .SEM=IGNORED - SET(PEERDIR_TAGS PY3 PY3_PROTO) - ENABLE(PY3_PROTO) - DISABLE(_NEED_SBOM_INFO) - OPTIMIZE_PY_PROTOS() - OBJ_SUF=.py3 - # Can not use NO_LINT(), because is not allowed outside of contrib directory - SET(_NO_LINT_VALUE none_internal) - - when ($_COMMON_GOOGLE_APIS != "None") { - PEERDIR += contrib/libs/googleapis-common-protos - } - - _IGNORE_SELF_PEERS= - _CPP_PROTO_LIBRARY=${MODDIR}/$_CPP_PROTO_MODULE_PREFIX$REALPRJNAME$_CPP_PROTO_MODULE_SUFFIX - when ($OPTIMIZE_PY_PROTOS_FLAG == "no") { - _IGNORE_PEERDIRSELF=CPP_PROTO - } - SET_APPEND(_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL $_CPP_PROTO_LIBRARY) } - module GO_PROTO: GO_LIBRARY { - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER YMAPS_SPROTO - .SEM=IGNORED - SET(PEERDIR_TAGS GO GO_PROTO) - ENABLE(GO_PROTO) - - when ($_COMMON_GOOGLE_APIS == "None") { - } - elsewhen ($_COMMON_GOOGLE_APIS == "") { - PEERDIR += $_GO_COMMON_GOOGLE_APIS - ADDINCL += GLOBAL FOR proto ${ARCADIA_ROOT}/contrib/libs/googleapis-common-protos - } - otherwise { - PEERDIR += $_COMMON_GOOGLE_APIS - ADDINCL += GLOBAL FOR proto ${ARCADIA_ROOT}/contrib/libs/googleapis-common-protos - } + module GO_PROTO: _GO_PROTO { + SET_APPEND(PEERDIR_TAGS GO_PROTO) } - module TS_PROTO: _TS_PROTO_IMPL { + module TS_PROTO: _TS_PROTO { # opt-in. We don't want to have TS_PROTO by default # To include TS_PROTO user have to set INCLUDE_TAGS(TS_PROTO TS_PREPARE_DEPS) in ya.make .INCLUDE_TAG=no - .EPILOGUE=_TS_CONFIG_EPILOGUE .PEERDIRSELF=TS_PREPARE_DEPS - DISABLE(_NEED_SBOM_INFO) - - when ($_COMMON_GOOGLE_APIS != "None") { - PEERDIR += contrib/libs/googleapis-common-protos - } + .EPILOGUE=_TS_CONFIG_EPILOGUE + SET_APPEND(PEERDIR_TAGS TS_PROTO) } - module TS_PREPARE_DEPS: _PREPARE_DEPS_BASE { + module TS_PREPARE_DEPS: _TS_PREPARE_DEPS { .INCLUDE_TAG=no - .IGNORED=PEERDIR SRCS GENERATE_ENUM_SERIALIZATION - DISABLE(_NEED_SBOM_INFO) - } - - module DESC_PROTO: _BARE_UNIT { - .CMD=_PROTO_DESC_MERGE_CMD - .SEM=IGNORED - .EXTS=.desc .rawproto - .NODE_TYPE=Library - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER YMAPS_SPROTO RESOURCE GO_PROTO_PLUGIN GRPC - .ALIASES=SRCS=_SRCS_NO_GLOBAL - - SET(PEERDIR_TAGS DESC_PROTO) - ENABLE(DESC_PROTO) - DISABLE(_NEED_SBOM_INFO) - MODULE_SUFFIX=.self.protodesc - SET(MODULE_TYPE LIBRARY) - SET(_MODDIR_HASH ${hash:MODDIR}) - - _EVLOG_CMDLINE=$_PROTO_DESC_CMDLINE - _PROTO_CMDLINE=$_PROTO_DESC_CMDLINE - - when ($_COMMON_GOOGLE_APIS != "None") { - PEERDIR += contrib/libs/googleapis-common-protos - } + SET_APPEND(PEERDIR_TAGS TS_PREPARE_DEPS) + } - when ($NEED_GOOGLE_PROTO_PEERDIRS == "yes") { - when ($USE_VANILLA_PROTOC == "yes") { - PEERDIR += contrib/libs/protobuf_std/builtin_proto/protos_from_protobuf - } - otherwise { - PEERDIR += contrib/libs/protobuf/builtin_proto/protos_from_protoc - } - } + module DESC_PROTO: _DESC_PROTO { + SET_APPEND(PEERDIR_TAGS DESC_PROTO) } } @@ -852,7 +879,7 @@ module PROTO_DESCRIPTIONS: _BARE_UNIT { .FINAL_TARGET=yes SET(MODULE_TAG PROTO_DESCRIPTIONS) - SET(PEERDIR_TAGS DESC_PROTO) + SET(PEERDIR_TAGS DESC_PROTO DESC_PROTO_FROM_SCHEMA) SET(MODULE_SUFFIX .protodesc) SET(MODULE_TYPE PROTO_DESCRIPTIONS) } @@ -862,6 +889,73 @@ module PROTO_REGISTRY: PROTO_DESCRIPTIONS { SET(MODULE_TYPE PROTO_REGISTRY) } +# tag:proto +### @usage: PROTO_SCHEMA() +### +### Build some variant of protocol buffers library or proto descriptions. +### +### When used as a PEERDIR from a language module like GO_PROGRAM it behaves like PROTO_LIBRARY. +### When built directly it produces proto descriptions. When required by RECURSE it produces +### both proto descriptions and language libraries. +### PROTO_SCHEMA can depend on PROTO_LIBRARY, but PROTO_LIBRARY cannot depend on PROTO_SCHEMA. +### +### See: [PROTO_LIBRARY()](#module_PROTO_LIBRARY) +multimodule PROTO_SCHEMA { + module CPP_PROTO_FROM_SCHEMA: _CPP_PROTO { + DISABLE(START_TARGET) + SET_APPEND(PEERDIR_TAGS CPP_PROTO CPP_PROTO_FROM_SCHEMA) + } + + module JAVA_PROTO_FROM_SCHEMA: _JAVA_PROTO { + DISABLE(START_TARGET) + SET_APPEND(PEERDIR_TAGS JAVA_PROTO JAVA_PROTO_FROM_SCHEMA) + } + + module PY_PROTO_FROM_SCHEMA: _PY_PROTO { + .PEERDIRSELF=CPP_PROTO_FROM_SCHEMA + DISABLE(START_TARGET) + SET_APPEND(PEERDIR_TAGS PY_PROTO PY_PROTO_FROM_SCHEMA) + } + + module PY3_PROTO_FROM_SCHEMA: _PY3_PROTO { + .PEERDIRSELF=CPP_PROTO_FROM_SCHEMA + DISABLE(START_TARGET) + SET_APPEND(PEERDIR_TAGS PY3_PROTO PY3_PROTO_FROM_SCHEMA) + } + + module GO_PROTO_FROM_SCHEMA: _GO_PROTO { + DISABLE(START_TARGET) + SET_APPEND(PEERDIR_TAGS GO_PROTO GO_PROTO_FROM_SCHEMA) + } + + module TS_PROTO_FROM_SCHEMA: _TS_PROTO { + # opt-in. We don't want to have TS_PROTO by default + # To include TS_PROTO user have to set INCLUDE_TAGS(TS_PROTO TS_PREPARE_DEPS) in ya.make + .INCLUDE_TAG=no + .PEERDIRSELF=TS_PREPARE_DEPS_FROM_SCHEMA + .EPILOGUE=_TS_CONFIG_EPILOGUE + DISABLE(START_TARGET) + SET_APPEND(PEERDIR_TAGS TS_PROTO TS_PROTO_FROM_SCHEMA) + } + + module TS_PREPARE_DEPS_FROM_SCHEMA: _TS_PREPARE_DEPS { + .INCLUDE_TAG=no + DISABLE(START_TARGET) + SET_APPEND(PEERDIR_TAGS TS_PREPARE_DEPS TS_PREPARE_DEPS_FROM_SCHEMA) + } + + module DESC_PROTO_FROM_SCHEMA: _DESC_PROTO { + DISABLE(START_TARGET) + SET_APPEND(PEERDIR_TAGS DESC_PROTO DESC_PROTO_FROM_SCHEMA) + } + + module PROTO_DESCRIPTIONS_: PROTO_DESCRIPTIONS { + .PEERDIRSELF=DESC_PROTO_FROM_SCHEMA + .FINAL_TARGET=yes + SET_APPEND(PEERDIR_TAGS DESC_PROTO_FROM_SCHEMA) + } +} + macro EVLOG_CMD(SRC) { .CMD=$_EVLOG_CMDLINE .SEM=$_EVLOG_CMDLINE diff --git a/build/conf/python.conf b/build/conf/python.conf index 214687990b..34786b2c53 100644 --- a/build/conf/python.conf +++ b/build/conf/python.conf @@ -559,7 +559,7 @@ module _PY_PACKAGE: UNION { .ALLOWED=GRPC USE_SKIFF .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER ENABLE(PY_PROTOS_FOR) - SET(PEERDIR_TAGS PY_PROTO) + SET(PEERDIR_TAGS PY_PROTO PY_PROTO_FROM_SCHEMA) SET(DONT_RESOLVE_INCLUDES no) } @@ -833,7 +833,7 @@ macro NO_PYTHON_INCLUDES() { macro PYTHON2_ADDINCL() { _PYTHON_ADDINCL() SET(MODULE_TAG PY2_NATIVE) - SET(PEERDIR_TAGS CPP_PROTO CPP_FBS CPP_ROS PY2_NATIVE YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) + SET(PEERDIR_TAGS CPP_PROTO CPP_PROTO_FROM_SCHEMA CPP_FBS CPP_ROS PY2_NATIVE YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) } # tag:python-specific tag:internal @@ -842,7 +842,7 @@ macro PYTHON2_ADDINCL() { macro _ARCADIA_PYTHON_ADDINCL() { _PYTHON_ADDINCL() SET(MODULE_TAG PY2) - SET(PEERDIR_TAGS PY2 PY2_NATIVE PY_PROTO PY2_FBS YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) + SET(PEERDIR_TAGS PY2 PY2_NATIVE PY_PROTO PY_PROTO_FROM_SCHEMA PY2_FBS YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) } # tag:python-specific tag:internal @@ -881,7 +881,7 @@ macro _PYTHON_ADDINCL() { macro PYTHON3_ADDINCL() { _PYTHON3_ADDINCL() SET(MODULE_TAG PY3_NATIVE) - SET(PEERDIR_TAGS CPP_PROTO CPP_FBS CPP_ROS PY3_NATIVE YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) + SET(PEERDIR_TAGS CPP_PROTO CPP_PROTO_FROM_SCHEMA CPP_FBS CPP_ROS PY3_NATIVE YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) } # tag:python-specific tag:internal @@ -891,7 +891,7 @@ macro PYTHON3_ADDINCL() { macro _ARCADIA_PYTHON3_ADDINCL() { _PYTHON3_ADDINCL() SET(MODULE_TAG PY3) - SET(PEERDIR_TAGS PY3 PY3_BIN_LIB PY3TEST_LIBRARY PY3_NATIVE PY3_PROTO PY3_FBS PY3_ROS YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) + SET(PEERDIR_TAGS PY3 PY3_BIN_LIB PY3TEST_LIBRARY PY3_NATIVE PY3_PROTO PY3_PROTO_FROM_SCHEMA PY3_FBS PY3_ROS YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) } # tag:python-specific tag:internal @@ -929,7 +929,7 @@ macro _PYTHON3_ADDINCL() { ### @see: [PY2_LIBRARY](#module_PY2_LIBRARY), [PY3_LIBRARY](#module_PY3_LIBRARY), [PY23_LIBRARY](#multimodule_PY23_LIBRARY) macro USE_PYTHON2() { _ARCADIA_PYTHON_ADDINCL() - SET(PEERDIR_TAGS PY2 PY2_NATIVE CPP_PROTO CPP_FBS CPP_ROS YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) + SET(PEERDIR_TAGS PY2 PY2_NATIVE CPP_PROTO CPP_PROTO_FROM_SCHEMA CPP_FBS CPP_ROS YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) PEERDIR(contrib/libs/python) } @@ -946,7 +946,7 @@ macro USE_PYTHON2() { ### @see: [PY2_LIBRARY](#module_PY2_LIBRARY), [PY3_LIBRARY](#module_PY3_LIBRARY), [PY23_LIBRARY](#multimodule_PY23_LIBRARY) macro USE_PYTHON3() { _ARCADIA_PYTHON3_ADDINCL() - SET(PEERDIR_TAGS PY3 PY3_BIN_LIB PY3TEST_LIBRARY PY3_NATIVE CPP_PROTO CPP_FBS CPP_ROS YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) + SET(PEERDIR_TAGS PY3 PY3_BIN_LIB PY3TEST_LIBRARY PY3_NATIVE CPP_PROTO CPP_PROTO_FROM_SCHEMA CPP_FBS CPP_ROS YQL_UDF_STATIC __EMPTY__ RESOURCE_LIB DLL_LIB) PEERDIR(contrib/libs/python) when ($USE_ARCADIA_PYTHON == "yes") { diff --git a/build/conf/ts/ts.conf b/build/conf/ts/ts.conf index 0fb8cba30d..f3149b3d3c 100644 --- a/build/conf/ts/ts.conf +++ b/build/conf/ts/ts.conf @@ -94,7 +94,7 @@ module _TS_BASE_UNIT: _BARE_UNIT { SET(MODULE_TAG TS) SET(MODULE_LANG TS) # TS should peer to TS - SET(PEERDIR_TAGS TS TS_PROTO) + SET(PEERDIR_TAGS TS TS_PROTO TS_PROTO_FROM_SCHEMA) # .fake tells builder to not materialize it in results SET(MODULE_SUFFIX .ts.fake) diff --git a/build/conf/ts/ts_test.conf b/build/conf/ts/ts_test.conf index be683c6ff1..c468139336 100644 --- a/build/conf/ts/ts_test.conf +++ b/build/conf/ts/ts_test.conf @@ -32,7 +32,7 @@ module TS_TEST_JEST_FOR: _TS_TEST_BASE { .CMD=TS_TEST_JEST_CMD # for multimodule peers we should choose NODE_MODULES - SET(PEERDIR_TAGS TS TS_PROTO) + SET(PEERDIR_TAGS TS TS_PROTO TS_PROTO_FROM_SCHEMA) # compatibility with old TS_TEST_SRCS SET(TS_TEST_EXTENSION test.(ts|tsx|js|jsx)) @@ -67,7 +67,7 @@ module TS_TEST_HERMIONE_FOR: _TS_TEST_BASE { .CMD=TS_TEST_HERMIONE_CMD # for multimodule peers we should choose TS - SET(PEERDIR_TAGS TS TS_PROTO) + SET(PEERDIR_TAGS TS TS_PROTO TS_PROTO_FROM_SCHEMA) # compatibility with old TS_TEST_SRCS SET(TS_TEST_EXTENSION hermione.(ts|js)) @@ -101,7 +101,7 @@ module TS_TEST_PLAYWRIGHT_FOR: _TS_TEST_BASE { .CMD=TS_TEST_PLAYWRIGHT_CMD # for multimodule peers we should choose TS - SET(PEERDIR_TAGS TS TS_PROTO) + SET(PEERDIR_TAGS TS TS_PROTO TS_PROTO_FROM_SCHEMA) # compatibility with old TS_TEST_SRCS SET(TS_TEST_EXTENSION (playwright|spec).(ts|js)) @@ -134,7 +134,7 @@ module TS_TEST_PLAYWRIGHT_LARGE_FOR: _TS_TEST_BASE { .CMD=TS_TEST_PLAYWRIGHT_LARGE_CMD # for multimodule peers we should choose TS - SET(PEERDIR_TAGS TS TS_PROTO) + SET(PEERDIR_TAGS TS TS_PROTO TS_PROTO_FROM_SCHEMA) # compatibility with old TS_TEST_SRCS SET(TS_TEST_EXTENSION (playwright|spec).(ts|js)) |