From 1e1d882ec03da28b2b1ad627b31bf121a8f5758f Mon Sep 17 00:00:00 2001 From: Dmitry Nechitaev Date: Thu, 29 Aug 2024 14:43:41 +0300 Subject: [PATCH] Prepare cpp-protobuf migration (#8443) Co-authored-by: Dmitry Nechitaev --- ydb/library/yql/parser/proto_ast/gen/multiproto.py | 2 +- ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ydb/library/yql/parser/proto_ast/gen/multiproto.py b/ydb/library/yql/parser/proto_ast/gen/multiproto.py index de5b8bf76b94..78019518f003 100644 --- a/ydb/library/yql/parser/proto_ast/gen/multiproto.py +++ b/ydb/library/yql/parser/proto_ast/gen/multiproto.py @@ -73,7 +73,7 @@ def main(argv): if type_name in current_types: out_file.write(line) continue - if line.startswith("static ") or (line.startswith("const ") and ("[]" in line or "=" in line)) or line.startswith("PROTOBUF_ATTRIBUTE_WEAK"): + if line.startswith("static ") or (line.startswith("const ") and ("[]" in line or "=" in line)) or line.startswith("PROTOBUF_ATTRIBUTE_WEAK") or line.startswith("PROTOBUF_ATTRIBUTE_INIT_PRIORITY2"): is_data_stmt = True extern_data = "file_level_metadata" in line or ("descriptor_table" in line and "once" in line) extern_code = line.startswith("PROTOBUF_ATTRIBUTE_WEAK") diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp index 45b0fb76c01d..893fc9eecb18 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include @@ -303,7 +304,11 @@ static int PrintProtoJsonBase64(const T& msg) { const auto status = MessageToJsonString(msg, &json, opts); if (!status.ok()) { + #if PROTOBUF_VERSION >= 4022005 + Cerr << "Error occurred while converting proto to json: " << status.message() << Endl; + #else Cerr << "Error occurred while converting proto to json: " << status.message().ToString() << Endl; + #endif return EXIT_FAILURE; }