snix/tvix/glue/src
Florian Klink 4535824166 refactor(tvix/glue): move toFile to import builtins
This does import the contents into the store, so it should belong in there.

While moving, I also noticed the code copying to the BlobService can be
shared with the one used when importing a blob via import helper.
It was a bit hidden - due to the contents being available as a bytes, we
used a Cursor and wrote it with tokio::io::copy.

However, Cursor implements both AsyncRead and Read, so we can factor out
the copying code into a copy_to_blobservice helper function and use it
in both places.

The output name being wrong error kind arguably is still a bit misplaced
here, but that's left for later.

Change-Id: Iec3c422c12270ee111f864d2b78c0861f78edfa4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/13254
Reviewed-by: Domen Kožar <domen@cachix.org>
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2025-03-13 12:08:04 +00:00
..
builtins refactor(tvix/glue): move toFile to import builtins 2025-03-13 12:08:04 +00:00
fetchers refactor(tvix/glue): make user-agent more granular 2024-11-29 08:09:50 +00:00
tests test(tvix/glue): check context of __toString after toJSON 2024-11-04 10:39:19 +00:00
.skip-subtree refactor(tvix): move tvix glue code into glue crate 2023-11-04 15:18:44 +00:00
fetchurl.nix refactor(tvix): move tvix glue code into glue crate 2023-11-04 15:18:44 +00:00
fetchurl.rs feat(tvix/glue): support builtin:fetchurl 2024-06-12 22:31:17 +00:00
known_paths.rs refactor(tvix/glue): remove use of lazy_static 2024-10-13 14:45:17 +00:00
lib.rs refactor(tvix/glue): make user-agent more granular 2024-11-29 08:09:50 +00:00
tvix_build.rs refactor(tvix/build): use stricter BuildRequest type 2024-10-24 18:09:09 +00:00
tvix_io.rs docs(tvix/glue/tvix_io): update doc-comments 2024-08-19 10:24:37 +00:00
tvix_store_io.rs fix(tvix): use tracing::field::Empty for all indicatif.pb_show 2024-11-12 00:28:32 +00:00