You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I bumped up grpc version from 1.45.2 to 1.47.0 for my C++ 17 project and got some build errors related to std::variant (see below for the error message).
I guess this is a kind of compatibility issue related to the implementation of std::variant of CentOS's devtoolset-9 since the errors disappear when I let the project use Abseil version of variant implementation by not designating the project standard as C++17 (set(CMAKE_CXX_STANDARD 17)). I also have tested it for Ubuntu 18.04 with gcc 9.4 & gcc 7.5 and confirmed that those have been built without any issue. Under my investigation so far, the issue came from this line (L144).
Although std::varaintshould be allowed to have the same type more than once, it seems that having duplicated types becomes somewhat problematic under certain circumstances. I found the below edit bypasses the build error which is just to confirm this.
staticconstexprsize_tkClusterIndex = 0;
staticconstexprsize_tkWeightedClustersIndex = 1;
staticconstexprsize_tkClusterSpecifierPluginIndex = 0;
absl::variant<std::string, std::vector<ClusterWeight>> action; // remove second std::string then it builds successful
Below is the command to repod on CentOS 7.4, you need to have CMake dist.
Apparently, this bug has been introduced at version 9, the fix was included to GCC 9.4.0, GCC 10.2.0 and GCC 11.1.0 releases. In other words, the compatibilities for certain gcc releases less than these versions are currently broken.
BTW, confirmed that defining a copy assignment operator overload for struct RouteAction could avoid the issue. Not looks really ideal though.
What version of gRPC and what language are you using?
1.47.0. Confirmed that the same error occurs on 1.46.x
What operating system (Linux, Windows,...) and version?
CentOS 7.4, LIBC2.17
What runtime / compiler are you using (e.g. python version or version of gcc)
GCC-9.3.1 (by devtoolset-9)
What did you do?
I bumped up grpc version from 1.45.2 to 1.47.0 for my C++ 17 project and got some build errors related to
std::variant
(see below for the error message).I guess this is a kind of compatibility issue related to the implementation of
std::variant
of CentOS'sdevtoolset-9
since the errors disappear when I let the project use Abseil version ofvariant
implementation by not designating the project standard as C++17 (set(CMAKE_CXX_STANDARD 17)
). I also have tested it for Ubuntu 18.04 with gcc 9.4 & gcc 7.5 and confirmed that those have been built without any issue. Under my investigation so far, the issue came from this line (L144).grpc/src/core/ext/xds/xds_route_config.h
Lines 141 to 145 in ab7a8d3
Although
std::varaint
should be allowed to have the same type more than once, it seems that having duplicated types becomes somewhat problematic under certain circumstances. I found the below edit bypasses the build error which is just to confirm this.Below is the command to repod on CentOS 7.4, you need to have CMake dist.
Should be related to this issue #29984
What did you expect to see?
A successful compilation
What did you see instead?
You can see the full error log here
Anything else we should know about your project / environment?
The text was updated successfully, but these errors were encountered: