lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

grpc: refactor cxxStandard selection

GRPC is less aggressive in overriding `CMAKE_CXX_STANDARD` nowadays.
This allows us to take a less invasive approach to ensure that the
provided abseil package is configured with the same implementation
for the provided c++17 compatibility shims.
Instead of always setting `CMAKE_CXX_STANDARD`, we only do it to
override hard-coded downgrade on darwin. With that, we can use the
default configuration for abseil-cpp, reducing the number of instances
of that library in the build closure to one.

+17 -25
+2 -5
pkgs/development/libraries/arrow-cpp/default.nix
··· 39 39 , enableShared ? !stdenv.hostPlatform.isStatic 40 40 , enableFlight ? true 41 41 , enableJemalloc ? !stdenv.isDarwin 42 - # boost/process is broken in 1.69 on darwin, but fixed in 1.70 and 43 - # non-existent in older versions 44 - # see https://github.com/boostorg/process/issues/55 45 - , enableS3 ? (!stdenv.isDarwin) || (lib.versionOlder boost.version "1.69" || lib.versionAtLeast boost.version "1.70") 46 - , enableGcs ? (!stdenv.isDarwin) && (lib.versionAtLeast grpc.cxxStandard "17") # google-cloud-cpp is not supported on darwin, needs to support C++17 42 + , enableS3 ? true 43 + , enableGcs ? !stdenv.isDarwin 47 44 }: 48 45 49 46 assert lib.asserts.assertMsg
-1
pkgs/development/libraries/google-cloud-cpp/default.nix
··· 120 120 # this adds a good chunk of time to the build 121 121 "-DBUILD_TESTING:BOOL=ON" 122 122 "-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES:BOOL=OFF" 123 - "-DCMAKE_CXX_STANDARD=${grpc.cxxStandard}" 124 123 ] ++ lib.optionals (apis != [ "*" ]) [ 125 124 "-DGOOGLE_CLOUD_CPP_ENABLE=${lib.concatStringsSep ";" apis}" 126 125 ];
+14 -13
pkgs/development/libraries/grpc/default.nix
··· 56 56 "-DgRPC_PROTOBUF_PROVIDER=package" 57 57 "-DgRPC_ABSL_PROVIDER=package" 58 58 "-DBUILD_SHARED_LIBS=ON" 59 - "-DCMAKE_CXX_STANDARD=${passthru.cxxStandard}" 60 59 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 61 60 "-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc" 62 - ]; 61 + ] 62 + # The build scaffold defaults to c++14 on darwin, even when the compiler uses 63 + # a more recent c++ version by default [1]. However, downgrades are 64 + # problematic, because the compatibility types in abseil will have different 65 + # interface definitions than the ones used for building abseil itself. 66 + # [1] https://github.com/grpc/grpc/blob/v1.57.0/CMakeLists.txt#L239-L243 67 + ++ (let 68 + defaultCxxIsOlderThan17 = 69 + (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.cc.version "16.0") 70 + || (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.cc.version "11.0"); 71 + in lib.optionals (stdenv.hostPlatform.isDarwin && defaultCxxIsOlderThan17) 72 + [ 73 + "-DCMAKE_CXX_STANDARD=17" 74 + ]); 63 75 64 76 # CMake creates a build directory by default, this conflicts with the 65 77 # basel BUILD file on case-insensitive filesystems. ··· 80 92 + lib.optionalString stdenv.isAarch64 "-Wno-error=format-security"; 81 93 82 94 enableParallelBuilds = true; 83 - 84 - passthru.cxxStandard = 85 - let 86 - # Needs to be compiled with -std=c++11 for clang < 11. Interestingly this is 87 - # only an issue with the useLLVM stdenv, not the darwin stdenv… 88 - # https://github.com/grpc/grpc/issues/26473#issuecomment-860885484 89 - useLLVMAndOldCC = (stdenv.hostPlatform.useLLVM or false) && lib.versionOlder stdenv.cc.cc.version "11.0"; 90 - # With GCC 9 (current aarch64-linux) it fails with c++17 but OK with c++14. 91 - useOldGCC = !(stdenv.hostPlatform.useLLVM or false) && lib.versionOlder stdenv.cc.cc.version "10"; 92 - in 93 - (if useLLVMAndOldCC then "11" else if useOldGCC then "14" else "17"); 94 95 95 96 passthru.tests = { 96 97 inherit (python3.pkgs) grpcio-status grpcio-tools;
+1 -6
pkgs/top-level/all-packages.nix
··· 21597 21597 21598 21598 grilo-plugins = callPackage ../development/libraries/grilo-plugins { }; 21599 21599 21600 - grpc = callPackage ../development/libraries/grpc { 21601 - # grpc builds with c++17 so abseil must also be built that way 21602 - abseil-cpp = abseil-cpp_202206.override { 21603 - cxxStandard = grpc.cxxStandard; 21604 - }; 21605 - }; 21600 + grpc = callPackage ../development/libraries/grpc { }; 21606 21601 21607 21602 gsettings-qt = libsForQt5.callPackage ../development/libraries/gsettings-qt { }; 21608 21603