feat(tvix/nix-compat): input_derivations with StorePaths

...in `Derivation`.

This is more type-safe and should consume less memory.

This also removes some allocations in the potentially hot path of output hash calculation.

https: //b.tvl.fyi/issues/264
Change-Id: I6ad7d3cb868dc9f750894d449a6065608ef06e8c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10957
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: Peter Kolloch <info@eigenvalue.net>
Reviewed-by: Peter Kolloch <info@eigenvalue.net>
This commit is contained in:
Peter Kolloch 2024-02-21 18:24:50 +07:00 committed by clbot
parent a44a8985cc
commit c06fb01b3b
9 changed files with 138 additions and 73 deletions

View file

@ -149,7 +149,7 @@ pub(crate) fn write_outputs(
pub(crate) fn write_input_derivations(
writer: &mut impl Write,
input_derivations: &BTreeMap<BString, &BTreeSet<String>>,
input_derivations: &BTreeMap<impl AtermWriteable, BTreeSet<String>>,
) -> Result<(), io::Error> {
write_char(writer, BRACKET_OPEN)?;
@ -159,7 +159,7 @@ pub(crate) fn write_input_derivations(
}
write_char(writer, PAREN_OPEN)?;
writer.write_all(input_derivation_aterm)?;
input_derivation_aterm.aterm_write(writer)?;
write_char(writer, COMMA)?;
write_char(writer, BRACKET_OPEN)?;