Skip to content

Commit

Permalink
fix grpc: support ubuntu 20.04, minor fixes for old version
Browse files Browse the repository at this point in the history
Tests: протестировано CI
Pull Request resolved: #725

Co-authored-by: TTPO100AJIEX <[email protected]>
commit_hash:a3b41a809bc74c3eb035429206e1c8508839b1c9
  • Loading branch information
TTPO100AJIEX authored and fdr400 committed Oct 25, 2024
1 parent 1ef0bd8 commit 420fede
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ jobs:
sudo apt install --allow-downgrades -y g++-8
fi
if [ "${{matrix.os}}" = "ubuntu-20.04" ]; then
git clone --recursive -b v1.60.0 https://github.com/grpc/grpc new_grpc
cmake -S./new_grpc -B./new_grpc/build
cmake --build new_grpc/build -- -j4
sudo cmake --install new_grpc/build
fi
- name: Install RabbitMQ packages
run: |
Expand Down
2 changes: 1 addition & 1 deletion grpc/include/userver/ugrpc/field_mask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class FieldMask {
private:
void ToGoogleMaskImpl(std::vector<std::string>& stack, google::protobuf::FieldMask& out) const;

utils::FastPimpl<utils::impl::TransparentMap<std::string, FieldMask, utils::StrCaseHash>, 88, 8> children_;
utils::FastPimpl<utils::impl::TransparentMap<std::string, FieldMask, utils::StrCaseHash>, 96, 8> children_;
bool is_leaf_{false};
};

Expand Down
4 changes: 3 additions & 1 deletion grpc/src/ugrpc/impl/protobuf_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <userver/utils/assert.hpp>
#include <userver/utils/log.hpp>

#include <userver/field_options.pb.h>

USERVER_NAMESPACE_BEGIN

namespace ugrpc::impl {
Expand All @@ -28,7 +30,7 @@ compiler::ThreadLocal kSecretVisitor = [] {

} // namespace

userver::FieldOptions GetFieldOptions(const google::protobuf::FieldDescriptor& field) {
const userver::FieldOptions& GetFieldOptions(const google::protobuf::FieldDescriptor& field) {
return field.options().GetExtension(userver::field);
}

Expand Down
15 changes: 13 additions & 2 deletions grpc/src/ugrpc/impl/protobuf_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,24 @@
#include <cstddef>
#include <string>

#include <userver/field_options.pb.h>
namespace google::protobuf {

class Message;
class FieldDescriptor;

} // namespace google::protobuf

namespace userver {

class FieldOptions;

} // namespace userver

USERVER_NAMESPACE_BEGIN

namespace ugrpc::impl {

userver::FieldOptions GetFieldOptions(const google::protobuf::FieldDescriptor& field);
const userver::FieldOptions& GetFieldOptions(const google::protobuf::FieldDescriptor& field);

bool IsMessage(const google::protobuf::FieldDescriptor& field);

Expand Down

0 comments on commit 420fede

Please sign in to comment.