feat(nix/readTree): Handle a builtins w/o scopedImport

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
This commit is contained in:
Griffin Smith 2022-10-09 22:04:37 -04:00 committed by clbot
parent 2ca153141d
commit b0547ccfa5

View file

@ -80,7 +80,7 @@ let
importFile = args: scopedArgs: path: parts: filter: importFile = args: scopedArgs: path: parts: filter:
let let
importedFile = importedFile =
if scopedArgs != { } if scopedArgs != { } && builtins ? scopedImport # For tvix
then builtins.scopedImport scopedArgs path then builtins.scopedImport scopedArgs path
else import path; else import path;
pathType = builtins.typeOf importedFile; pathType = builtins.typeOf importedFile;