refactor(tvix/nix-compat): absorb //tvix/derivation

Put this in its src/derivation.

Change-Id: Ic047ab1c2da555a833ee454e10ef60c77537b617
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7967
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
Florian Klink 2023-01-31 14:45:42 +01:00 committed by clbot
parent 9e809e21cc
commit 2d24c5f260
34 changed files with 60 additions and 148 deletions

View file

@ -1,10 +1,10 @@
//! Implements `builtins.derivation`, the core of what makes Nix build packages.
use data_encoding::BASE64;
use nix_compat::derivation::{Derivation, Hash};
use std::cell::RefCell;
use std::collections::{btree_map, BTreeSet};
use std::rc::Rc;
use tvix_derivation::{Derivation, Hash};
use tvix_eval::builtin_macros::builtins;
use tvix_eval::{AddContext, CoercionKind, ErrorKind, NixAttrs, NixList, Value, VM};
@ -416,9 +416,10 @@ mod derivation_builtins {
// TODO: fail on derivation references (only "plain" is allowed here)
let path = tvix_derivation::path_with_references(name.as_str(), content.as_str(), refs)
.map_err(Error::InvalidDerivation)?
.to_absolute_path();
let path =
nix_compat::derivation::path_with_references(name.as_str(), content.as_str(), refs)
.map_err(Error::InvalidDerivation)?
.to_absolute_path();
state.borrow_mut().plain(&path);

View file

@ -1,6 +1,6 @@
use nix_compat::derivation::DerivationError;
use std::rc::Rc;
use thiserror::Error;
use tvix_derivation::DerivationError;
/// Errors related to derivation construction
#[derive(Debug, Error, PartialEq)]