diff options
author | Florian Klink <flokli@flokli.de> | 2023-10-16T13·52+0100 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-10-16T15·09+0000 |
commit | 5ce1a03a3a3a4861cfb451b29286607e0b7ccb20 (patch) | |
tree | 2bbdfbc4986ae215f3020d6dced092aab7adec16 | |
parent | 6aa8a1a8ea26a95be319a29fa893c10d9ee14d8f (diff) |
refactor(tvix): push rarely-used darwin-specific hacks down r/6837
Also, make some of them buildInputs, not nativeBuildInputs. We likely need to link against libiconv, so it shouldn't be a native build input. Change-Id: I757bc7f5d8c864ecaa3db26988d00b496c085c8f Reviewed-on: https://cl.tvl.fyi/c/depot/+/9757 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com> Autosubmit: flokli <flokli@flokli.de>
-rw-r--r-- | tvix/default.nix | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tvix/default.nix b/tvix/default.nix index 827664894c76..3be2b15e6523 100644 --- a/tvix/default.nix +++ b/tvix/default.nix @@ -4,9 +4,7 @@ let # crate override for crates that need protobuf protobufDep = prev: (prev.nativeBuildInputs or [ ]) ++ [ pkgs.protobuf ]; - iconvDarwinDep = lib.optionals pkgs.stdenv.isDarwin [ pkgs.libiconv ]; - # fuse-backend-rs uses DiskArbitration framework to handle mount/unmount on Darwin - diskArbitrationDep = lib.optionals pkgs.stdenv.isDarwin [ pkgs.buildPackages.darwin.apple_sdk.frameworks.DiskArbitration ]; + iconvDarwinDep = lib.optional pkgs.stdenv.isDarwin pkgs.libiconv; # Load the crate2nix crate tree. crates = import ./Cargo.nix { @@ -27,7 +25,8 @@ let defaultCrateOverrides = pkgs.defaultCrateOverrides // { zstd-sys = prev: { - nativeBuildInputs = prev.nativeBuildInputs or [ ] ++ iconvDarwinDep; + nativeBuildInputs = prev.nativeBuildInputs or [ ]; + buildInputs = prev.buildInputs or [ ] ++ iconvDarwinDep; }; prost-build = prev: { @@ -46,7 +45,9 @@ let tvix-store = prev: { PROTO_ROOT = depot.tvix.proto; nativeBuildInputs = protobufDep prev; - buildInputs = prev.buildInputs or [ ] ++ diskArbitrationDep; + # fuse-backend-rs uses DiskArbitration framework to handle mount/unmount on Darwin + buildInputs = prev.buildInputs or [ ] + ++ lib.optional pkgs.stdenv.isDarwin pkgs.buildPackages.darwin.apple_sdk.frameworks.DiskArbitration; }; }; }; @@ -118,15 +119,16 @@ in src = depot.third_party.gitignoreSource ./.; PROTO_ROOT = depot.tvix.proto; - buildInputs = [ - pkgs.fuse - ]; nativeBuildInputs = with pkgs; [ cargo pkg-config protobuf rustc rustPlatform.cargoSetupHook + ]; + + buildInputs = [ + pkgs.fuse ] ++ iconvDarwinDep; buildPhase = '' |