diff options
author | antoshkka <[email protected]> | 2025-08-15 19:20:35 +0300 |
---|---|---|
committer | antoshkka <[email protected]> | 2025-08-15 19:48:01 +0300 |
commit | aff5fd9aa48b76b4bacfd3efd6ebd74b78a1ab3f (patch) | |
tree | c417c5b4c2f56fec963c009b3d003e91deb31ec5 | |
parent | ffe28e88d5629263a4972aab98f73bf645a3fd4f (diff) |
Minimise patch size for gRPC
First of the patches for moving to the vanilla gRPC without TString patches
Tests: протестировано CI
commit_hash:3d57cf0a73563bbc0cb7217b627626085c8e57a2
-rw-r--r-- | contrib/libs/grpc/.yandex_meta/__init__.py | 8 | ||||
-rw-r--r-- | contrib/libs/grpc/include/grpcpp/impl/status.h | 14 |
2 files changed, 13 insertions, 9 deletions
diff --git a/contrib/libs/grpc/.yandex_meta/__init__.py b/contrib/libs/grpc/.yandex_meta/__init__.py index b9f2eb9df3b..a810e884a35 100644 --- a/contrib/libs/grpc/.yandex_meta/__init__.py +++ b/contrib/libs/grpc/.yandex_meta/__init__.py @@ -9,9 +9,12 @@ from devtools.yamaker.project import CMakeNinjaNixProject def post_build(self): + def _ignore_paths(p): + return 'impl/status.h' not in p + # Change std::string to TString - re_sub_dir(self.dstdir, r"\bstd::string\b", "TString") - re_sub_dir(self.dstdir, r"\bstd::to_string\b", "::ToString") + re_sub_dir(self.dstdir, r"\bstd::string\b", "TString", test=_ignore_paths) + re_sub_dir(self.dstdir, r"\bstd::to_string\b", "::ToString", test=_ignore_paths) re_sub_dir( self.dstdir, "#include <string>", @@ -19,6 +22,7 @@ def post_build(self): #include <util/generic/string.h> #include <util/string/cast.h> """.strip(), + test=_ignore_paths, ) # Change absl to y_absl re_sub_dir(self.dstdir, r"\babsl\b", "y_absl") diff --git a/contrib/libs/grpc/include/grpcpp/impl/status.h b/contrib/libs/grpc/include/grpcpp/impl/status.h index adb9b2e6838..87948fcf0bb 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/status.h +++ b/contrib/libs/grpc/include/grpcpp/impl/status.h @@ -96,14 +96,14 @@ class GRPC_MUST_USE_RESULT_WHEN_USE_STRICT_WARNING Status { /// instead of a value (which results in a copy instead of a move) to allow /// for easy transition to y_absl::Status in the future which accepts an /// y_absl::string_view as a parameter. - Status(StatusCode code, const TString& error_message) + Status(StatusCode code, const std::string& error_message) : code_(code), error_message_(error_message) {} /// Construct an instance with \a code, \a error_message and /// \a error_details. It is an error to construct an OK status with non-empty /// \a error_message and/or \a error_details. - Status(StatusCode code, const TString& error_message, - const TString& error_details) + Status(StatusCode code, const std::string& error_message, + const std::string& error_details) : code_(code), error_message_(error_message), binary_error_details_(error_details) {} @@ -117,10 +117,10 @@ class GRPC_MUST_USE_RESULT_WHEN_USE_STRICT_WARNING Status { /// Return the instance's error code. StatusCode error_code() const { return code_; } /// Return the instance's error message. - TString error_message() const { return error_message_; } + std::string error_message() const { return error_message_; } /// Return the (binary) error details. // Usually it contains a serialized google.rpc.Status proto. - TString error_details() const { return binary_error_details_; } + std::string error_details() const { return binary_error_details_; } /// Is the status OK? bool ok() const { return code_ == StatusCode::OK; } @@ -132,8 +132,8 @@ class GRPC_MUST_USE_RESULT_WHEN_USE_STRICT_WARNING Status { private: StatusCode code_; - TString error_message_; - TString binary_error_details_; + std::string error_message_; + std::string binary_error_details_; }; } // namespace grpc |