lix compat: Hash::to_string removal #100
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "benaryorg/hydra:lix-to_string"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lix recently removed the
Hash::to_stringAPI.The replacement
to_base16()API however is equivalent toto_string(HashFormat::Base16, true)while this code usesfalseas the second parameter, which would embed the type in the resulting string.Manually encoding the base16 string from the underlying hash type is possible however, as it is exposed by the
Hashtype.Flake lock file updates:
Commit message above (semi-)verbatim.
Fixes #99
Lix has introduced `Hash::to_base16` recently, and removed the `Hash::to_string` API. Flake lock file updates: • Updated input 'lix': 'git+https://git.lix.systems/lix-project/lix?ref=refs/heads/main&rev=832932838bac4e4735025f3e6f13e5e856d94a70' (2026-08-14) → 'git+https://git.lix.systems/lix-project/lix?ref=refs/heads/main&rev=562630e26e4e459193a4769a16239d16084bca4a' (2026-08-22) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/02e08985a27c65ffd33d434eeb2e660a2e4dc84d' (2026-08-14) → 'github:NixOS/nixpkgs/a3b98866eecd08edac6e61a3081e69540a35020f' (2026-08-23) Signed-off-by: benaryorg <binary@benary.org>heya, thank you! we're not entirely confident this change is safe because we don't know hydra enough to gauge how that hash column could ever be used, but it's not far off from equivalent either.
and since you seem quite on top of hydra and lix head both, would you perhaps also be interested in more formally helping out with hydra? :)
@ -541,3 +541,3 @@product.subtype,product.fileSize ? std::make_optional(*product.fileSize) : std::nullopt,product.sha256hash ? std::make_optional(product.sha256hash->to_string(HashFormat::Base16, false)) : std::nullopt,product.sha256hash ? std::make_optional(product.sha256hash->to_base16()) : std::nullopt,that's not quite equivalent; the old code did not include the hash type in the string while this one would. it'll probably work anyway, but since the column is already named after the hash type there's no harm in doing somthing like
base16Encode(*product.sha256Hash)instead?You are absolutely correct, I totally missed the hash type prefix.
Is there any difference between using
base16Encode(*product.sha256hash)andbase16Encode(product.sha256hash.as_span())?Since the
to_base16()method usesas_span()I'd be inclined to use that one if there's no meaningful difference otherwise.I've amended the PR with the
*version for now.if you mean
base16Encode(product.sha256hash->as_span()), nope, those do exactly the same thing. hashes automatically convert to spans when used as such for convenience and to emulateDeref<Target = [u8]>you get in rust digests. we prefer to not useas_spanbecause we think it's clearer, but that's just preference148d9e60d3toefbfdf82f7I just have a Hydra instance running which builds Lix and Hydra with the latest version of nixpkgs' stable and unstable branches.
Neither am I well versed in C++, nor do I have a deep understanding of Hydra internals.
I'm also perpetually burnt out, so while I would absolutely want to help out more, it's just not possible at the moment (and my situation doesn't look like it's going to change anytime soon).
Sorry
@benaryorg wrote in #100 (comment):
that's absolutely fine. thank you for all your help regardless, and we hope things improve for you despite everything
Thanks everyone for the feedback and review!
Just as a quick side note for anyone stumbling on this; OIDC Lite seems to be broken on both nixos-unstable and nixos-26.05 right now, so if Hydra doesn't build due to a dependency failure for you, that's probably why.
Last known good commit on my end for nixos-26.05 is
a3b98866eecd, nixos-unstable at56c02bc00adc(in case it helps).