tvl-depot/tvix/nix-compat
Florian Klink 34fc4637eb refactor(tvix/nix-compat): rename NixHashWithMode -> CAHash
This specific struct is only used to represent content-addressed paths
(in case a Derivation has a fixed-output hash, for example).
Rename `Output`'s `hash_with_mode` to `ca_hash`.

We now also include `CAHash::Text`, and update the `validate` function
of the `Output` struct to reject text hashes there.

This allows cleaning up the various output path calculation functions
inside nix-compat/src/store_path/utils.rs, as they can now match on
the type.

`make_type` is renamed to `make_references_string`,
`build_regular_ca_path` is renamed to `build_ca_path`, and
`build_text_path` has a disclaimer added, because you might not actually
want to use it.

Change-Id: I674d065f2ed5c804012ddfed56e161ac49d23931
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9814
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2023-10-23 14:57:32 +00:00
..
benches feat(nix-compat): add bench for aterm parsing 2023-10-16 12:26:36 +00:00
src refactor(tvix/nix-compat): rename NixHashWithMode -> CAHash 2023-10-23 14:57:32 +00:00
Cargo.toml feat(nix-compat): add bench for aterm parsing 2023-10-16 12:26:36 +00:00
default.nix test(tvix/nix-compat/nar/writer/sync): add tests 2023-10-18 12:31:57 +00:00