grpc: GRPC C++ Build Fails for gcc 8.2

What version of gRPC and what language are you using?

1.15.0 and C++

What operating system (Linux, Windows, …) and version?

Linux - CentOS 7

What runtime / compiler are you using (e.g. python version or version of gcc)

gcc 8.2

What did you do?

If possible, provide a recipe for reproducing the error. Try being specific and include code snippets if helpful.

# With gcc 8.2 in environment
$ gcc --version
gcc (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ git clone --recursive https://github.com/grpc/grpc
$ cd grpc && git checkout v1.15.0 -b v1.15.0
$ mkdir build && cd build
$ cmake ..
$ make -j4

What did you expect to see?

Build Successfully

What did you see instead?

/home/ksharma/Downloads/grpc/third_party/boringssl/crypto/x509/x509_test.cc: In member function ‘virtual void X509Test_ZeroLengthsWithX509PARAM_Test::TestBody()’:
/home/ksharma/Downloads/grpc/third_party/boringssl/crypto/x509/x509_test.cc:712:10: error: declaration of ‘struct X509Test_ZeroLengthsWithX509PARAM_Test::TestBody()::Test’ shadows a previous local [-Werror=shadow]
   struct Test {
          ^~~~
In file included from /home/ksharma/Downloads/grpc/third_party/boringssl/crypto/x509/x509_test.cc:19:
/home/ksharma/Downloads/grpc/third_party/boringssl/third_party/googletest/include/gtest/gtest.h:375:23: note: shadowed declaration is here
 class GTEST_API_ Test {

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Anything else we should know about your project / environment?

I tried building it with gcc 7.3 and it built successfully. So, I some default warnings/error compiler flags introduced in gcc 8 fails the build.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 20 (7 by maintainers)

Most upvoted comments

This is not fixed and unfortunately the crypto module ( boringssl/crypto ) doesn’t have any flag which controls building the test. It will have to be fixed by boringssl

Seems to not be fixed, on Debian 10.

Here is a Quick fix: just checkout the boringssl’s master branch, and done.

Refs: [v1.16.0], v1.12.1-2456-g759390f99e
Author:     whalemo <flan@kouga.us>
AuthorDate: Mon Dec 3 14:38:40 2018 +0800
Commit:     whalemo <flan@kouga.us>
CommitDate: Mon Dec 3 14:38:40 2018 +0800

    Move boringssl submodule to new master branch.

    Fix BUG #16675.
---
 third_party/boringssl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/third_party/boringssl b/third_party/boringssl
index b29b21a81b..0f5ecd3a85 160000
--- a/third_party/boringssl
+++ b/third_party/boringssl
@@ -1 +1 @@
-Subproject commit b29b21a81b32ec273f118f589f46d56ad3332420
+Subproject commit 0f5ecd3a854546d943104e1f7421e489b7f4d5aa

I’m still getting it, yes

How exactly can I disable compiling the tests? It seems like gRPC_BUILD_TESTS already defaults to off @nicolasnoble

We’re trying to stick on the same released versions of boringssl as the chromium project.