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

arrow-cpp: fix crash in tests on x86_64-darwin
This commit is contained in:
K900
2023-11-04 15:05:44 +03:00
committed by GitHub
8 changed files with 72 additions and 13 deletions
@@ -39,6 +39,10 @@ stdenv.mkDerivation rec {
url = "https://github.com/abseil/abseil-cpp/commit/808bc202fc13e85a7948db0d7fb58f0f051200b1.patch";
sha256 = "sha256-ayY/aV/xWOdEyFSDqV7B5WDGvZ0ASr/aeBeYwP5RZVc=";
})
] ++ lib.optionals stdenv.isDarwin [
# Dont propagate the path to CoreFoundation. Otherwise, its impossible to build packages
# that require a different SDK other than the default one.
./cmake-core-foundation.patch
];
cmakeFlags = [
@@ -18,6 +18,12 @@ stdenv.mkDerivation rec {
sha256 = "sha256-sSXT6D4JSrk3dA7kVaxfKkzOMBpqXQb0WbMYWG+nGwk=";
};
patches = lib.optionals stdenv.isDarwin [
# Dont propagate the path to CoreFoundation. Otherwise, its impossible to build packages
# that require a different SDK other than the default one.
./cmake-core-foundation.patch
];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
] ++ lib.optionals (cxxStandard != null) [
@@ -18,6 +18,12 @@ stdenv.mkDerivation rec {
hash = "sha256-Od1FZOOWEXVQsnZBwGjDIExi6LdYtomyL0STR44SsG8=";
};
patches = lib.optionals stdenv.isDarwin [
# Dont propagate the path to CoreFoundation. Otherwise, its impossible to build packages
# that require a different SDK other than the default one.
./cmake-core-foundation.patch
];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
] ++ lib.optionals (cxxStandard != null) [
@@ -18,6 +18,12 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-PLoI7ix+reUqkZ947kWzls8lujYqWXk9A9a55UcfahI=";
};
patches = lib.optionals stdenv.isDarwin [
# Dont propagate the path to CoreFoundation. Otherwise, its impossible to build packages
# that require a different SDK other than the default one.
./cmake-core-foundation.patch
];
cmakeFlags = [
"-DABSL_BUILD_TEST_HELPERS=ON"
"-DABSL_USE_EXTERNAL_GOOGLETEST=ON"
@@ -18,6 +18,12 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-uNGrTNg5G5xFGtc+BSWE389x0tQ/KxJQLHfebNWas/k=";
};
patches = lib.optionals stdenv.isDarwin [
# Dont propagate the path to CoreFoundation. Otherwise, its impossible to build packages
# that require a different SDK other than the default one.
./cmake-core-foundation.patch
];
cmakeFlags = [
"-DABSL_BUILD_TEST_HELPERS=ON"
"-DABSL_USE_EXTERNAL_GOOGLETEST=ON"
@@ -0,0 +1,12 @@
diff -ur a/absl/time/CMakeLists.txt b/absl/time/CMakeLists.txt
--- a/absl/time/CMakeLists.txt 1969-12-31 19:00:01.000000000 -0500
+++ b/absl/time/CMakeLists.txt 2023-10-30 21:50:32.639061785 -0400
@@ -55,7 +55,7 @@
)
if(APPLE)
- find_library(CoreFoundation CoreFoundation)
+ set(CoreFoundation "-framework CoreFoundation")
endif()
absl_cc_library(
+5 -2
View File
@@ -262,6 +262,9 @@ rec {
) darwinMinVersion darwinSdkVersion;
sdk = pkgs.darwin."apple_sdk_${lib.replaceStrings [ "." ] [ "_" ] darwinSdkVersion}";
# TODO: Make this unconditional after #229210 has been merged,
# and the 10.12 SDK is updated to follow the new structure.
Libsystem = if darwinSdkVersion == "10.12" then pkgs.darwin.Libsystem else sdk.Libsystem;
replacePropagatedFrameworks = pkg:
let
@@ -349,8 +352,8 @@ rec {
// lib.genAttrs atBuildInputs (input: map mapRuntimeToSDK (args."${input}" or [ ]));
mkCC = cc: cc.override {
bintools = cc.bintools.override { libc = sdk.Libsystem; };
libc = sdk.Libsystem;
bintools = cc.bintools.override { libc = Libsystem; };
libc = Libsystem;
};
in
# TODO: make this work across all input types and not just propagatedBuildInputs
+27 -11
View File
@@ -20515,10 +20515,30 @@ with pkgs;
aalib = callPackage ../development/libraries/aalib { };
abseil-cpp_202103 = callPackage ../development/libraries/abseil-cpp/202103.nix { };
abseil-cpp_202206 = callPackage ../development/libraries/abseil-cpp/202206.nix { };
abseil-cpp_202301 = callPackage ../development/libraries/abseil-cpp/202301.nix { };
abseil-cpp_202308 = callPackage ../development/libraries/abseil-cpp/202308.nix { };
abseil-cpp_202103 = callPackage ../development/libraries/abseil-cpp/202103.nix {
# If abseil-cpp doesnt have a deployment target of 10.13+, arrow-cpp crashes in libgrpc.dylib.
stdenv = if stdenv.isDarwin && stdenv.isx86_64
then overrideSDK stdenv { darwinMinVersion = "10.13"; }
else stdenv;
};
abseil-cpp_202206 = callPackage ../development/libraries/abseil-cpp/202206.nix {
# If abseil-cpp doesnt have a deployment target of 10.13+, arrow-cpp crashes in libgrpc.dylib.
stdenv = if stdenv.isDarwin && stdenv.isx86_64
then overrideSDK stdenv { darwinMinVersion = "10.13"; }
else stdenv;
};
abseil-cpp_202301 = callPackage ../development/libraries/abseil-cpp/202301.nix {
# If abseil-cpp doesnt have a deployment target of 10.13+, arrow-cpp crashes in libgrpc.dylib.
stdenv = if stdenv.isDarwin && stdenv.isx86_64
then overrideSDK stdenv { darwinMinVersion = "10.13"; }
else stdenv;
};
abseil-cpp_202308 = callPackage ../development/libraries/abseil-cpp/202308.nix {
# If abseil-cpp doesnt have a deployment target of 10.13+, arrow-cpp crashes in libgrpc.dylib.
stdenv = if stdenv.isDarwin && stdenv.isx86_64
then overrideSDK stdenv { darwinMinVersion = "10.13"; }
else stdenv;
};
abseil-cpp = abseil-cpp_202301;
accountsservice = callPackage ../development/libraries/accountsservice { };
@@ -21807,13 +21827,9 @@ with pkgs;
grilo-plugins = callPackage ../development/libraries/grilo-plugins { };
grpc = callPackage ../development/libraries/grpc {
stdenv = if (stdenv.isDarwin && stdenv.isx86_64) then
# Work around Clang check for 10.13 when using aligned allocations with C++17.
stdenv.override (old: {
hostPlatform = old.hostPlatform // { darwinMinVersion = "10.13"; };
buildPlatform = old.buildPlatform // { darwinMinVersion = "10.13"; };
targetPlatform = old.targetPlatform // { darwinMinVersion = "10.13"; };
})
# Work around Clang check for 10.13 when using aligned allocations with C++17.
stdenv = if stdenv.isDarwin && stdenv.isx86_64
then overrideSDK stdenv { darwinMinVersion = "10.13"; }
else stdenv;
};