about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2022-10-10T02·04-0400
committerclbot <clbot@tvl.fyi>2022-10-10T17·42+0000
commitb0547ccfa5e74cf21e813cd18f64ef62f1bf3734 (patch)
tree43c9f69c818521d3bebcaf1f645b5b4a240c1d3e
parent2ca153141d87eb522647fb8da278c2abe57d0fc9 (diff)
feat(nix/readTree): Handle a builtins w/o scopedImport r/5079
We (might) not want to implement scopedImport in tvix given it's
considered a bit of a misfeature; this makes readTree work with a
`builtins` set that doesn't have it (and if we decide we do want tvix to
have scopedImport, we can revert this pretty easily).

Change-Id: Ia3bbc847514672063a607d977ce167d489fa1131
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6915
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
-rw-r--r--nix/readTree/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nix/readTree/default.nix b/nix/readTree/default.nix
index ba3363d8d69c..e243e8551787 100644
--- a/nix/readTree/default.nix
+++ b/nix/readTree/default.nix
@@ -80,7 +80,7 @@ let
   importFile = args: scopedArgs: path: parts: filter:
     let
       importedFile =
-        if scopedArgs != { }
+        if scopedArgs != { } && builtins ? scopedImport # For tvix
         then builtins.scopedImport scopedArgs path
         else import path;
       pathType = builtins.typeOf importedFile;