From 0db46dacea88bc15f06d586bee7acf2f50645f0a Mon Sep 17 00:00:00 2001 From: Aspen Smith Date: Mon, 19 Feb 2024 10:17:13 -0500 Subject: feat(tvix/glue): Init fetcher builtins Initialize a new empty builtins module `fetcher_builtins`, which will contain the builtins which fetch URLs from the internet: * fetchurl * fetchGit * fetchTarball * fetchTree (maybe? this is experimental) These builtins are all implemented in CPP nix at: https://github.com/NixOS/nix/blob/2.20.2/src/libexpr/primops/fetchTree.cc These builtins are added to the evaluation context using a similar mechanism to the derivation builtins, and have been added everywhere derivation builtins were previously being added. Change-Id: I133b91cc9560f23028621414537f712e7bd8a825 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10974 Autosubmit: aspen Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/glue/benches/eval.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tvix/glue/benches/eval.rs') diff --git a/tvix/glue/benches/eval.rs b/tvix/glue/benches/eval.rs index 4e1886c4018e..11435707aca6 100644 --- a/tvix/glue/benches/eval.rs +++ b/tvix/glue/benches/eval.rs @@ -8,7 +8,9 @@ use tvix_castore::{ }; use tvix_eval::{builtins::impure_builtins, EvalIO}; use tvix_glue::{ - builtins::add_derivation_builtins, configure_nix_path, tvix_io::TvixIO, + builtins::{add_derivation_builtins, add_fetcher_builtins}, + configure_nix_path, + tvix_io::TvixIO, tvix_store_io::TvixStoreIO, }; use tvix_store::pathinfoservice::{MemoryPathInfoService, PathInfoService}; @@ -44,7 +46,8 @@ fn interpret(code: &str) { ); eval.builtins.extend(impure_builtins()); - add_derivation_builtins(&mut eval, tvix_store_io); + add_derivation_builtins(&mut eval, Rc::clone(&tvix_store_io)); + add_fetcher_builtins(&mut eval, tvix_store_io); configure_nix_path( &mut eval, // The benchmark requires TVIX_BENCH_NIX_PATH to be set, so barf out -- cgit 1.4.1