From 1cc3e9c1a83f819a94e1e3b92969cddf13356f2c Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 9 Dec 2023 15:49:56 +0200 Subject: refactor(tvix): use granular proto files Only pass in the proto files that are actually needed to build that crate. They are already constructed in depot.tvix.$crate.protos.protos. Change-Id: If4381e6c3350e420ee4ddce1e0513bfe970678a2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10240 Reviewed-by: raitobezarius Autosubmit: flokli Tested-by: BuildkiteCI --- tvix/default.nix | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'tvix/default.nix') diff --git a/tvix/default.nix b/tvix/default.nix index ac800ce6a1f2..342508c3718f 100644 --- a/tvix/default.nix +++ b/tvix/default.nix @@ -41,12 +41,12 @@ let }; tvix-build = prev: { - PROTO_ROOT = depot.tvix.proto; + PROTO_ROOT = depot.tvix.build.protos.protos; nativeBuildInputs = protobufDep prev; }; tvix-castore = prev: { - PROTO_ROOT = depot.tvix.proto; + PROTO_ROOT = depot.tvix.castore.protos.protos; nativeBuildInputs = protobufDep prev; }; @@ -55,7 +55,7 @@ let }; tvix-store = prev: { - PROTO_ROOT = depot.tvix.proto; + PROTO_ROOT = depot.tvix.store.protos.protos; nativeBuildInputs = protobufDep prev; # fuse-backend-rs uses DiskArbitration framework to handle mount/unmount on Darwin buildInputs = prev.buildInputs or [ ] @@ -101,9 +101,20 @@ let ${depot.tools.depotfmt}/bin/depotfmt Cargo.nix ''; + # Target containing *all* tvix proto files. + # Useful for workspace-wide cargo invocations (doc, clippy) + protos = pkgs.symlinkJoin { + name = "tvix-all-protos"; + paths = [ + depot.tvix.build.protos.protos + depot.tvix.castore.protos.protos + depot.tvix.store.protos.protos + ]; + }; + in { - inherit crates crate2nix-generate; + inherit crates crate2nix-generate protos; # Run crate2nix generate, ensure the output doesn't differ afterwards # (and doesn't fail). @@ -179,7 +190,7 @@ in rust-docs = pkgs.stdenv.mkDerivation { inherit cargoDeps src; name = "tvix-rust-docs"; - PROTO_ROOT = depot.tvix.proto; + PROTO_ROOT = protos; nativeBuildInputs = with pkgs; [ cargo @@ -204,7 +215,7 @@ in clippy = pkgs.stdenv.mkDerivation { inherit cargoDeps src; name = "tvix-clippy"; - PROTO_ROOT = depot.tvix.proto; + PROTO_ROOT = protos; buildInputs = [ pkgs.fuse -- cgit 1.4.1