about summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2019-11-18 11:24:53 +0100
committerVladimír Čunát <v@cunat.cz>2019-11-18 11:26:43 +0100
commited9fb90b2855fe09772958494a611248cc23a89c (patch)
tree0470851e98aa66d1c72d9743b54c8b56cfffab29 /pkgs/os-specific
parentef43c5f5d928758d15cd42b18454e7145a163331 (diff)
parent41ca86129fa18278758e177d1821351dc608d24c (diff)
downloadnixlib-ed9fb90b2855fe09772958494a611248cc23a89c.tar
nixlib-ed9fb90b2855fe09772958494a611248cc23a89c.tar.gz
nixlib-ed9fb90b2855fe09772958494a611248cc23a89c.tar.bz2
nixlib-ed9fb90b2855fe09772958494a611248cc23a89c.tar.lz
nixlib-ed9fb90b2855fe09772958494a611248cc23a89c.tar.xz
nixlib-ed9fb90b2855fe09772958494a611248cc23a89c.tar.zst
nixlib-ed9fb90b2855fe09772958494a611248cc23a89c.zip
Merge #73572: darwin.CF: hack around build failures
... into staging-next.  Fixes #66811, kinda.
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix25
1 files changed, 23 insertions, 2 deletions
diff --git a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
index 6f7caa8ec02c..1df7070e7a3f 100644
--- a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
+++ b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
@@ -63,10 +63,31 @@ stdenv.mkDerivation {
   # I'm guessing at the version here. https://github.com/apple/swift-corelibs-foundation/commit/df3ec55fe6c162d590a7653d89ad669c2b9716b1 imported "high sierra"
   # and this version is a version from there. No idea how accurate it is.
   LDFLAGS = "-current_version 1454.90.0 -compatibility_version 150.0.0 -init ___CFInitialize";
-  configurePhase = "../configure release --sysroot UNUSED";
+
+  configurePhase = ''
+    ../configure release --sysroot UNUSED
+  '';
 
   enableParallelBuilding = true;
-  buildPhase = "ninja -j $NIX_BUILD_CORES";
+
+  # FIXME: Workaround for intermittent build failures of CFRuntime.c.
+  # Based on testing this issue seems to only occur with clang_7, so
+  # please remove this when updating the default llvm versions to 8 or
+  # later.
+  buildPhase = stdenv.lib.optionalString true ''
+    for i in {1..512}; do
+        if ninjaBuildPhase; then
+          break
+        fi
+
+        echo >&2
+        echo "[$i/512] retrying build, workaround for #66811" >&2
+        echo "  With clang_7 the build of CFRuntime.c fails intermittently." >&2
+        echo "  See https://github.com/NixOS/nixpkgs/issues/66811 for more details." >&2
+        echo >&2
+        continue
+    done
+  '';
 
   # TODO: their build system sorta kinda can do this, but it doesn't seem to work right now
   # Also, this includes a bunch of private headers in the framework, which is not what we want