about summary refs log tree commit diff
path: root/users/picnoir/tvix-daemon
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-04-04T16·03+0300
committerclbot <clbot@tvl.fyi>2024-04-06T14·12+0000
commitf3d8c633f2b4c44a6911d751a2efd93ef926a8bf (patch)
treea00891ab1c9699baeb9848065634bcd00dcb7f5d /users/picnoir/tvix-daemon
parent39276dc5b41fa5e756ebb8ae30b4d2ac91995be7 (diff)
feat(tvix/nix-compat/wire): introduce BytesWriter r/7857
This deals with writing byte packets of larger sizes to an underlying
AsyncWrite.

Its constructor receives the expected size. It also deals with writing
padding if flush/shutdown is called after writing all the payload.

Change-Id: I8acbf992467f3862ffb8c7d669e8c0c8eced14c1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11355
Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Brian Olsen <me@griff.name>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/picnoir/tvix-daemon')
-rw-r--r--users/picnoir/tvix-daemon/Cargo.lock1
-rw-r--r--users/picnoir/tvix-daemon/Cargo.nix25
2 files changed, 22 insertions, 4 deletions
diff --git a/users/picnoir/tvix-daemon/Cargo.lock b/users/picnoir/tvix-daemon/Cargo.lock
index cdbb82e37ae2..5522c63032a2 100644
--- a/users/picnoir/tvix-daemon/Cargo.lock
+++ b/users/picnoir/tvix-daemon/Cargo.lock
@@ -763,6 +763,7 @@ dependencies = [
  "glob",
  "nom",
  "num-traits",
+ "pin-project-lite",
  "serde",
  "serde_json",
  "sha2",
diff --git a/users/picnoir/tvix-daemon/Cargo.nix b/users/picnoir/tvix-daemon/Cargo.nix
index 14fd16afb03d..aa3faf4a8986 100644
--- a/users/picnoir/tvix-daemon/Cargo.nix
+++ b/users/picnoir/tvix-daemon/Cargo.nix
@@ -1,5 +1,5 @@
-# This file was @generated by crate2nix 0.12.0 with the command:
-#   "generate"
+# This file was @generated by crate2nix 0.13.0 with the command:
+#   "generate" "--all-features"
 # See https://github.com/kolloch/crate2nix for more info.
 
 { nixpkgs ? <nixpkgs>
@@ -2373,6 +2373,11 @@ rec {
             packageId = "num-traits";
           }
           {
+            name = "pin-project-lite";
+            packageId = "pin-project-lite";
+            optional = true;
+          }
+          {
             name = "serde";
             packageId = "serde";
             features = [ "derive" ];
@@ -2403,11 +2408,12 @@ rec {
           }
         ];
         features = {
-          "async" = [ "futures-util" "tokio" ];
+          "async" = [ "futures-util" "tokio" "pin-project-lite" ];
           "futures-util" = [ "dep:futures-util" ];
+          "pin-project-lite" = [ "dep:pin-project-lite" ];
           "tokio" = [ "dep:tokio" ];
         };
-        resolvedDefaultFeatures = [ "async" "futures-util" "tokio" ];
+        resolvedDefaultFeatures = [ "async" "futures-util" "pin-project-lite" "tokio" ];
       };
       "nom" = rec {
         crateName = "nom";
@@ -5205,6 +5211,7 @@ rec {
               (
                 _: {
                   buildTests = true;
+                  release = false;
                 }
               );
             # If the user hasn't set any pre/post commands, we don't want to
@@ -5229,6 +5236,16 @@ rec {
             # recreate a file hierarchy as when running tests with cargo
 
             # the source for test data
+            # It's necessary to locate the source in $NIX_BUILD_TOP/source/
+            # instead of $NIX_BUILD_TOP/
+            # because we compiled those test binaries in the former and not the latter.
+            # So all paths will expect source tree to be there and not in the build top directly.
+            # For example: $NIX_BUILD_TOP := /build in general, if you ask yourself.
+            # TODO(raitobezarius): I believe there could be more edge cases if `crate.sourceRoot`
+            # do exist but it's very hard to reason about them, so let's wait until the first bug report.
+            mkdir -p source/
+            cd source/
+
             ${pkgs.buildPackages.xorg.lndir}/bin/lndir ${crate.src}
 
             # build outputs