I've tracked it down to this hGetSome, which consistently returns fewer bytes than requested at the same exact position in the my sample NAR.
To my eye, this doesn't look quite right. Instead of throwing an error, we should be looping to fetch the remaining bytes. Or we replace the hGetSome with hGet and block.
I've tracked it down to this
hGetSome
, which consistently returns fewer bytes than requested at the same exact position in the my sample NAR.To my eye, this doesn't look quite right. Instead of throwing an error, we should be looping to fetch the remaining bytes. Or we replace the
hGetSome
withhGet
and block.https://github.com/haskell-nix/hnix-store/blob/f0dfc6d67015c271a9423ef9687aa57d4f097283/hnix-store-core/src/System/Nix/Internal/Nar/Parser.hs#L415-L429
Sample error with debugging info