Skip to content

Commit

Permalink
darwin.apple_sdk.frameworks.CoreFoundation: drop hook
Browse files Browse the repository at this point in the history
As of NixOS#265102, x86_64-darwin no
longer uses the open-source CF release. Since there is no longer a need
to switch between implementations, and the hook causes problems with
cross-compilation (see NixOS#278348),
drop the hook and make both darwin.CF an alias for
darwin.apple_sdk.frameworks.CoreFoundation.
  • Loading branch information
reckenrode committed Jan 28, 2024
1 parent 229c36b commit 9c4aa56
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 43 deletions.
4 changes: 0 additions & 4 deletions pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ in rec {

# Overrides for framework derivations.
overrides = super: {
CoreFoundation = lib.overrideDerivation super.CoreFoundation (drv: {
setupHook = ./cf-setup-hook.sh;
});

# This framework doesn't exist in newer SDKs (somewhere around 10.13), but
# there are references to it in nixpkgs.
QuickTime = throw "QuickTime framework not available";
Expand Down
6 changes: 0 additions & 6 deletions pkgs/os-specific/darwin/apple-sdk-11.0/cf-setup-hook.sh

This file was deleted.

9 changes: 0 additions & 9 deletions pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh

This file was deleted.

4 changes: 0 additions & 4 deletions pkgs/os-specific/darwin/apple-sdk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,6 @@ in rec {
extraTBDFiles = [ "Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering.tbd" ];
});

CoreFoundation = lib.overrideDerivation super.CoreFoundation (drv: {
setupHook = ./cf-setup-hook.sh;
});

CoreMedia = lib.overrideDerivation super.CoreMedia (drv: {
__propagatedImpureHostDeps = drv.__propagatedImpureHostDeps or [] ++ [
"/System/Library/Frameworks/CoreImage.framework"
Expand Down
22 changes: 2 additions & 20 deletions pkgs/top-level/darwin-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -201,26 +201,8 @@ impure-cmds // appleSourcePackages // chooseLibs // {

CoreSymbolication = callPackage ../os-specific/darwin/CoreSymbolication { };

# TODO: Remove the CF hook if a solution to the crashes is not found.
CF =
# CF used to refer to the open source version of CoreFoundation from the Swift
# project. As of macOS 14, the rpath-based approach allowing packages to choose
# which version to use no longer seems to work reliably. Sometimes they works,
# but sometimes they crash with the error (in the system crash logs):
# CF objects must have a non-zero isa.
# See https://developer.apple.com/forums/thread/739355 for more on that error.
#
# In this branch, we only have a single "CoreFoundation" to choose from.
# To be compatible with the existing convention, we define
# CoreFoundation with the setup hook, and CF as the same package but
# with the setup hook removed.
#
# This may seem unimportant, but without it packages (e.g., bacula) will
# fail with linker errors referring ___CFConstantStringClassReference.
# It's not clear to me why some packages need this extra setup.
lib.overrideDerivation apple_sdk.frameworks.CoreFoundation (drv: {
setupHook = null;
});
# TODO: Move stdenv to use apple_sdk.frameworks.CoreFoundation and deprecate darwin.CF.
CF = apple_sdk.frameworks.CoreFoundation;

# Formerly the CF attribute. Use this is you need the open source release.
swift-corelibs-foundation = callPackage ../os-specific/darwin/swift-corelibs/corefoundation.nix { };
Expand Down

0 comments on commit 9c4aa56

Please sign in to comment.