fix(tvix): fix binary building on Darwin

On Darwin, some crates producing binaries need to be able to link
against security.

Change-Id: I5bdd69247c12729b9efd5c4f18527d361ef99e87
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9758
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2023-10-16 16:14:11 +01:00 committed by flokli
parent 5ce1a03a3a
commit 0f44451919

View file

@ -6,6 +6,9 @@ let
protobufDep = prev: (prev.nativeBuildInputs or [ ]) ++ [ pkgs.protobuf ]; protobufDep = prev: (prev.nativeBuildInputs or [ ]) ++ [ pkgs.protobuf ];
iconvDarwinDep = lib.optional pkgs.stdenv.isDarwin pkgs.libiconv; iconvDarwinDep = lib.optional pkgs.stdenv.isDarwin pkgs.libiconv;
# On Darwin, some crates producing binaries need to be able to link against security.
securityDarwinDep = lib.optional pkgs.stdenv.isDarwin pkgs.buildPackages.darwin.apple_sdk.frameworks.Security;
# Load the crate2nix crate tree. # Load the crate2nix crate tree.
crates = import ./Cargo.nix { crates = import ./Cargo.nix {
inherit pkgs; inherit pkgs;
@ -42,11 +45,16 @@ let
nativeBuildInputs = protobufDep prev; nativeBuildInputs = protobufDep prev;
}; };
tvix-cli = prev: {
buildInputs = prev.buildInputs or [ ] ++ securityDarwinDep;
};
tvix-store = prev: { tvix-store = prev: {
PROTO_ROOT = depot.tvix.proto; PROTO_ROOT = depot.tvix.proto;
nativeBuildInputs = protobufDep prev; nativeBuildInputs = protobufDep prev;
# fuse-backend-rs uses DiskArbitration framework to handle mount/unmount on Darwin # fuse-backend-rs uses DiskArbitration framework to handle mount/unmount on Darwin
buildInputs = prev.buildInputs or [ ] buildInputs = prev.buildInputs or [ ]
++ securityDarwinDep
++ lib.optional pkgs.stdenv.isDarwin pkgs.buildPackages.darwin.apple_sdk.frameworks.DiskArbitration; ++ lib.optional pkgs.stdenv.isDarwin pkgs.buildPackages.darwin.apple_sdk.frameworks.DiskArbitration;
}; };
}; };