about summary refs log tree commit diff
path: root/tvix/store/src/nar/import.rs
AgeCommit message (Collapse)AuthorFilesLines
2024-05-04 r/8073 refactor(tvix/*store): use DS: DirectoryServiceFlorian Klink1-21/+15
We implement DirectoryService for Arc<DirectoryService> and Box<DirectoryService>, this is sufficient. Change-Id: I0a5a81cbc4782764406b5bca57f908ace6090737 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11586 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-03-28 r/7789 refactor(tvix/store/nar/import): use rstest fixtures from castoreFlorian Klink1-14/+18
This stops using the gen_{blob,directory}_service() functions from tvix_castore::utils in favor of the rstest-based fixtures. Change-Id: I4c2fff2926f34af63d3bd5c29c8e939dbdf7e062 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11274 Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
2024-01-09 r/7362 refactor(tvix/store/nar/import): use AsRefFlorian Klink1-25/+26
We need to be a bit careful and pass the BlobService around (similar to how we already do with the directory_putter), but that allows getting rid of a bunch of annoying trait bounds. We also stop spawning additional tasks where we can just use block_on. Change-Id: If36de0ee947d2c779d20a384308241d2262d4764 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10580 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
2024-01-01 r/7307 refactor(tvix/castore/tests): let gen_*_service return BoxesFlorian Klink1-6/+9
Only convert to and reuse an Arc<…> where needed. Change-Id: I2c1bc69cca5a4a3ebd3bdb33d6e28e1f5fb86cb9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10514 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2024-01-01 r/7306 refactor(tvix/store/nar/import): be a bit more genericFlorian Klink1-29/+40
Change-Id: If9a536949f36f428abea1a893f937fe7063e2f41 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10517 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2023-11-19 r/7035 feat(nix-compat/nar/reader): provide passthrough buffered I/Oedef1-5/+5
Allow taking advantage of the buffer of the underlying reader to avoid unnecessary copies of file data. We can't easily implement the methods of BufRead directly, since we have some extra I/O to perform in the final consume() invocation. That could be resolved at the cost of additional bookkeeping, but this will suffice for now. Change-Id: I8100cf0abd79e7469670b8596bd989be5db44a91 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10089 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-11-19 r/7034 fix(nix-compat/nar/reader): require BufReadedef1-2/+2
We rely on being able to make small reads cheaply, so this was already an implicit practical requirement. Requiring it explicitly removes a performance footgun, and makes further optimisations possible. Change-Id: I7f65880a41b1d6b5e6bf2e52dfe47d4c49b34bcd Reviewed-on: https://cl.tvl.fyi/c/depot/+/10088 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2023-11-05 r/6951 feat(tvix/store/nar): add read_nar methodFlorian Klink1-0/+336
This adds a function that can ingest a NAR file into a given blob_service and directory_service, returning the root node. Passing around the directory_putter is a bit annoying, but at least for this linear "reading through a NAR" case, we don't need it to be clone or sync. Change-Id: Ia26d596f5dffc6dbd69aa39a82b59bba41685a9c Reviewed-on: https://cl.tvl.fyi/c/depot/+/9915 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI