snix/tvix/glue/src
Connor Brewster 63116d8c21 fix(tvix): Avoid buffering file into memory in builtins.hashFile
Right now `builtins.hashFile` always reads the entire file into memory
before hashing, which is not ideal for large files. This replaces
`read_to_string` with `open_file` which allows calculating the hash of
the file without buffering it entirely into memory. Other callers can
continue to buffer into memory if they choose, but they still use the
`open_file` VM request and then call `read_to_string` or `read_to_end`
on the `std::io::Reader`.

Fixes b/380

Change-Id: Ifa1c8324bcee8f751604b0b449feab875c632fda
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11236
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-04-09 17:31:58 +00:00
..
builtins fix(tvix): Avoid buffering file into memory in builtins.hashFile 2024-04-09 17:31:58 +00:00
tests feat(tvix/eval): implement appendContext 2024-04-04 17:24:26 +00:00
.skip-subtree refactor(tvix): move tvix glue code into glue crate 2023-11-04 15:18:44 +00:00
decompression.rs feat(tvix/glue): Add AsyncRead wrapper to decompress streams 2024-03-11 11:35:18 +00:00
fetchurl.nix refactor(tvix): move tvix glue code into glue crate 2023-11-04 15:18:44 +00:00
known_paths.rs refactor(nix-compat/store_path): take [u8;32] for outer fingerprint 2024-03-14 16:52:42 +00:00
lib.rs feat(tvix/glue): Add AsyncRead wrapper to decompress streams 2024-03-11 11:35:18 +00:00
refscan.rs refactor(tvix): move tvix glue code into glue crate 2023-11-04 15:18:44 +00:00
tvix_build.rs feat(tvix/nix-compat): Use StorePath in Output 2024-02-21 11:38:03 +00:00
tvix_io.rs fix(tvix): Avoid buffering file into memory in builtins.hashFile 2024-04-09 17:31:58 +00:00
tvix_store_io.rs fix(tvix): Avoid buffering file into memory in builtins.hashFile 2024-04-09 17:31:58 +00:00