!lymvtcwDJ7ZA9Npq:lix.systems

Lix Development

402 Members
(Technical) development of Lix, the package manager, a Nix implementation. Please be mindful of ongoing technical conversations in this channel.135 Servers

Load older messages


SenderMessageTime
14 Oct 2025
@emilazy:matrix.orgemily I am also not entirely sure if there are any gremlins in the <algo>:<digest> format etc. which would be a pain to deal with in Nix 16:06:15
@emilazy:matrix.orgemily though it's probably tolerable if it's just in one lib function in Nixpkgs 16:06:22
@raitobezarius:matrix.orgraitobezarius Do you have a clear example of case where {from,to}NixBase32 would not roundtrip? 16:06:32
@raitobezarius:matrix.orgraitobezarius It's already known that Nix flavor of base32 is a bit special, but I cannot remember of seeing there was unambiguous cases. If anything, Nix always accepted $BASE32 + any char for a while (and probably still do). 16:07:06
@emilazy:matrix.orgemily frankly the hash formats are all very weird and I am not sure if it is really better to have their format details exposed to userspace rather than just treating them as opaque but interconvertible blogs 16:07:17
@raitobezarius:matrix.orgraitobezariusIt never honored any form of strict implementation of RFC464816:07:22
@emilazy:matrix.orgemilye.g. proliferation of Base32 use doesn't seem like a great thing16:07:32
@emilazy:matrix.orgemilyI believe there are cases where appending (or prepending?) a NUL byte will not change the result16:07:40
@emilazy:matrix.orgemilybecause of padding16:07:45
@emilazy:matrix.orgemilyand therefore decoding must fail to round-trip on one of them16:07:56
@emilazy:matrix.orgemilyI recall running into this when factoring out the Base32 functions16:08:03
@emilazy:matrix.orgemily Base32 lacks anything like Base64's = 16:08:46
@raitobezarius:matrix.orgraitobezariusThere are, but it only cause problem for strict implementations outside of CppNix/Lix16:09:48
@raitobezarius:matrix.orgraitobezarius(i.e. back when we dealt with nixbase32 in snix.)16:10:02
@emilazy:matrix.orgemily well, I mean that with to/from functions, Nixpkgs lib will have to implement the <algo>:<digest> and SRI logic 1:1 to match the implementations 16:10:28
@raitobezarius:matrix.orgraitobezarius I'm really unhappy about convertHash as a primitive, it also does not enable any form of detection of what pairs does it support and what it can do 16:10:34
@emilazy:matrix.orgemily this may be more "pure" but it also feels a bit error-prone compared to just having convertHash handle it 16:10:43
@emilazy:matrix.orgemilybut it at least only needs solving once16:10:52
@emilazy:matrix.orgemily(unless the quirks change later)16:10:55
@raitobezarius:matrix.orgraitobezariusYeah, but that direction is easy because the implementations accepts more than they should16:10:57
@raitobezarius:matrix.orgraitobezariuswhich would be a regression caught by tests hopefully16:11:30
@emilazy:matrix.orgemilyI think you would need a size parameter16:11:35
@emilazy:matrix.orgemilywhich is not very nice16:11:39
@emilazy:matrix.orgemilybecause now Nixpkgs has a look-up table of hashes to byte sizes too… etc.16:11:49
@emilazy:matrix.orgemilynot the end of the world16:12:02
@raitobezarius:matrix.orgraitobezarius I'm pretty confident that we don't want convertHash in Lix, we might accept convertBinary but I'm not super comfy about getting this on a short timeline, I'm confident about {from,to}{NixBase32,Base16,Base64} primitives in builtins.conversions and we can look at an convertHash implementation beforehand with such built-ins on a short timeline 16:13:05
@raitobezarius:matrix.orgraitobezariusI don't know what is the timeline you are operating with to have this code available16:13:39
@raitobezarius:matrix.orgraitobezarius Seems like the passAsFile thing used there is exploiting an implementation detail about passAsFile internal details, which does not seem to be an excellent usecase for convertHash 16:14:51
@k900:0upti.meK900OK question (please tell me if I'm being stupid), what's the actual use case for this?16:16:27
@emilazy:matrix.orgemily I don't care about it on a personal level, I just know that it regularly comes up as a blocker for using Lix for people, e.g. brew-nix used it, https://github.com/search?q=convertHash+language%3Anix&type=code shows many examples, and as i linked in https://github.com/NixOS/nixpkgs/pull/451929 an attempt to do feature-detection in Nixpkgs caused hash divergence between Nix and Lix 16:16:35

Show newer messages


Back to Room ListRoom Version: 10