From 2a3451077677787eae176c72717817ba80738a5e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 5 Mar 2024 14:35:05 +0100 Subject: [PATCH] package.nix: Apply OBJC_DISABLE_INITIALIZE_FORK_SAFETY workaround This was previously already used in the launchd configuration for nix-daemon. (cherry picked from commit 855741aea57cd413a5da524169794a6790162d18) --- package.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/package.nix b/package.nix index a90973b4c82..fa898e906db 100644 --- a/package.nix +++ b/package.nix @@ -349,9 +349,15 @@ in { # Needed for tests if we are not doing a build, but testing existing # built Nix. - preInstallCheck = lib.optionalString (! doBuild) '' - mkdir -p src/nix-channel - ''; + preInstallCheck = + lib.optionalString (! doBuild) '' + mkdir -p src/nix-channel + '' + # See https://github.com/NixOS/nix/issues/2523 + # Occurs often in tests since https://github.com/NixOS/nix/pull/9900 + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES + ''; separateDebugInfo = !stdenv.hostPlatform.isStatic;