From 619f1fe88d009e228cfd348da12b98f6a4533052 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 3 Nov 2023 14:08:37 +0200 Subject: refactor(tvix/glue): use add_derivation_builtins helper Change-Id: I284c82612f1c8c81a8b7711fe63c19778ff2fdf0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9909 Reviewed-by: raitobezarius Tested-by: BuildkiteCI Autosubmit: flokli --- tvix/glue/src/derivation.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tvix/glue/src/derivation.rs b/tvix/glue/src/derivation.rs index 86a271a3966d..323bf213c255 100644 --- a/tvix/glue/src/derivation.rs +++ b/tvix/glue/src/derivation.rs @@ -468,7 +468,7 @@ pub use derivation_builtins::builtins as derivation_builtins; #[cfg(test)] mod tests { - use crate::known_paths::KnownPaths; + use crate::{add_derivation_builtins, known_paths::KnownPaths}; use nix_compat::store_path::hash_placeholder; use std::{cell::RefCell, rc::Rc}; use test_case::test_case; @@ -482,12 +482,7 @@ mod tests { let known_paths: Rc> = Default::default(); - eval.builtins - .extend(crate::derivation::derivation_builtins(known_paths)); - - // Add the actual `builtins.derivation` from compiled Nix code - eval.src_builtins - .push(("derivation", include_str!("derivation.nix"))); + add_derivation_builtins(&mut eval, known_paths.clone()); // run the evaluation itself. eval.evaluate() -- cgit 1.4.1