3
0
Fork 0
forked from mirrors/nixpkgs

darwin.apple_sdk_11_0: use stdenv objc4

Stdenv on aarch64-darwin pulls in (bootstrap-stage4) objc4, unlike
x86_64. However derivations that otherwise depend on objc4 would use a
a different objc4 derivation on top of the final stdenv.

Because this library defines an LLVM module, having multiple instances
of it in the import path will interfere with builds.
This commit is contained in:
Stéphan Kochen 2022-07-19 15:20:53 +02:00 committed by toonn
parent cd532f7b9a
commit 6515b56871
No known key found for this signature in database
GPG key ID: 44FF902A66DF4576
2 changed files with 8 additions and 1 deletions

View file

@ -50,7 +50,9 @@ let
libcharset = callPackage ./libcharset.nix {};
libunwind = callPackage ./libunwind.nix {};
libnetwork = callPackage ./libnetwork.nix {};
objc4 = callPackage ./libobjc.nix {};
# Avoid introducing a new objc4 if stdenv already has one, to prevent
# conflicting LLVM modules.
objc4 = if stdenv ? objc4 then stdenv.objc4 else callPackage ./libobjc.nix {};
# questionable aliases
configd = pkgs.darwin.apple_sdk.frameworks.SystemConfiguration;

View file

@ -698,6 +698,11 @@ rec {
libc = pkgs.darwin.Libsystem;
shellPackage = pkgs.bash;
inherit bootstrapTools;
} // lib.optionalAttrs useAppleSDKLibs {
# This objc4 will be propagated to all builds using the final stdenv,
# and we shouldn't mix different builds, because they would be
# conflicting LLVM modules. Export it here so we can grab it later.
inherit (pkgs.darwin) objc4;
};
allowedRequisites = (with pkgs; [