about summary refs log tree commit diff
path: root/tvix/Cargo.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/Cargo.nix')
-rw-r--r--tvix/Cargo.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix
index d6400eed3db2..45881b6b23b7 100644
--- a/tvix/Cargo.nix
+++ b/tvix/Cargo.nix
@@ -13541,6 +13541,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