diff options
author | Ryan Lahfa <tvl@lahfa.xyz> | 2023-12-26T01·03+0100 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-01-03T23·23+0000 |
commit | 099ca6b7c0b95d1e7d5134ac465b50bbd86660c5 (patch) | |
tree | 7f582c23f9fbfa2a8d5a1ca4eb02b1bd8651fcbf /tvix/glue/src/tvix_io.rs | |
parent | 15309c7debfeb94977d1622dc6ed604d32710435 (diff) |
feat(tvix/glue): contextful derivation r/7338
We calculate the input context by performing the union of context over all input of the derivation. Then, we just pass the rest of it to the remaining machinery. Finally, we re-emit an `outPath` and a `drvPath` containing the expected contexts. Change-Id: I74905fb258b5bee8b08d1208c9eb87f51b92a890 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10436 Autosubmit: raitobezarius <tvl@lahfa.xyz> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/glue/src/tvix_io.rs')
-rw-r--r-- | tvix/glue/src/tvix_io.rs | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/tvix/glue/src/tvix_io.rs b/tvix/glue/src/tvix_io.rs index 52bbd7bc9cda..77dcb9291032 100644 --- a/tvix/glue/src/tvix_io.rs +++ b/tvix/glue/src/tvix_io.rs @@ -8,30 +8,19 @@ //! otherwise fundamental features like nixpkgs bootstrapping and hash //! calculation will not work. -use std::cell::RefCell; use std::io; use std::path::{Path, PathBuf}; -use std::rc::Rc; use tvix_eval::{EvalIO, FileType}; -use crate::known_paths::KnownPaths; - // TODO: Merge this together with TvixStoreIO? pub struct TvixIO<T: EvalIO> { - /// Ingested paths must be reported to this known paths tracker - /// for accurate build reference scanning. - known_paths: Rc<RefCell<KnownPaths>>, - // Actual underlying [EvalIO] implementation. actual: T, } impl<T: EvalIO> TvixIO<T> { - pub fn new(known_paths: Rc<RefCell<KnownPaths>>, actual: T) -> Self { - Self { - known_paths, - actual, - } + pub fn new(actual: T) -> Self { + Self { actual } } } @@ -42,10 +31,6 @@ impl<T: EvalIO> EvalIO for TvixIO<T> { fn import_path(&self, path: &Path) -> io::Result<PathBuf> { let imported_path = self.actual.import_path(path)?; - self.known_paths - .borrow_mut() - .plain(imported_path.to_string_lossy()); - Ok(imported_path) } |