diff options
author | Ryan Lahfa <tvl@lahfa.xyz> | 2024-04-03T13·08+0200 |
---|---|---|
committer | raitobezarius <tvl@lahfa.xyz> | 2024-04-03T23·23+0000 |
commit | e9a23bb4782615722374e7bec643cba669a492bc (patch) | |
tree | eec376d8f63744579cfe64079db7db9c68a089bd /tvix/glue/src/tests | |
parent | 3821fd4224c066c40fc492c8b049bd47c9a212fa (diff) |
fix(tvix/glue): produce context for `builtins.(path|filterSource)` r/7850
Fixes b/392. Output paths were created, depending on a plain store path but no context string was attached to track that plain dependency. Context string propagation tests are strengthened to prevent any regression on this. Change-Id: Ifd6671aeba6949324b0bb9f0f766b87db728d484 Signed-off-by: Ryan Lahfa <tvl@lahfa.xyz> Reviewed-on: https://cl.tvl.fyi/c/depot/+/11351 Reviewed-by: Alyssa Ross <hi@alyssa.is> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/glue/src/tests')
-rw-r--r-- | tvix/glue/src/tests/tvix_tests/eval-okay-context-propagation.exp | 2 | ||||
-rw-r--r-- | tvix/glue/src/tests/tvix_tests/eval-okay-context-propagation.nix | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tvix/glue/src/tests/tvix_tests/eval-okay-context-propagation.exp b/tvix/glue/src/tests/tvix_tests/eval-okay-context-propagation.exp index 71c6ded40612..8bb828e36a42 100644 --- a/tvix/glue/src/tests/tvix_tests/eval-okay-context-propagation.exp +++ b/tvix/glue/src/tests/tvix_tests/eval-okay-context-propagation.exp @@ -1 +1 @@ -[ true true true true true true true true true true true true true true true true true true true true true true true true true true ] +[ true true true true true true true true true true true true true true true true true true true true true true true true true true true true ] diff --git a/tvix/glue/src/tests/tvix_tests/eval-okay-context-propagation.nix b/tvix/glue/src/tests/tvix_tests/eval-okay-context-propagation.nix index 67f0ac46729b..918061b8b861 100644 --- a/tvix/glue/src/tests/tvix_tests/eval-okay-context-propagation.nix +++ b/tvix/glue/src/tests/tvix_tests/eval-okay-context-propagation.nix @@ -12,6 +12,11 @@ let system = "x86_64-linux"; outputs = [ "out" "bar" ]; }; + a-path-drv = builtins.path { + name = "a-path-drv"; + path = ./eval-okay-context-introspection.nix; + }; + another-path-drv = builtins.filterSource (_: true) ./eval-okay-context-introspection.nix; # `substr` propagates context, we truncate to an empty string and concatenate to the target # to infect it with the context of `copied`. @@ -37,6 +42,9 @@ in (builtins.hasContext "${(builtins.toFile "myself" "${./eval-okay-context-introspection.nix}")}") # `derivation` should produce context. (builtins.hasContext "${drv}") + # `builtins.path` / `builtins.filterSource` should produce context. + (builtins.hasContext "${a-path-drv}") + (builtins.hasContext "${another-path-drv}") # Low-level test to ensure that interpolation is working as expected. (builtins.length (builtins.attrNames (builtins.getContext "${drv}${other-drv}")) == 2) (builtins.getContext "${drv}${other-drv}" == mergeContext drv other-drv) |