From de10a924f2586461d0323cc74b179aa0e8b1d1c4 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 23 Jan 2023 01:50:49 +0300 Subject: feat(tvix/cli): implement `builtins.derivation` This uses the actual upstream Nix code for `builtins.derivation` (which is not a primop in C++ Nix) to implement `builtins.derivation` as a wrapper around `builtins.derivationStrict`. We're doing it this way to ensure that our thunking logic is correct. An initial Rust-native rewrite (see e.g. cl/7363) is pretty difficult to debug while there are still other issues to root out, but eventually we might want to turn this into native code. Change-Id: I5845e18073e103b8670e40648bd7fd9b511058e0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7902 Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/cli/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tvix/cli/src/main.rs') diff --git a/tvix/cli/src/main.rs b/tvix/cli/src/main.rs index 552b8e941c55..447bb13c714e 100644 --- a/tvix/cli/src/main.rs +++ b/tvix/cli/src/main.rs @@ -60,6 +60,10 @@ fn interpret(code: &str, path: Option, args: &Args, explain: bool) -> b eval.builtins .extend(derivation::derivation_builtins(known_paths)); + // Add the actual `builtins.derivation` from compiled Nix code + eval.src_builtins + .push(("derivation", include_str!("derivation.nix"))); + let source_map = eval.source_map(); let result = { let mut compiler_observer = -- cgit 1.4.1