about summary refs log tree commit diff
path: root/tvix/derivation/src/output.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-01-04 r/5592 feat(tvix/derivation): derive Clone, Debug, Eq and PartialEqFlorian Klink1-2/+2
This allows juggling with Derivation structs in unit tests, and makes it very easy to compare them for equality. Change-Id: I1faf2ec1eefb1a40fcee3c29f04ec47d29f22691 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7758 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2023-01-04 r/5591 feat(tvix/derivation): implement Derivation::validate()Florian Klink1-0/+6
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/5590 chore(tvix/derivation): align json serialization with nix outputFlorian Klink1-1/+1
Use the #[serde(rename = "…")] field attributes to match the field names that Nix uses in its JSON output (nix show-derivation). This allows us to just re-use the exact same fixtures from go-nix, without manual post-massaging. Change-Id: Ifd5c08e43cd4f50d5e02903eccd8cb37230b70a6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7757 Reviewed-by: jrhahn <mail.jhahn@gmail.com> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2023-01-04 r/5589 refactor(tvix/derivation): make output hashes an Option<Hash>Florian Klink1-10/+17
This conveys better if an output of a Derivation is fixed-output or not, and provides a Hash struct that can be used to store the algo and digest. In case it's not, this can simply be None. The serde field attributes have been updated to still accept the same JSON. We currently still store the hash algo and digest as strings, mostly because the only thing populating it so far is the example JSONs. We might want to update this, once actual Nix code populates this. While updating write.rs, I pushed some of the Vec<String> to [&str] conversions inline, and made it a Vec<&str>, because it was annoying to juggle with. Change-Id: Ia9cd0568fe179ac22a4a636237f22ab4ad92b95b Reviewed-on: https://cl.tvl.fyi/c/depot/+/7746 Tested-by: BuildkiteCI Reviewed-by: jrhahn <mail.jhahn@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su>
2023-01-02 r/5564 refactor(tvix/derivation): refactor the derivation serializationJürgen Hahn1-0/+16
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>