refactor(tvix/glue): use add_derivation_builtins helper
Change-Id: I284c82612f1c8c81a8b7711fe63c19778ff2fdf0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9909 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
parent
3196fe0143
commit
619f1fe88d
1 changed files with 2 additions and 7 deletions
|
|
@ -468,7 +468,7 @@ pub use derivation_builtins::builtins as derivation_builtins;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::known_paths::KnownPaths;
|
use crate::{add_derivation_builtins, known_paths::KnownPaths};
|
||||||
use nix_compat::store_path::hash_placeholder;
|
use nix_compat::store_path::hash_placeholder;
|
||||||
use std::{cell::RefCell, rc::Rc};
|
use std::{cell::RefCell, rc::Rc};
|
||||||
use test_case::test_case;
|
use test_case::test_case;
|
||||||
|
|
@ -482,12 +482,7 @@ mod tests {
|
||||||
|
|
||||||
let known_paths: Rc<RefCell<KnownPaths>> = Default::default();
|
let known_paths: Rc<RefCell<KnownPaths>> = Default::default();
|
||||||
|
|
||||||
eval.builtins
|
add_derivation_builtins(&mut eval, known_paths.clone());
|
||||||
.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")));
|
|
||||||
|
|
||||||
// run the evaluation itself.
|
// run the evaluation itself.
|
||||||
eval.evaluate()
|
eval.evaluate()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue