feat(tvix/cli): implement builtins.derivationStrict
Implements the logic for converting an evaluator value supplied as arguments to builtins.derivationStrict into an actual, fully-functional derivation struct. This skips the implementation of structuredAttrs, which are left for a subsequent commit. Note: We will need to port some eval tests over to CLI to test this correct, which will be done in a separate commit later on. Change-Id: I0db69dcf12716180de0eb0b126e3da4683712966 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7756 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
3d7c371e22
commit
8a9aa018dc
2 changed files with 154 additions and 4 deletions
|
|
@ -12,7 +12,7 @@ use clap::Parser;
|
|||
use known_paths::KnownPaths;
|
||||
use rustyline::{error::ReadlineError, Editor};
|
||||
use tvix_eval::observer::{DisassemblingObserver, TracingObserver};
|
||||
use tvix_eval::Value;
|
||||
use tvix_eval::{Builtin, BuiltinArgument, Value, VM};
|
||||
|
||||
#[derive(Parser)]
|
||||
struct Args {
|
||||
|
|
@ -55,8 +55,10 @@ fn interpret(code: &str, path: Option<PathBuf>, args: &Args, explain: bool) -> b
|
|||
let mut eval = tvix_eval::Evaluation::new_impure(code, path);
|
||||
let known_paths: Rc<RefCell<KnownPaths>> = Default::default();
|
||||
|
||||
eval.io_handle = Box::new(nix_compat::NixCompatIO::new(known_paths));
|
||||
eval.io_handle = Box::new(nix_compat::NixCompatIO::new(known_paths.clone()));
|
||||
eval.nix_path = args.nix_search_path.clone();
|
||||
eval.builtins
|
||||
.extend(derivation::derivation_builtins(known_paths));
|
||||
|
||||
let source_map = eval.source_map();
|
||||
let result = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue