Skip to content

Commit

Permalink
swift-corelibs: actually provide and use the hook
Browse files Browse the repository at this point in the history
@emilazy found a bug in #234861. Specifically, the hook is not actually
applied. e2fsprogs links against darwin.CF, but since it cannot find the
framework by rpath, it crashes.

Since the hook should always be used, it is copied directly to
`nix-support/setup-hook` instead of providing it as an attribute. This
preserves dropping the hook in the cross-compilation case while
providing it for everything else that needs it.

To avoid further churn and due to the complexity of building the stdenv
with the hook active, this change required the stdenv rework.
  • Loading branch information
reckenrode committed Jul 2, 2023
1 parent fb1baeb commit d02421b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ stdenv.mkDerivation {
postInstall = ''
install_name_tool -id '@rpath/CoreFoundation.framework/Versions/A/CoreFoundation' \
"$out/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"
'';
darwinEnvHook = makeSetupHook { name = "darwin-env-hook"; } ./pure-corefoundation-hook.sh;
mkdir -p "$out/nix-support"
substituteAll ${./pure-corefoundation-hook.sh} "$out/nix-support/setup-hook"
'';
}

0 comments on commit d02421b

Please sign in to comment.