Skip to content

Commit

Permalink
Prepare cpp-protobuf migration (#8443)
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitry Nechitaev <nechda@yandex-team.ru>
  • Loading branch information
Nechda and Nechda authored Aug 29, 2024
1 parent acc9844 commit 1e1d882
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ydb/library/yql/parser/proto_ast/gen/multiproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 5 additions & 0 deletions ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <ydb/public/lib/ydb_cli/common/print_utils.h>
#include <ydb/public/lib/ydb_cli/common/scheme_printers.h>
#include <ydb/public/sdk/cpp/client/ydb_proto/accessor.h>
#include <google/protobuf/port_def.inc>

#include <util/string/join.h>

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 1e1d882

Please sign in to comment.