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

Build failure related to grpc-sys/grpc/third_party/abseil-cpp #524

Closed dveeden closed 3 years ago

dveeden commented 3 years ago

Describe the bug

  [ 20%] Building CXX object third_party/abseil-cpp/absl/strings/CMakeFiles/absl_strings.dir/str_split.cc.o
  [ 20%] Building CXX object third_party/abseil-cpp/absl/strings/CMakeFiles/absl_strings.dir/string_view.cc.o
  [ 20%] Building CXX object third_party/abseil-cpp/absl/strings/CMakeFiles/absl_strings.dir/substitute.cc.o
  [ 20%] Linking CXX static library libabsl_strings.a
  [ 20%] Built target absl_strings

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

      CMAKE_ASM_COMPILER
      CMAKE_ASM_FLAGS

  /home/dvaneeden/dev/grpc-rs/grpc-sys/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function ‘void absl::lts_2020_09_23::synchronization_internal::GraphCycles::RemoveNode(void*)’:
  /home/dvaneeden/dev/grpc-rs/grpc-sys/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:26: error: ‘numeric_limits’ is not a member of ‘std’
    451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
        |                          ^~~~~~~~~~~~~~
  /home/dvaneeden/dev/grpc-rs/grpc-sys/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:49: error: expected primary-expression before ‘>’ token
    451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
        |                                                 ^
  /home/dvaneeden/dev/grpc-rs/grpc-sys/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:52: error: ‘::max’ has not been declared; did you mean ‘std::max’?
    451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
        |                                                    ^~~
        |                                                    std::max
  In file included from /usr/include/c++/11/algorithm:62,
                   from /home/dvaneeden/dev/grpc-rs/grpc-sys/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:38:
  /usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
   3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
        |     ^~~
  gmake[3]: *** [third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build.make:82: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o] Error 1
  gmake[2]: *** [CMakeFiles/Makefile2:3372: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/all] Error 2
  gmake[2]: *** Waiting for unfinished jobs....
  gmake[1]: *** [CMakeFiles/Makefile2:1038: CMakeFiles/grpc.dir/rule] Error 2
  gmake: *** [Makefile:261: grpc] Error 2
  thread 'main' panicked at '
  command did not execute successfully, got: exit code: 2

  build script failed, must exit now', /home/dvaneeden/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.45/src/lib.rs:894:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected behavior A clear and concise description of what you expected to happen.

System information

Fedora 34, GCC 11.0.1, cmake 3.19.7

Additional context

Looks like the issue is with the pingcap/grpc submodule, which seems to be behind grpc/grpc. And that in turn has abseil-cpp.

Updating abseil-cpp to 20219324.1 compiling this works again:

+e1d388e7e74803050423d035e4374131b9b57919 third_party/abseil-cpp (20210324.1)
dveeden commented 3 years ago

Not sure if the grpc submodule of this project needs updating or if this needs to be done somewhere down the dependency tree (e.g. pingcap/grpc).

BusyJay commented 3 years ago

Yes, pingcap/grpc needs to be updated first. We are using 1.35 currently.

sticnarf commented 3 years ago

Is there plan to upgrade the grpc version in the near future? Or we cherry-pick https://github.com/grpc/grpc/commit/f4fa4a18bca497a6ef8768e8faec07f7f3d29d21 to fix the build temporarily first.

BusyJay commented 3 years ago

I'm waiting for a new release from grpc, given that a pre-release has released.

SchrodingerZhu commented 3 years ago

I am also blocked by this issue when compiling tikv

SchrodingerZhu commented 3 years ago

https://github.com/grpc/grpc/releases/tag/v1.38.0

SchrodingerZhu commented 3 years ago

okay I see submodule updated 18 hours ago, is this already fixed by now?

BusyJay commented 3 years ago

Yes, 0.9.0 was released 19 hours ago.