From 5f2c2e79e1778cda877d6122dd24be08740c8720 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 30 Mar 2023 14:01:38 +0200 Subject: refactor(tvix/nix-compat): move build_store_path out of derivation This doesn't have anything to do with ATerms, we just happen to be using the aterm representation of a Derivation as contents. Moving this into store_path/utils.rs makes these things much cleaner - Have a build_store_path_from_references function, and a build_store_path_from_fingerprint helper function that makes use of it. build_store_path_from_references is invoked from the derivation module which can be used to calculate the derivation path. In the derivation module, we also invoke build_store_path_from_fingerprint during the output path calculation. Change-Id: Ia8d61a5e8e5d3f396f93593676ed3f5d1a3f1d66 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8367 Autosubmit: flokli Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/cli/src/derivation.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'tvix/cli/src') diff --git a/tvix/cli/src/derivation.rs b/tvix/cli/src/derivation.rs index 5a04c2a11bb2..23c49d3d0974 100644 --- a/tvix/cli/src/derivation.rs +++ b/tvix/cli/src/derivation.rs @@ -1,6 +1,6 @@ //! Implements `builtins.derivation`, the core of what makes Nix build packages. use nix_compat::derivation::Derivation; -use nix_compat::{hash_placeholder, nixhash}; +use nix_compat::nixhash; use std::cell::RefCell; use std::collections::{btree_map, BTreeSet}; use std::rc::Rc; @@ -202,6 +202,7 @@ async fn strong_coerce_to_string(co: &GenCo, val: Value) -> Result