tikv / grpc-rs

The gRPC library for Rust built on C Core library and futures
Apache License 2.0
1.8k stars 253 forks source link

grpcio v0.12.1 failed to build #617

Closed ycytt-rs closed 1 year ago

ycytt-rs commented 1 year ago

Describe the bug Failed to build grpcio:

rust log:


  --- stderr
  CMake Warning at third_party/abseil-cpp/CMakeLists.txt:74 (message):
    A future Abseil release will default ABSL_PROPAGATE_CXX_STD to ON for CMake
    3.8 and up.  We recommend enabling this option to ensure your project still
    builds correctly.

  CMake Warning at cmake/protobuf.cmake:51 (message):
    gRPC_PROTOBUF_PROVIDER is "module" but PROTOBUF_ROOT_DIR is wrong
  Call Stack (most recent call first):
    CMakeLists.txt:317 (include)

  CMake Warning:
    Manually-specified variables were not used by the project:

      CMAKE_ASM_COMPILER
      CMAKE_ASM_FLAGS

  In file included from /home/cslo/.cargo/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.12.1+1.46.5-patched/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc:16:
  /home/cslo/.cargo/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.12.1+1.46.5-patched/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h:34:6: warning: elaborated-type-specifier for a scoped enum must not use the ‘class’ keyword
     34 | enum class FormatConversionChar : uint8_t;
        | ~~~~ ^~~~~
        |      -----
  /home/cslo/.cargo/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.12.1+1.46.5-patched/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h:34:33: error: found ‘:’ in nested-name-specifier, expected ‘::’
     34 | enum class FormatConversionChar : uint8_t;
        |                                 ^
        |                                 ::
  /home/cslo/.cargo/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.12.1+1.46.5-patched/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h:34:12: error: ‘FormatConversionChar’ has not been declared
     34 | enum class FormatConversionChar : uint8_t;
        |            ^~~~~~~~~~~~~~~~~~~~

features enabled: "prost-codec", "openssl-vendored",

System information

regar42 commented 1 year ago

I also started having this issue when I upgraded from GCC12 to GCC13 (13.1.1). Unfortunately I don't have time to dig into this right now (reverted to GCC12 instead) :/

heftig commented 1 year ago

It's a missing #include <cstdint>.

Ten0 commented 1 year ago

Chances are we just need to bump the grpc core fork, no?

purew commented 1 year ago

I'd be happy to try out any fixes, as I'm having these issues.

Ten0 commented 1 year ago

As our current workaround we are using an old version of gcc

heftig commented 1 year ago

I've worked around it by using LLVM's libc++ instead of GCC's libstdc++.

export CXX="clang++" CXXFLAGS="-stdlib=libc++"
grahamking commented 1 year ago

Editing grpc-rs/grpc-sys/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h to add #include <cstdint> with the other includes, like @heftig said, fixes it - thanks!

Abseil has that include already. If https://github.com/pingcap/grpc can update it's abseil submodule link (like upstream grpc/grpc has done), and then this project update it's pingcap/grpc submodule , it should then build with GCC 13.

Ten0 commented 1 year ago

@BusyJay sorry to ping but that seems to be a big enough issue easy enough to solve

BusyJay commented 1 year ago

Will fix it this weekend. I don't have access to pingcap/grpc anymore, I was waiting for https://github.com/pingcap/grpc moving to https://github.com/tikv/grpc these days.

lance6716 commented 1 year ago

@BusyJay Hi, kindly ask do you have time to fix it?

purew commented 1 year ago

Will fix it this weekend. I don't have access to pingcap/grpc anymore, I was waiting for https://github.com/pingcap/grpc moving to https://github.com/tikv/grpc these days.

Looks like the move has completed? The two urls both point to tikv/grpc.

BusyJay commented 1 year ago

Yes, and #621 should fix this issue.

BusyJay commented 1 year ago

Now the change is published as 0.13.0.