Merge pull request #265395 from reckenrode/arrow-cpp-fix

arrow-cpp: fix crash in tests on x86_64-darwin

authored by K900 and committed by GitHub 7d2381f7 d0a60851

+72 -13
+4
pkgs/development/libraries/abseil-cpp/202103.nix
··· 39 39 url = "https://github.com/abseil/abseil-cpp/commit/808bc202fc13e85a7948db0d7fb58f0f051200b1.patch"; 40 40 sha256 = "sha256-ayY/aV/xWOdEyFSDqV7B5WDGvZ0ASr/aeBeYwP5RZVc="; 41 41 }) 42 + ] ++ lib.optionals stdenv.isDarwin [ 43 + # Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages 44 + # that require a different SDK other than the default one. 45 + ./cmake-core-foundation.patch 42 46 ]; 43 47 44 48 cmakeFlags = [
+6
pkgs/development/libraries/abseil-cpp/202111.nix
··· 18 18 sha256 = "sha256-sSXT6D4JSrk3dA7kVaxfKkzOMBpqXQb0WbMYWG+nGwk="; 19 19 }; 20 20 21 + patches = lib.optionals stdenv.isDarwin [ 22 + # Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages 23 + # that require a different SDK other than the default one. 24 + ./cmake-core-foundation.patch 25 + ]; 26 + 21 27 cmakeFlags = [ 22 28 "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" 23 29 ] ++ lib.optionals (cxxStandard != null) [
+6
pkgs/development/libraries/abseil-cpp/202206.nix
··· 18 18 hash = "sha256-Od1FZOOWEXVQsnZBwGjDIExi6LdYtomyL0STR44SsG8="; 19 19 }; 20 20 21 + patches = lib.optionals stdenv.isDarwin [ 22 + # Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages 23 + # that require a different SDK other than the default one. 24 + ./cmake-core-foundation.patch 25 + ]; 26 + 21 27 cmakeFlags = [ 22 28 "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" 23 29 ] ++ lib.optionals (cxxStandard != null) [
+6
pkgs/development/libraries/abseil-cpp/202301.nix
··· 18 18 hash = "sha256-PLoI7ix+reUqkZ947kWzls8lujYqWXk9A9a55UcfahI="; 19 19 }; 20 20 21 + patches = lib.optionals stdenv.isDarwin [ 22 + # Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages 23 + # that require a different SDK other than the default one. 24 + ./cmake-core-foundation.patch 25 + ]; 26 + 21 27 cmakeFlags = [ 22 28 "-DABSL_BUILD_TEST_HELPERS=ON" 23 29 "-DABSL_USE_EXTERNAL_GOOGLETEST=ON"
+6
pkgs/development/libraries/abseil-cpp/202308.nix
··· 18 18 hash = "sha256-uNGrTNg5G5xFGtc+BSWE389x0tQ/KxJQLHfebNWas/k="; 19 19 }; 20 20 21 + patches = lib.optionals stdenv.isDarwin [ 22 + # Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages 23 + # that require a different SDK other than the default one. 24 + ./cmake-core-foundation.patch 25 + ]; 26 + 21 27 cmakeFlags = [ 22 28 "-DABSL_BUILD_TEST_HELPERS=ON" 23 29 "-DABSL_USE_EXTERNAL_GOOGLETEST=ON"
+12
pkgs/development/libraries/abseil-cpp/cmake-core-foundation.patch
··· 1 + diff -ur a/absl/time/CMakeLists.txt b/absl/time/CMakeLists.txt 2 + --- a/absl/time/CMakeLists.txt 1969-12-31 19:00:01.000000000 -0500 3 + +++ b/absl/time/CMakeLists.txt 2023-10-30 21:50:32.639061785 -0400 4 + @@ -55,7 +55,7 @@ 5 + ) 6 + 7 + if(APPLE) 8 + - find_library(CoreFoundation CoreFoundation) 9 + + set(CoreFoundation "-framework CoreFoundation") 10 + endif() 11 + 12 + absl_cc_library(
+5 -2
pkgs/stdenv/adapters.nix
··· 262 262 ) darwinMinVersion darwinSdkVersion; 263 263 264 264 sdk = pkgs.darwin."apple_sdk_${lib.replaceStrings [ "." ] [ "_" ] darwinSdkVersion}"; 265 + # TODO: Make this unconditional after #229210 has been merged, 266 + # and the 10.12 SDK is updated to follow the new structure. 267 + Libsystem = if darwinSdkVersion == "10.12" then pkgs.darwin.Libsystem else sdk.Libsystem; 265 268 266 269 replacePropagatedFrameworks = pkg: 267 270 let ··· 349 352 // lib.genAttrs atBuildInputs (input: map mapRuntimeToSDK (args."${input}" or [ ])); 350 353 351 354 mkCC = cc: cc.override { 352 - bintools = cc.bintools.override { libc = sdk.Libsystem; }; 353 - libc = sdk.Libsystem; 355 + bintools = cc.bintools.override { libc = Libsystem; }; 356 + libc = Libsystem; 354 357 }; 355 358 in 356 359 # TODO: make this work across all input types and not just propagatedBuildInputs
+27 -11
pkgs/top-level/all-packages.nix
··· 20515 20515 20516 20516 aalib = callPackage ../development/libraries/aalib { }; 20517 20517 20518 - abseil-cpp_202103 = callPackage ../development/libraries/abseil-cpp/202103.nix { }; 20519 - abseil-cpp_202206 = callPackage ../development/libraries/abseil-cpp/202206.nix { }; 20520 - abseil-cpp_202301 = callPackage ../development/libraries/abseil-cpp/202301.nix { }; 20521 - abseil-cpp_202308 = callPackage ../development/libraries/abseil-cpp/202308.nix { }; 20518 + abseil-cpp_202103 = callPackage ../development/libraries/abseil-cpp/202103.nix { 20519 + # If abseil-cpp doesn’t have a deployment target of 10.13+, arrow-cpp crashes in libgrpc.dylib. 20520 + stdenv = if stdenv.isDarwin && stdenv.isx86_64 20521 + then overrideSDK stdenv { darwinMinVersion = "10.13"; } 20522 + else stdenv; 20523 + }; 20524 + abseil-cpp_202206 = callPackage ../development/libraries/abseil-cpp/202206.nix { 20525 + # If abseil-cpp doesn’t have a deployment target of 10.13+, arrow-cpp crashes in libgrpc.dylib. 20526 + stdenv = if stdenv.isDarwin && stdenv.isx86_64 20527 + then overrideSDK stdenv { darwinMinVersion = "10.13"; } 20528 + else stdenv; 20529 + }; 20530 + abseil-cpp_202301 = callPackage ../development/libraries/abseil-cpp/202301.nix { 20531 + # If abseil-cpp doesn’t have a deployment target of 10.13+, arrow-cpp crashes in libgrpc.dylib. 20532 + stdenv = if stdenv.isDarwin && stdenv.isx86_64 20533 + then overrideSDK stdenv { darwinMinVersion = "10.13"; } 20534 + else stdenv; 20535 + }; 20536 + abseil-cpp_202308 = callPackage ../development/libraries/abseil-cpp/202308.nix { 20537 + # If abseil-cpp doesn’t have a deployment target of 10.13+, arrow-cpp crashes in libgrpc.dylib. 20538 + stdenv = if stdenv.isDarwin && stdenv.isx86_64 20539 + then overrideSDK stdenv { darwinMinVersion = "10.13"; } 20540 + else stdenv; 20541 + }; 20522 20542 abseil-cpp = abseil-cpp_202301; 20523 20543 20524 20544 accountsservice = callPackage ../development/libraries/accountsservice { }; ··· 21807 21827 grilo-plugins = callPackage ../development/libraries/grilo-plugins { }; 21808 21828 21809 21829 grpc = callPackage ../development/libraries/grpc { 21810 - stdenv = if (stdenv.isDarwin && stdenv.isx86_64) then 21811 - # Work around Clang check for 10.13 when using aligned allocations with C++17. 21812 - stdenv.override (old: { 21813 - hostPlatform = old.hostPlatform // { darwinMinVersion = "10.13"; }; 21814 - buildPlatform = old.buildPlatform // { darwinMinVersion = "10.13"; }; 21815 - targetPlatform = old.targetPlatform // { darwinMinVersion = "10.13"; }; 21816 - }) 21830 + # Work around Clang check for 10.13 when using aligned allocations with C++17. 21831 + stdenv = if stdenv.isDarwin && stdenv.isx86_64 21832 + then overrideSDK stdenv { darwinMinVersion = "10.13"; } 21817 21833 else stdenv; 21818 21834 }; 21819 21835