about summary refs log tree commit diff
path: root/tvix/Cargo.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-12-09T08·49+0200
committerclbot <clbot@tvl.fyi>2023-12-11T21·43+0000
commitfd27d8ddc3a27fd89a3a132343c6a1ad8da3671c (patch)
treeaf891877cb4a0ca5e45f8bc59b29a0f7906dba69 /tvix/Cargo.nix
parent3c0a9a949ab71545de23102a8309ad0bea591c1f (diff)
feat(tvix/build): init r/7151
This adds the tvix-build crate, currently only containing a
`tvix_build::proto` module, exposing the data structures defined in
tvix/build/protos.

Change-Id: I75f5d9196969ed0877b1fe640cacfecba0fb2e03
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10235
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/Cargo.nix')
-rw-r--r--tvix/Cargo.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix
index 9553d0c88f..6151fd76d3 100644
--- a/tvix/Cargo.nix
+++ b/tvix/Cargo.nix
@@ -43,6 +43,16 @@ rec {
       # File a bug if you depend on any for non-debug work!
       debug = internal.debugCrate { inherit packageId; };
     };
+    "tvix-build" = rec {
+      packageId = "tvix-build";
+      build = internal.buildRustCrateWithFeatures {
+        packageId = "tvix-build";
+      };
+
+      # Debug support which might change between releases.
+      # File a bug if you depend on any for non-debug work!
+      debug = internal.debugCrate { inherit packageId; };
+    };
     "tvix-castore" = rec {
       packageId = "tvix-castore";
       build = internal.buildRustCrateWithFeatures {
@@ -9348,6 +9358,50 @@ rec {
         ];
 
       };
+      "tvix-build" = rec {
+        crateName = "tvix-build";
+        version = "0.1.0";
+        edition = "2021";
+        # We can't filter paths with references in Nix 2.4
+        # See https://github.com/NixOS/nix/issues/5410
+        src =
+          if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
+          then lib.cleanSourceWith { filter = sourceFilter; src = ./build; }
+          else ./build;
+        dependencies = [
+          {
+            name = "prost";
+            packageId = "prost";
+          }
+          {
+            name = "tonic";
+            packageId = "tonic";
+          }
+          {
+            name = "tonic-reflection";
+            packageId = "tonic-reflection";
+            optional = true;
+          }
+          {
+            name = "tvix-castore";
+            packageId = "tvix-castore";
+          }
+        ];
+        buildDependencies = [
+          {
+            name = "prost-build";
+            packageId = "prost-build";
+          }
+          {
+            name = "tonic-build";
+            packageId = "tonic-build";
+          }
+        ];
+        features = {
+          "tonic-reflection" = [ "dep:tonic-reflection" ];
+        };
+        resolvedDefaultFeatures = [ "default" "tonic-reflection" ];
+      };
       "tvix-castore" = rec {
         crateName = "tvix-castore";
         version = "0.1.0";