tikv / grpc-rs

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

grpcio-sys-0.12.1+1.46.5-patched compile error on latest `clang` #618

Open purew opened 1 year ago

purew commented 1 year ago

Using a newer version of clang:

$ clang --version
clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

The linked C++ code fails to compile with

  In file included from /home/anders/.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/anders/.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:35: error: unknown
type name 'uint8_t'
  enum class FormatConversionChar : uint8_t;
                                    ^
  /home/anders/.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:35:38: error: unknown
type name 'uint64_t'
  enum class FormatConversionCharSet : uint64_t;
                                       ^
  /home/anders/.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:131:20: error: unknown
 type name 'uint8_t'
  enum class Flags : uint8_t {
                     ^
  /home/anders/.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:144:41: error: unknown
 type name 'uint8_t'
    return static_cast<Flags>(static_cast<uint8_t>(a) | static_cast<uint8_t>(b));
                                          ^
  /home/anders/.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:144:67: error: unknown
 type name 'uint8_t'
    return static_cast<Flags>(static_cast<uint8_t>(a) | static_cast<uint8_t>(b));
                                                                    ^
  /home/anders/.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:148:23: error: unknown
 type name 'uint8_t'
    return (static_cast<uint8_t>(haystack) & static_cast<uint8_t>(needle)) ==
                        ^
  /home/anders/.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:148:56: error: unknown
 type name 'uint8_t'
    return (static_cast<uint8_t>(haystack) & static_cast<uint8_t>(needle)) ==
                                                         ^
  /home/anders/.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:148:42: error: invalid
 operands to binary expression ('absl::str_format_internal::Flags' and 'absl::str_format_internal::Flags')
    return (static_cast<uint8_t>(haystack) & static_cast<uint8_t>(needle)) ==
                                 ~~~~~~~~  ^                      ~~~~~~
  /home/anders/.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:149:22: error: unknown
 type name 'uint8_t'
           static_cast<uint8_t>(needle);
                       ^
  /home/anders/.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:187:21: error: unknown
 type name 'uint8_t'
    enum class Enum : uint8_t {
regar42 commented 1 year ago

I believe this issue is a duplicate of #617

purew commented 1 year ago

Ahh, I actually saw that ticket first but at the time I only saw other errors in my build log which made me think this was a different issue for clang.

However, those errors were actually just warnings and the hard error is the one above which #617 already documents.

BusyJay commented 1 year ago

0.13.0 is published, please try again and see if it's fixed.