diff options
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r-- | tvix/eval/src/builtins/impure.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tvix/eval/src/builtins/impure.rs b/tvix/eval/src/builtins/impure.rs index 675bdd50950e..7c98fcb4e192 100644 --- a/tvix/eval/src/builtins/impure.rs +++ b/tvix/eval/src/builtins/impure.rs @@ -1,4 +1,5 @@ use std::{ + cell::RefCell, collections::{BTreeMap, HashMap}, rc::Rc, time::{SystemTime, UNIX_EPOCH}, @@ -43,7 +44,10 @@ pub(super) fn builtins() -> BTreeMap<NixString, Value> { /// it needs to capture the [crate::SourceCode] structure to correctly track /// source code locations while invoking a compiler. // TODO: need to be able to pass through a CompilationObserver, too. -pub fn builtins_import(source: SourceCode) -> Builtin { +pub fn builtins_import( + globals: Rc<RefCell<HashMap<&'static str, Value>>>, + source: SourceCode, +) -> Builtin { Builtin::new( "import", &[true], @@ -83,7 +87,7 @@ pub fn builtins_import(source: SourceCode) -> Builtin { &parsed.tree().expr().unwrap(), Some(path.clone()), file, - HashMap::new(), // TODO: pass through globals + globals.clone(), &mut NoOpObserver::default(), ) .map_err(|err| ErrorKind::ImportCompilerError { |