about summary refs log tree commit diff
path: root/tvix/derivation/src/tests/mod.rs
AgeCommit message (Collapse)AuthorFilesLines
2023-01-06 r/5613 refactor(tvix/store): rename NixPath to StorePathFlorian Klink1-3/+3
As discussed in #tvl, this is a more common term for it. Change-Id: I9b904222b8c076f82192c9b7f0b42be171614ab7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7776 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2023-01-06 r/5612 test(tvix/derivation): add output_path_construction testFlorian Klink1-1/+156
This exercises the output path calculation functions like a constructing client (an implementation of builtins.derivation) would do. It first assembles the bar derivation, does the output path calculation on it, then continues with the foo derivation. The code ensures the resulting Derivations match our fixtures. Change-Id: If93f89c6622fac1c1941085083931b6f657c04bc Reviewed-on: https://cl.tvl.fyi/c/depot/+/7775 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2023-01-06 r/5610 feat(tvix/derivation): implement output path calculationFlorian Klink1-0/+93
This implement output path calculation for fixed outputs, both fixed- output and non-fixed-output. Change-Id: I0a77b99f2ba6b39467cc5dd589ce152a40387f9a Reviewed-on: https://cl.tvl.fyi/c/depot/+/7761 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: jrhahn <mail.jhahn@gmail.com>
2023-01-06 r/5608 refactor(derivation): return NixPath in calculate_derivation_pathFlorian Klink1-1/+5
This moves all the hash compression logic into a common helper function. Also update the docstring, which said "path" here, which could have been confused with output paths. Change-Id: Iedfb59aeb24f7638afac669dcd18d57b6cfaece2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7759 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2023-01-04 r/5591 feat(tvix/derivation): implement Derivation::validate()Florian Klink1-0/+10
Change-Id: I87dfadda872439e108e5f678a5da63dd5b1915d1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7732 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2023-01-04 r/5580 feat(tvix/derivation): add nix drv path generation to DerivationJürgen Hahn1-0/+17
This adds a function to generate the derivation path. The computation is based on the Go implementation. Change-Id: Iae89db4976f5fd9208f0453f73688689a245cd66 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7729 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2023-01-04 r/5577 feat(tvix/derivation) Add fmt::Display implementation for DerivationJürgen Hahn1-3/+9
This adds the implementation of fmt::Display for Derivation so that we can easily store the formatted content as a string. Internally, we use the serialization function to generate the string. Change-Id: I6caca0d6c1bea3ca44b6c535c5b1d5d66d8413b7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7741 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-01-02 r/5564 refactor(tvix/derivation): refactor the derivation serializationJürgen Hahn1-2/+2
This refactors the code to serialize a derivation. The original code has beed moved to seperate crates for better code structure. Change-Id: I3b1a6b134428fcbc9930c330bced8ec3610cfb4c Reviewed-on: https://cl.tvl.fyi/c/depot/+/7733 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2022-12-29 r/5536 feat(tvix/derivation): serialize Nix DerivationJürgen Hahn1-0/+32
This adds a Derivation structure and allows to write it to a structure that implements std::fmt:Write. The implementation is based on the go-nix version. Change-Id: Ib54e1202b5c67f5d206b21bc109a751e971064cf Reviewed-on: https://cl.tvl.fyi/c/depot/+/7659 Reviewed-by: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI