I have a nix shell where I include the apple sdk for my dev environment:
{}:
let
sources = import ./npins;
pkgs = import sources.nixpkgs {};
stdenv = pkgs.stdenv;
apple_sdk = pkgs.darwin.apple_sdk_11_0;
frameworks = apple_sdk.frameworks;
in
stdenv.mkDerivation {
name = "nix-shell";
phases = ["nobuildPhase"];
buildInputs =
with pkgs; [
cmake
ninja
npins
git
] ++ lib.optionals stdenv.isDarwin [
apple_sdk.objc4
frameworks.Metal
];
nobuildPhase = ''
echo
echo "This derivation is not meant to be built, aborting";
echo
exit 1
'';
}
My build fails since there’s a duplicate framework entry for libobjc:
$ echo $NIX_CFLAGS_COMPILE
-frandom-seed=ld4cls5q42 -isystem /nix/store/k8gdy8ddn735mpi11n06g92ksg34qy41-libcxx-11.1.0-dev/include -isystem /nix/store/c59mv12f7w22xkskdpf3lmlr4h2yz861-libcxxabi-11.1.0-dev/include -isystem /nix/store/1ipv848xhh75rdx3s2vzn97iy054nh5f-libobjc-11.0.0/include -iframework /nix/store/kvj89jjaj96bg2ymsw7ya1dmvxlj82b1-apple-framework-Metal-11.0.0/Library/Frameworks -iframework /nix/store/pq8lk32fvns3s3ga5qk7caml6nzg44g5-apple-framework-CoreFoundation-11.0.0/Library/Frameworks -isystem /nix/store/zds0nj0gjmyq9g4yy347vm625r6rp22i-libobjc-11.0.0/include -isystem /nix/store/k8gdy8ddn735mpi11n06g92ksg34qy41-libcxx-11.1.0-dev/include -isystem /nix/store/c59mv12f7w22xkskdpf3lmlr4h2yz861-libcxxabi-11.1.0-dev/include -isystem /nix/store/1ipv848xhh75rdx3s2vzn97iy054nh5f-libobjc-11.0.0/include -iframework /nix/store/kvj89jjaj96bg2ymsw7ya1dmvxlj82b1-apple-framework-Metal-11.0.0/Library/Frameworks -iframework /nix/store/pq8lk32fvns3s3ga5qk7caml6nzg44g5-apple-framework-CoreFoundation-11.0.0/Library/Frameworks -isystem /nix/store/zds0nj0gjmyq9g4yy347vm625r6rp22i-libobjc-11.0.0/include
As you can see, there’s /nix/store/zds0nj0gjmyq9g4yy347vm625r6rp22i-libobjc-11.0.0
and /nix/store/1ipv848xhh75rdx3s2vzn97iy054nh5f-libobjc-11.0.0
providing libobjc and that causes problems for my build. I can remove it manually, but I would like to avoid that and remove that duplicate entry from the nix file directly. Is there a way to do that cleanly? Thanks.