about summary refs log tree commit diff
path: root/tvix/default.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-12-09T13·49+0200
committerclbot <clbot@tvl.fyi>2023-12-11T22·35+0000
commit1cc3e9c1a83f819a94e1e3b92969cddf13356f2c (patch)
tree3c36eb8a1f3c9e1a05720c8ef533f76026477f85 /tvix/default.nix
parent43943e26230562fcf3a6dc516f2c389f768f20fe (diff)
refactor(tvix): use granular proto files r/7156
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 <tvl@lahfa.xyz>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/default.nix')
-rw-r--r--tvix/default.nix23
1 files changed, 17 insertions, 6 deletions
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