tvl-depot/corp/tvixbolt
Ryan Lahfa 75cc52ddb1 fix(tvix/eval): getContext merges underlying values
Previously, we were assembling very naively an attribute set composed of context we saw.

But it was forgetting that `"${drv}${drv.drvPath}"` would contain 2 contexts with the same key, but
with different values, one with `outputs = [ "out" ];` and `allOutputs = true;`.

Following this reasoning and comparing with what Nix does, we ought to merge underlying values systematically.

Hence, I bring `itertools` to perform a group by on the key and merge everything on the fly, it's not
beautiful but it's the best I could find, notice that I don't use
`group_by` but I talk about group by, that is, because `group_by` is a
`group_by_consecutive`, see
https://github.com/rust-itertools/itertools/issues/374.

Initially, I tried to do it without a `into_grouping_map_by`, it was akin to assemble the final `NixAttrs` directly,
it was less readable and harder to pull out because we don't have a lot of in-place mutable functions on
our data structures.

Change-Id: I9933c9bd88ffe04de50dda14f21879b60d8b8cd4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10620
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
2024-01-17 17:25:24 +00:00
..
src refactor(tvix/eval): remove code and location from struct 2023-12-31 13:15:24 +00:00
.gitignore chore(corp/tvixbolt): gitignore trunk's dist folder 2022-09-20 10:59:32 +00:00
Cargo.lock fix(tvix/eval): getContext merges underlying values 2024-01-17 17:25:24 +00:00
Cargo.toml chore(3p/sources): bump channels & overlays (2023-12-29) 2023-12-29 21:52:10 +00:00
default.nix refactor(tvix): build Rust projects using crate2nix 2022-12-15 17:26:45 +00:00
index.css feat(corp/tvixbolt): add some additional information on the page 2022-09-04 18:50:06 +00:00
index.html feat(web/static): serve terminalcss from static.tvl.{fyi|su} 2023-06-15 10:09:52 +00:00