fix(tvix): fix build on darwin

on macOS additional framework was needed to build tvix build

Change-Id: I0e327378d1bd4837f62496c4c6e66bc489ddedb4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10747
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Nikita Voloboev 2024-02-06 21:57:22 +03:00
parent 40d81d0c74
commit 70c068df51

View file

@ -7,7 +7,10 @@ let
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. # 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; darwinDeps = lib.optionals pkgs.stdenv.isDarwin (with pkgs.buildPackages.darwin.apple_sdk.frameworks; [
Security
SystemConfiguration
]);
# Load the crate2nix crate tree. # Load the crate2nix crate tree.
crates = import ./Cargo.nix { crates = import ./Cargo.nix {
@ -47,6 +50,7 @@ let
tvix-build = prev: { tvix-build = prev: {
PROTO_ROOT = depot.tvix.build.protos.protos; PROTO_ROOT = depot.tvix.build.protos.protos;
nativeBuildInputs = protobufDep prev; nativeBuildInputs = protobufDep prev;
buildInputs = darwinDeps;
}; };
tvix-castore = prev: { tvix-castore = prev: {
@ -55,7 +59,7 @@ let
}; };
tvix-cli = prev: { tvix-cli = prev: {
buildInputs = prev.buildInputs or [ ] ++ securityDarwinDep; buildInputs = prev.buildInputs or [ ] ++ darwinDeps;
}; };
tvix-store = prev: { tvix-store = prev: {
@ -63,7 +67,7 @@ let
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 ++ darwinDeps
++ lib.optional pkgs.stdenv.isDarwin pkgs.buildPackages.darwin.apple_sdk.frameworks.DiskArbitration; ++ lib.optional pkgs.stdenv.isDarwin pkgs.buildPackages.darwin.apple_sdk.frameworks.DiskArbitration;
}; };
}; };