diff options
author | Vincent Ambo <mail@tazj.in> | 2022-10-03T08·26+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-10-04T08·03+0000 |
commit | f0179c92d3248667b7f037de91c6b9eb737a40d2 (patch) | |
tree | 0bb7d7da18baf68a100b9bfc8bbef281d1105c00 /tvix/eval/src/builtins/mod.rs | |
parent | b9bfcf2f336b2276d391e75fb04e81bcbad3f692 (diff) |
refactor(tvix/eval): allow impure Value builtins r/5026
Allows impure builtins that have a different shape than a Rust function pointer; specifically this is required for builtins.currentTime which does not work in WASM. Change-Id: I1362d8eeafe770ce4d1c5ebe4d119aeb0abb5c9b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6849 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Reviewed-by: wpcarro <wpcarro@gmail.com>
Diffstat (limited to 'tvix/eval/src/builtins/mod.rs')
-rw-r--r-- | tvix/eval/src/builtins/mod.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index cd4200a13d3b..848ac9e25dca 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -3,12 +3,10 @@ //! See //tvix/eval/docs/builtins.md for a some context on the //! available builtins in Nix. -use std::{ - cmp, - collections::{BTreeMap, HashMap}, - path::PathBuf, - rc::Rc, -}; +use std::cmp; +use std::collections::{BTreeMap, HashMap}; +use std::path::PathBuf; +use std::rc::Rc; use crate::{ errors::ErrorKind, @@ -385,7 +383,7 @@ fn builtins_set() -> NixAttrs { add_builtins(pure_builtins()); #[cfg(feature = "impure")] { - add_builtins(impure::builtins()); + map.extend(impure::builtins()); } NixAttrs::from_map(map) |