diff options
author | nadya73 <nadya73@yandex-team.com> | 2024-07-30 13:16:23 +0300 |
---|---|---|
committer | nadya73 <nadya73@yandex-team.com> | 2024-07-30 14:12:09 +0300 |
commit | cb13057a00bee6a4c0dd414b44686d3ee5680cba (patch) | |
tree | 18e155bfc7b614a922f5f3640d8d984579267a11 | |
parent | d7d99122c63ecaa60d07f3eea7589512ff729aec (diff) | |
download | ydb-cb13057a00bee6a4c0dd414b44686d3ee5680cba.tar.gz |
[yt/cpp/mapreduce]Fix build with system protoc, std::string and system stl
Fix build with system protoc, std::string and system stl
8b5b81b2d7855f6b0dcb4bb0583a6408e5b7d3f7
-rw-r--r-- | contrib/libs/apache/orc/c++/src/Reader.cc | 8 | ||||
-rw-r--r-- | contrib/libs/apache/orc/c++/src/Statistics.hh | 12 | ||||
-rw-r--r-- | contrib/libs/apache/orc/c++/src/Writer.cc | 12 | ||||
-rw-r--r-- | contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc | 8 | ||||
-rw-r--r-- | library/cpp/protobuf/dynamic_prototype/ya.make | 2 | ||||
-rw-r--r-- | library/cpp/protobuf/json/ya.make | 2 | ||||
-rw-r--r-- | library/cpp/protobuf/runtime/ya.make | 9 | ||||
-rw-r--r-- | library/cpp/protobuf/yql/ya.make | 2 | ||||
-rw-r--r-- | library/cpp/tdigest/ya.make | 2 | ||||
-rw-r--r-- | library/python/protobuf/runtime/ya.make | 13 | ||||
-rw-r--r-- | library/python/testing/swag/lib/ya.make | 2 | ||||
-rw-r--r-- | util/ya.make | 4 | ||||
-rw-r--r-- | yt/cpp/mapreduce/interface/ut/ya.make | 1 | ||||
-rw-r--r-- | yt/cpp/mapreduce/interface/ya.make | 2 | ||||
-rw-r--r-- | yt/cpp/mapreduce/io/ya.make | 2 | ||||
-rw-r--r-- | yt/yt/library/tvm/ya.make | 2 |
16 files changed, 56 insertions, 27 deletions
diff --git a/contrib/libs/apache/orc/c++/src/Reader.cc b/contrib/libs/apache/orc/c++/src/Reader.cc index 2cc88fbb80..0586918d80 100644 --- a/contrib/libs/apache/orc/c++/src/Reader.cc +++ b/contrib/libs/apache/orc/c++/src/Reader.cc @@ -565,7 +565,7 @@ namespace orc { mutableFooter->CopyFrom(*footer); tail.set_file_length(fileLength); tail.set_postscript_length(postscriptLength); - TString result; + TProtoStringType result; if (!tail.SerializeToString(&result)) { throw ParseError("Failed to serialize file tail"); } @@ -691,7 +691,7 @@ namespace orc { std::string ReaderImpl::getMetadataValue(const std::string& key) const { for (int i = 0; i < footer->metadata_size(); ++i) { - if (footer->metadata(i).name() == TString(key)) { + if (footer->metadata(i).name() == TProtoStringType(key)) { return footer->metadata(i).value(); } } @@ -741,7 +741,7 @@ namespace orc { bool ReaderImpl::hasMetadataValue(const std::string& key) const { for (int i = 0; i < footer->metadata_size(); ++i) { - if (footer->metadata(i).name() == TString(key)) { + if (footer->metadata(i).name() == TProtoStringType(key)) { return true; } } @@ -1367,7 +1367,7 @@ namespace orc { if (serializedFooter.length() != 0) { // Parse the file tail from the serialized one. proto::FileTail tail; - if (!tail.ParseFromString(TString(serializedFooter))) { + if (!tail.ParseFromString(TProtoStringType(serializedFooter))) { throw ParseError("Failed to parse the file tail from string"); } contents->postscript = std::make_unique<proto::PostScript>(tail.postscript()); diff --git a/contrib/libs/apache/orc/c++/src/Statistics.hh b/contrib/libs/apache/orc/c++/src/Statistics.hh index b36e431a7f..053b6c7fd8 100644 --- a/contrib/libs/apache/orc/c++/src/Statistics.hh +++ b/contrib/libs/apache/orc/c++/src/Statistics.hh @@ -27,6 +27,8 @@ #include "Timezone.hh" #include "TypeImpl.hh" +#include <util/generic/string.h> + namespace orc { /** @@ -711,14 +713,14 @@ namespace orc { proto::DecimalStatistics* decStats = pbStats.mutable_decimal_statistics(); if (_stats.hasMinimum()) { - decStats->set_minimum(TString(_stats.getMinimum().toString(true))); - decStats->set_maximum(TString(_stats.getMaximum().toString(true))); + decStats->set_minimum(TProtoStringType(_stats.getMinimum().toString(true))); + decStats->set_maximum(TProtoStringType(_stats.getMaximum().toString(true))); } else { decStats->clear_minimum(); decStats->clear_maximum(); } if (_stats.hasSum()) { - decStats->set_sum(TString(_stats.getSum().toString(true))); + decStats->set_sum(TProtoStringType(_stats.getSum().toString(true))); } else { decStats->clear_sum(); } @@ -1225,8 +1227,8 @@ namespace orc { proto::StringStatistics* strStats = pbStats.mutable_string_statistics(); if (_stats.hasMinimum()) { - strStats->set_minimum(TString(_stats.getMinimum())); - strStats->set_maximum(TString(_stats.getMaximum())); + strStats->set_minimum(TProtoStringType(_stats.getMinimum())); + strStats->set_maximum(TProtoStringType(_stats.getMaximum())); } else { strStats->clear_minimum(); strStats->clear_maximum(); diff --git a/contrib/libs/apache/orc/c++/src/Writer.cc b/contrib/libs/apache/orc/c++/src/Writer.cc index 19b71190a3..ca96e709c9 100644 --- a/contrib/libs/apache/orc/c++/src/Writer.cc +++ b/contrib/libs/apache/orc/c++/src/Writer.cc @@ -429,8 +429,8 @@ namespace orc { void WriterImpl::addUserMetadata(const std::string& name, const std::string& value) { proto::UserMetadataItem* userMetadataItem = fileFooter.add_metadata(); - userMetadataItem->set_name(TString(name)); - userMetadataItem->set_value(TString(value)); + userMetadataItem->set_name(TProtoStringType(name)); + userMetadataItem->set_value(TProtoStringType(value)); } void WriterImpl::init() { @@ -510,7 +510,7 @@ namespace orc { *stripeFooter.add_columns() = encodings[i]; } - stripeFooter.set_writer_timezone(TString(options.getTimezoneName())); + stripeFooter.set_writer_timezone(TProtoStringType(options.getTimezoneName())); // add stripe statistics to metadata proto::StripeStatistics* stripeStats = metadata.add_stripe_stats(); @@ -679,8 +679,8 @@ namespace orc { for (auto& key : t.getAttributeKeys()) { const auto& value = t.getAttributeValue(key); auto protoAttr = protoType.add_attributes(); - protoAttr->set_key(TString(key)); - protoAttr->set_value(TString(value)); + protoAttr->set_key(TProtoStringType(key)); + protoAttr->set_value(TProtoStringType(value)); } int pos = static_cast<int>(index); @@ -689,7 +689,7 @@ namespace orc { for (uint64_t i = 0; i < t.getSubtypeCount(); ++i) { // only add subtypes' field names if this type is STRUCT if (t.getKind() == STRUCT) { - footer.mutable_types(pos)->add_field_names(TString(t.getFieldName(i))); + footer.mutable_types(pos)->add_field_names(TProtoStringType(t.getFieldName(i))); } footer.mutable_types(pos)->add_subtypes(++index); buildFooterType(*t.getSubtype(i), footer, index); diff --git a/contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc b/contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc index 5fceedd854..54968545b9 100644 --- a/contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc +++ b/contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc @@ -26,6 +26,8 @@ #include <sstream> #include <type_traits> +#include <util/generic/string.h> + namespace orc { PredicateLeaf::PredicateLeaf(Operator op, PredicateDataType type, const std::string& colName, @@ -495,11 +497,11 @@ namespace orc { return result; } - static std::vector<TString> literal2String(const std::vector<Literal>& values) { - std::vector<TString> result; + static std::vector<TProtoStringType> literal2String(const std::vector<Literal>& values) { + std::vector<TProtoStringType> result; std::for_each(values.cbegin(), values.cend(), [&](const Literal& val) { if (!val.isNull()) { - result.emplace_back(TString(val.getString())); + result.emplace_back(TProtoStringType(val.getString())); } }); return result; diff --git a/library/cpp/protobuf/dynamic_prototype/ya.make b/library/cpp/protobuf/dynamic_prototype/ya.make index 3fd883b6a2..ab5727d5d3 100644 --- a/library/cpp/protobuf/dynamic_prototype/ya.make +++ b/library/cpp/protobuf/dynamic_prototype/ya.make @@ -6,7 +6,7 @@ SRCS( ) PEERDIR( - contrib/libs/protobuf + library/cpp/protobuf/runtime ) END() diff --git a/library/cpp/protobuf/json/ya.make b/library/cpp/protobuf/json/ya.make index 9309e341ef..b7b3d27a75 100644 --- a/library/cpp/protobuf/json/ya.make +++ b/library/cpp/protobuf/json/ya.make @@ -14,8 +14,8 @@ SRCS( ) PEERDIR( - contrib/libs/protobuf library/cpp/json + library/cpp/protobuf/runtime library/cpp/protobuf/util library/cpp/protobuf/json/proto library/cpp/string_utils/relaxed_escaper diff --git a/library/cpp/protobuf/runtime/ya.make b/library/cpp/protobuf/runtime/ya.make new file mode 100644 index 0000000000..4ddfe0f8ed --- /dev/null +++ b/library/cpp/protobuf/runtime/ya.make @@ -0,0 +1,9 @@ +LIBRARY() + +IF (USE_VANILLA_PROTOC) + PEERDIR(contrib/libs/protobuf_std) +ELSE() + PEERDIR(contrib/libs/protobuf) +ENDIF() + +END() diff --git a/library/cpp/protobuf/yql/ya.make b/library/cpp/protobuf/yql/ya.make index ed77430e26..070fd399b6 100644 --- a/library/cpp/protobuf/yql/ya.make +++ b/library/cpp/protobuf/yql/ya.make @@ -6,10 +6,10 @@ SRCS( ) PEERDIR( - contrib/libs/protobuf library/cpp/json library/cpp/protobuf/dynamic_prototype library/cpp/protobuf/json + library/cpp/protobuf/runtime library/cpp/string_utils/base64 ) diff --git a/library/cpp/tdigest/ya.make b/library/cpp/tdigest/ya.make index 2546443726..37d4e13a27 100644 --- a/library/cpp/tdigest/ya.make +++ b/library/cpp/tdigest/ya.make @@ -6,7 +6,7 @@ SRCS( ) PEERDIR( - contrib/libs/protobuf + library/cpp/protobuf/runtime ) END() diff --git a/library/python/protobuf/runtime/ya.make b/library/python/protobuf/runtime/ya.make new file mode 100644 index 0000000000..0bb52fffe6 --- /dev/null +++ b/library/python/protobuf/runtime/ya.make @@ -0,0 +1,13 @@ +PY23_LIBRARY() + +IF (USE_VANILLA_PROTOC AND NOT PYTHON2) + PEERDIR( + contrib/python/protobuf_std + ) +ELSE() + PEERDIR( + contrib/python/protobuf + ) +ENDIF() + +END() diff --git a/library/python/testing/swag/lib/ya.make b/library/python/testing/swag/lib/ya.make index 0567288a62..c1f486f7fa 100644 --- a/library/python/testing/swag/lib/ya.make +++ b/library/python/testing/swag/lib/ya.make @@ -2,7 +2,7 @@ PY23_LIBRARY() PEERDIR( contrib/python/six - contrib/python/protobuf + library/python/protobuf/runtime library/python/testing/yatest_common ) diff --git a/util/ya.make b/util/ya.make index 5564e65eb0..87eb5c7180 100644 --- a/util/ya.make +++ b/util/ya.make @@ -249,6 +249,10 @@ IF (TSTRING_IS_STD_STRING) CFLAGS(GLOBAL -DTSTRING_IS_STD_STRING) ENDIF() +IF (NO_CUSTOM_CHAR_PTR_STD_COMPARATOR) + CFLAGS(GLOBAL -DNO_CUSTOM_CHAR_PTR_STD_COMPARATOR) +ENDIF() + JOIN_SRCS( all_system_1.cpp system/atexit.cpp diff --git a/yt/cpp/mapreduce/interface/ut/ya.make b/yt/cpp/mapreduce/interface/ut/ya.make index 9e92931b5d..cfc55acccf 100644 --- a/yt/cpp/mapreduce/interface/ut/ya.make +++ b/yt/cpp/mapreduce/interface/ut/ya.make @@ -17,7 +17,6 @@ SRCS( ) PEERDIR( - contrib/libs/protobuf library/cpp/testing/gtest yt/yt_proto/yt/formats yt/cpp/mapreduce/interface diff --git a/yt/cpp/mapreduce/interface/ya.make b/yt/cpp/mapreduce/interface/ya.make index a4cbd8951a..5d9a61a1cd 100644 --- a/yt/cpp/mapreduce/interface/ya.make +++ b/yt/cpp/mapreduce/interface/ya.make @@ -23,7 +23,7 @@ SRCS( ) PEERDIR( - contrib/libs/protobuf + library/cpp/protobuf/runtime library/cpp/type_info library/cpp/threading/future library/cpp/yson/node diff --git a/yt/cpp/mapreduce/io/ya.make b/yt/cpp/mapreduce/io/ya.make index 18a0cac464..179fc40df1 100644 --- a/yt/cpp/mapreduce/io/ya.make +++ b/yt/cpp/mapreduce/io/ya.make @@ -20,7 +20,7 @@ SRCS( ) PEERDIR( - contrib/libs/protobuf + library/cpp/protobuf/runtime library/cpp/yson library/cpp/yson/node yt/cpp/mapreduce/common diff --git a/yt/yt/library/tvm/ya.make b/yt/yt/library/tvm/ya.make index b7f1973dcd..4f8ba3a9b6 100644 --- a/yt/yt/library/tvm/ya.make +++ b/yt/yt/library/tvm/ya.make @@ -10,7 +10,7 @@ PEERDIR( library/cpp/yt/memory ) -IF(NOT OPENSOURCE) +IF (NOT OPENSOURCE AND NOT USE_VANILLA_PROTOC) INCLUDE(ya_non_opensource.inc) ENDIF() |