about summary refs log tree commit diff
path: root/tvix
AgeCommit message (Collapse)AuthorFilesLines
2024-06-01 r/8191 feat(tvix/repl): Add a command to recursively printAspen Smith2-1/+16
Add a command, :p, to evaluate an expression and recursively print the result, as if `--strict` had been passed on the command line. Demonstration of this working: ❯ cargo r --bin tvix Finished dev [unoptimized + debuginfo] target(s) in 0.27s Running `target/debug/tvix` tvix-repl> { x = (x: x) 1; } => { x = <CODE>; } :: set tvix-repl> :p { x = (x: x) 1; } => { x = 1; } :: set Change-Id: I1a81d7481160c30d2a4483c6308e25fa45f2dfdf Reviewed-on: https://cl.tvl.fyi/c/depot/+/11738 Autosubmit: aspen <root@gws.fyi> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-06-01 r/8190 feat(tvix/repl): Add a help commandAspen Smith1-6/+29
Add a command to display help for the REPL, which can be either :? or :h. Change-Id: Ifdfd8c31130ca5afcde05a4c4276b768eb54c06f Reviewed-on: https://cl.tvl.fyi/c/depot/+/11737 Autosubmit: aspen <root@gws.fyi> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-06-01 r/8189 feat(tvix/repl): Implement :q, to quitAspen Smith1-0/+4
Change-Id: Ib3b314b21f4d8c30bfd674e79771179d51d4f2e9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11736 Autosubmit: aspen <root@gws.fyi> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-06-01 r/8188 refactor(tvix/repl): Abstract out REPL command handlingAspen Smith1-10/+26
Prepare for introducing additional REPL commands by splitting out the *parsing* of the repl commands, which returns a new ReplCommand type, from the actual *handling* of the commands. Change-Id: If81a53c1e2d90204d26ce3bb2ea9eebf7bb3fd51 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11734 Autosubmit: aspen <root@gws.fyi> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-06-01 r/8187 refactor(tvix): Break out REPL into its own moduleAspen Smith2-99/+122
In preparation for adding some new functionality to the tvix REPL, break it out into its own module. Change-Id: I4fb78320e92562e3474a3724536cb22c1d893e57 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11733 Tested-by: BuildkiteCI Autosubmit: aspen <root@gws.fyi> Reviewed-by: flokli <flokli@flokli.de>
2024-06-01 r/8186 feat(tvix/repl): Support multiline inputAspen Smith4-11/+102
Transparently support multiline input in the Tvix REPL, by handling the UnexpectedEOF error returned by the parser and using it to progressively build up an input expr over multiple iterations of the REPL's outer loop. This works quite nicely: ❯ cargo r --bin tvix Compiling tvix-cli v0.1.0 (/home/aspen/code/depot/tvix/cli) Finished dev [unoptimized + debuginfo] target(s) in 1.72s Running `target/debug/tvix` tvix-repl> { foo > = > 1; > } => { foo = 1; } :: set <press up arrow> tvix-repl> { foo = 1; } => { foo = 1; } :: set Change-Id: Ib0ed4766b13e8231d696cdc27281ac158e20a777 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11732 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: aspen <root@gws.fyi> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-05-30 r/8184 fix(tvix/eval): nix_tests.rs's eval_test requires impure flagIlan Joselevich1-0/+1
This fixes the following command: 'cargo test --no-default-features --features nix_tests' Change-Id: I9883c39e1e428c72a0e7e0b75a73c8ed734abd3b Reviewed-on: https://cl.tvl.fyi/c/depot/+/11740 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-05-30 r/8183 fix(tvix/eval): proptests require arbitrary featureFlorian Klink2-2/+2
`cargo test --no-default-features` fails, if we don't conditionalize this on the `arbitrary` feature too. Change-Id: I81a277810119fed0cfc37c942c422f731aa14b2e Reviewed-on: https://cl.tvl.fyi/c/depot/+/11726 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-05-30 r/8182 fix(tvix/eval/tests/one_offs): test_source_builtin can be pureFlorian Klink1-1/+1
`Evaluation::new_impure()` would require the test to be impure, but there's nothing in this test specifically requiring us to make use of impure features. Change-Id: Idb24981195d1a94f51053ae04403eb5f0e27f3d9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11725 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-05-30 r/8181 fix(tvix/eval/tests/nix_oracle): tests are impure-onlyFlorian Klink1-0/+2
This uses StdIO, which is only available when the `impure` feature is enabled. Change-Id: I039b1f45f6619dd099fa943e58322ff521482dfa Reviewed-on: https://cl.tvl.fyi/c/depot/+/11724 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-05-30 r/8180 refactor(tvix/eval): move nix_tests to separate moduleFlorian Klink2-198/+207
Gate this behind the nix_tests feature flag (which wasn't applied consistently). Also, at least right now all of these use StdIO internally, either by creating it on their own, or through the `eval_test` helper. Once we have some proper classification system for tests we can probably split this up further, but for now only run them if the impure feature is enabled. Change-Id: I3236cf09b3391585df99073367c4e4832c5e7898 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11723 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-05-30 r/8179 fix(tvix/eval/vm/generators): allow unused rq_{path_exists,read_dir}Florian Klink1-0/+2
These VM requests are only emitted by code gated behind the impure feature. To prevent warning from popping up when building without default features, allow these to be unused if `impure` is not enabled. Change-Id: Id871a5215e9a0f09aa78edecdd111369ee7ffe34 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11722 Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
2024-05-26 r/8176 fix(tvix/eval/nix_search_path): gate tests on impure featureFlorian Klink1-0/+2
These use StdIO, which is only available if the impure feature is enabled. Change-Id: I18d8e191a7eba6ba5bd59f43631973eaa796c7bb Reviewed-on: https://cl.tvl.fyi/c/depot/+/11721 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su>
2024-05-26 r/8175 fix(tvix/eval/io): OsStringExt and std::fs::File import are impure-onlyFlorian Klink1-2/+4
These are only needed when building with the impure feature enabled. This removes some warnings when building with --no-default-features. Change-Id: I3139d9133d4846aeb1b1b5f3830c0d078d047292 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11720 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2024-05-26 r/8174 fix(tvix/nix-compat): async nar reader requires wire featureFlorian Klink2-2/+2
It uses it internally. Change-Id: I8cb8fc9f567260d57f3a203407333d83beddf537 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11719 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2024-05-26 r/8173 fix(tvix/build): tonic-reflection feature needs castore with it tooFlorian Klink2-2/+2
If building tvix-build with the tonic-reflection feature, it needs to import `tvix_castore::proto::FILE_DESCRIPTOR_SET`, which is only available if tvix-castore is built with the `tonic-reflection` feature. Change-Id: I355b4c5b4c1333d5cc56335de47ad5d2f1db6337 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11716 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de>
2024-05-26 r/8172 refactor(tvix/castore): move src/fs/test into fuse modFlorian Klink3-8/+9
These tests only interact with the FUSE layer, and import super::fuse to do its work. However, this only works if the `fuse` feature is enabled, which we don't do if we enable the `virtiofs` feature only, causing the tests to fail: ``` ❯ cargo test --no-default-features --features virtiofs Compiling tvix-castore v0.1.0 (/home/flokli/dev/nixos/code.tvl.fyi-submit2/tvix/castore) error[E0432]: unresolved import `super::fuse` --> castore/src/fs/tests.rs:14:13 | 14 | use super::{fuse::FuseDaemon, TvixStoreFs}; | ^^^^ could not find `fuse` in `super` ``` We move src/fs/tests.rs to src/fs/fuse/tests.rs (and src/fs/fuse.rs to src/fs/fuse/mod.rs) to better structure this, which will automatically cause both tests and code to only be built if we have the `fuse` feature enabled. Change-Id: I8fbbad3e4457e326bdfd171aa5c43d25d3187b5b Reviewed-on: https://cl.tvl.fyi/c/depot/+/11715 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2024-05-26 r/8169 feat(tvix): filter src via lib.filesetIlan Joselevich1-0/+60
Previously changing any file (including default.nix or README.md) would cause Nix to compute a different derivation path, resulting in needing to (very often redundantly) rebuild the crate/package. With this change you can expect less rebuilds. Crate2nix currently does its own insufficient src filtering and it does not expose an API to override the filtering, so instead I created a function that we can use to override the src to have stricter filtering. I implemented the filtering for all of the workspace members, if you want to modify any of them, please read the lib.fileset docs https://nixos.org/manual/nixpkgs/unstable/#sec-functions-library-fileset Change-Id: I7ab5a0064a76938d14f7f65801be9f3a5c3bad04 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11714 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-05-25 r/8168 fix(tvix/eval): drop superfluous string context checkedef1-4/+1
cl/11712 simultaneously introduced this check and made it unnecessary, since NixString::context should never return `Some` for empty contexts now. Change-Id: I41a655ff33910e8326cbb7d7526eb91bd19e9585 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11713 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-05-25 r/8167 fix(tvix/eval): disallow empty but allocated string contextsedef1-3/+25
Both `Some(NixContext::new())` and `None` represent empty contexts, but the former trips up `NixString::has_context`, and seems likely to trip up other things. We could hide the difference in the accessors, but we don't really *want* the distinction to exist, since heap-allocating a null value is pretty much always a mistake. Change-Id: Ie84d26fb0d4b59e68354891ba13bde3bae40ab6e Reviewed-on: https://cl.tvl.fyi/c/depot/+/11712 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-05-23 r/8166 docs(tvix/docs/TODO): add item for string context reworkFlorian Klink1-0/+9
Change-Id: I4592490a75fb05093b3fd8649db3b57bff748c0d Reviewed-on: https://cl.tvl.fyi/c/depot/+/11707 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: edef <edef@edef.eu> Tested-by: BuildkiteCI
2024-05-23 r/8165 docs(tvix/TODO): toXML string context and self-closing tags is doneFlorian Klink1-3/+0
Change-Id: I83f6b1863a023ea0bf8518c67eb51f740c3ea89a Reviewed-on: https://cl.tvl.fyi/c/depot/+/11706 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Alyssa Ross <hi@alyssa.is>
2024-05-23 r/8164 feat(tvix/eval): rm NixContext::join, add take_context & IntoIteratorFlorian Klink6-60/+57
In places where we want to extend context with that from another NixString, use take_context() to split it off, then call .extend(), making use of IntoIterator to avoid a bunch of clones. Change-Id: I2460141a3ed776c64c36132b2203b6a1d710b922 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11705 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: edef <edef@edef.eu>
2024-05-23 r/8163 feat(tvix/eval): teach builtins.toXML contextFlorian Klink4-6/+53
XmlEmitter gains a NixContext field, and `write_typed_value` extends it with all context elements present in the passed value. Once all serialization is done, a into_context() function returns the collected context, so we can construct a NixString with context. Tests for this live in tvix-glue, as we use builtins.derivation, which is not present in the tvix-eval crate. Fixes b/398. Change-Id: I85feaaa17b753885f8a017a54e419ec4e602af21 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11704 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de> Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Alyssa Ross <hi@alyssa.is>
2024-05-23 r/8162 feat(tvix/eval): add NixContext::extendFlorian Klink1-1/+9
This is a slightly less annoying version of `join`, which does not consume self. It's more consistent with HashSet::extend(). Change-Id: Ifd0872da36fe8e7b2aa6948674cb8e4023abe9d7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11703 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: edef <edef@edef.eu>
2024-05-23 r/8161 fix(tvix/eval): NixString are bytesFlorian Klink1-1/+1
This is not necessarily valid UTF-8. Change-Id: I72f3157240772eb9c558e5699b4785e44d256fd4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11702 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2024-05-22 r/8160 refactor(tvix/eval): rewrite xml emitter to be simple-stupidProfpatsch9-89/+205
In order to be compatible with the nix XML generator, it’s easier to generate the XML directly, instead of going through a library which we have to bend to do what we need. Removes dependency on `xml-rs`, which came with a full XML parser that we didn’t use. Only takes a tiny bit of code for the XML escaping, somewhat simplified. I add a little escaping value, to make sure we have the same behaviour as nix proper. Interestingly enough, we never need to escape XML attribute names, because the `builtins.toXML` format encodes user-defined values as attribute keys only. So we only escape attribute values. Fixes: https://b.tvl.fyi/issues/399 Change-Id: If4d407d324864b3bb9aa3160e2ec6889f7727127 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11697 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de> Autosubmit: Profpatsch <mail@profpatsch.de>
2024-05-20 r/8159 feat(tvix/store): concurrently upload small blobs during nar ingestionConnor Brewster1-12/+22
Currently all blobs are uploaded serially when ingesting NARs. If a NAR contains many, small blobs, ingestion may become slow if there is a lot of round-trip latency to the blob service. This makes the NAR ingester use the ConcurrentBlobUploader which allows for buffering small blobs in memory so they can be uploaded concurrently to the blob service without blocking further deserialization. Change-Id: I093a73770232df12d9a11e5d901b99c08505c3cb Reviewed-on: https://cl.tvl.fyi/c/depot/+/11694 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-05-20 r/8158 refactor(tvix/castore): extract concurrent blob uploaderConnor Brewster3-97/+190
The archive ingester has a mechanism for concurrently uploading small blobs to the blob service in order to hide round trip latency with the blob service when ingesting many small blobs. Other ingestion sources like NARs also need a similar mechanism, this extracts the concurrent blob uploading mechanism into its own struct to make it more reusable. Change-Id: I05020419ff4b9ad5829fbfb5cd08d36db983b8c0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11693 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-05-20 r/8157 refactor(tvix/store/pathinfo): test with PathInfoService directlyFlorian Klink4-71/+58
Since cl/…, a PathInfoService doesn't need to implement `calculate_nar` anymore, so most of them don't actually have a handle to a {Blob,Directory}Service anymore. This means, we can simplify the construction of them for test cases a lot. Change-Id: I100e9e1c9b00a049b4d6136c57aad4cdb04461c6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11691 Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
2024-05-20 r/8156 fix(tvix/eval): use fake values for __curPos, rather than an errorFlorian Klink1-2/+9
Have this return the same values as builtins.unsafeGetAttrsPos, rather than returning a CatchableErrorKind, which crashes the CLI if it bubbles up. The environment we're in doesn't allow emitting a warning, as we don't have `co` in scope, but that's probably OK as a stopgap solution. Alternative to cl/11665. Change-Id: I5b2c2530842547c93b6533ed9601ee9b2923b1bf Reviewed-on: https://cl.tvl.fyi/c/depot/+/11685 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2024-05-16 r/8154 docs(tvix): Begin documenting the Nix daemon protocolBrian Olsen5-0/+1527
This adds rough notes documenting the history of the Nix daemon protocol, how logging works as well as begins documenting inputs and outputs for all operations. Change-Id: Id24a9a658c3e4e7c350ca1e4622f63ed96ccef5a Reviewed-on: https://cl.tvl.fyi/c/depot/+/11594 Reviewed-by: Adam Joseph <adam@westernsemico.com> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-05-16 r/8153 fix(castore/directory/objectstore): fix responses for deduplicated dirsYureka1-7/+13
Using remove_node messed up the extraction of nodes from the graph. Use into_nodes_edges() instead, to remove the nodes without cloning. Change-Id: Id76c7935d082d6f26192cc3cd490483594f1d1e2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11684 Tested-by: BuildkiteCI Autosubmit: yuka <yuka@yuka.dev> Reviewed-by: flokli <flokli@flokli.de>
2024-05-16 r/8152 chore(tvix): drop json feature for tracing-subscriberFlorian Klink5-58/+5
Drop the (unused) feature flags here, and get rid of some crate dependencies. Change-Id: Id64852b498725467d56abb12b548301cfba6a760 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11678 Reviewed-by: Connor Brewster <cbrewster@hey.com> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-05-16 r/8151 feat(tvix/build): drop json loggingFlorian Klink3-21/+6
This has already been dropped for tvix-store, drop it here as well. Change-Id: Ib3aa37bbe9fd4c498b5ba1213f7d922d0c64ffc7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11677 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
2024-05-16 r/8150 feat(tvix/store): add ObjectStoreDirectoryServiceYureka8-11/+332
Change-Id: I1636012be2e8ee3ae64f7bc62fd28bfe0cb2bca5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11668 Autosubmit: yuka <yuka@yuka.dev> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-05-15 r/8149 chore(tvix): bump to tokio-listener 0.4.1Florian Klink4-840/+74
This gives multi-listener support, as well as listening on named socket FDs. Change-Id: I92b441f854e2faf80074463d0ca6bdc23cbd890a Reviewed-on: https://cl.tvl.fyi/c/depot/+/11663 Tested-by: BuildkiteCI Reviewed-by: yuka <yuka@yuka.dev> Autosubmit: flokli <flokli@flokli.de>
2024-05-15 r/8148 chore(tvix/store): bump otlp stackFlorian Klink3-361/+101
This aligns the tonic version we use directly in Tvix to the one pulled in by the OTLP stack. Change-Id: I658528c8dabb7cd6948f1207ddcdef1984e82037 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11666 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: yuka <yuka@yuka.dev> Tested-by: BuildkiteCI
2024-05-15 r/8147 chore(tvix/nar-bridge): move to nar-bridge-goFlorian Klink32-14/+13
Make some space for the rust implementation. Change-Id: I924dc1657be10abe5a11951c3b9de50bae06db19 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11662 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: yuka <yuka@yuka.dev>
2024-05-13 r/8144 feat(tvix/store/pathinfo): add a Cache combinatorFlorian Klink2-0/+113
This allows querying two PathInfoService implementations sequentially, and inserts into the "near" one if it's not there yet. There is no negative cache, and put / listing is not implemented (for now). Change-Id: I24c3d0e0c3c2f0524a6cc7b2f3cbc33eb20cf92b Reviewed-on: https://cl.tvl.fyi/c/depot/+/11636 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-05-13 r/8143 fix(tvix/castore/grpc): don't use explicit channelFlorian Klink1-47/+36
We can just use the `BoxStream` directly, or a `once` with the single `Directory`. In the recursive case, we also did not properly close the channel after the first error. Change-Id: Ifad56d307fc7861107b6d3cffd28d35631d526e6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11635 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com> Autosubmit: flokli <flokli@flokli.de>
2024-05-13 r/8142 feat(tvix/castore/directory/get_recursive): add 'static to BoxStreamFlorian Klink5-6/+6
Necessary to directly use this in the GRPC DirectoryService wrapper directly. Change-Id: Ic6a0038a40dc30071d145af5035345fcd93288ae Reviewed-on: https://cl.tvl.fyi/c/depot/+/11634 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-05-13 r/8141 feat(tvix/castore/directory/traverse_directory): simplifyFlorian Klink1-48/+43
Use try_stream! rather than stream!, and a bit more map_err and ok_err to make things a bit more concise. Once we have proper error types here, and impl Froms, a lot of the error mapping would disappear entirely. Change-Id: I5240a6b0ff7818b94c151322774242b2c142e33b Reviewed-on: https://cl.tvl.fyi/c/depot/+/11633 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
2024-05-13 r/8140 feat(tvix/castore/directory/traverse): simplify codeFlorian Klink1-53/+42
Replace the loop manually driving the iterator with a for … in, and some of the match with ok_or_else. Change-Id: I6d7b3ef1bf1c7aa128bd6adef09390b54f79479e Reviewed-on: https://cl.tvl.fyi/c/depot/+/11632 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-05-13 r/8139 chore(tvix/clippy): configure clippy allow block_in_conditionsFlorian Klink5-3/+15
… in Cargo.toml. This gets an imperative `cargo clippy` run to pick up that config, so `-A clippy::blocks_in_conditions` doesn't need to be explicitly specified anymore. Change-Id: I32b6cc50c77c22cba0d816d0db508c2f94b2c383 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11659 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: edef <edef@edef.eu> Tested-by: BuildkiteCI
2024-05-12 r/8117 feat(tvix/store/pathinfo/*): add more instrumentationFlorian Klink6-11/+20
Add instrumentation to the get() and put() implementations of all PathInfoService. Use the nixbase32 representation of the digest, not the base64 one. Change-Id: Iea79bbd363bf20f23985e877c6fc1793bbee6a7e Reviewed-on: https://cl.tvl.fyi/c/depot/+/11630 Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-05-11 r/8115 refactor(tvix/castore/error): drop From<PoisonError<T>> for ErrorFlorian Klink1-7/+0
We don't produce these erorrs anymore, no need to provide a conversion to it. Change-Id: I37933e436ad15c5d90b3ac270c4ef5742980513d Reviewed-on: https://cl.tvl.fyi/c/depot/+/11614 Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
2024-05-11 r/8114 refactor(tvix/castore/directoryservice/memory): use tokio RwLockFlorian Klink1-3/+4
We don't want to block here, and this also means there's no poisoning to deal with. Change-Id: Ic375571970c48beace0005ae2c012135086a4d67 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11613 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-05-11 r/8113 refactor(tvix/castore/blobservice/memory): use parking_lot RwLockFlorian Klink5-31/+27
This one doesn't require us to deal with poisoning, is upgradeable and the right thing to use when locking access to data, not IO resources. Change-Id: I78634953a73404500d28f51f1d93a87e215c8149 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11612 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-05-11 r/8112 refactor(tvix/store/pathinfo/memory): tokio RwLock, improve list()Florian Klink1-14/+14
We don't want to use the std::sync::RwLock here, as it blocks. This also means we don't need to deal with the error cases anymore. The list() implementation is updated to use try_stream, which means we can now avoid collecting everything into a Vec before returning from it. Change-Id: I9057dcc410dc553e6b1be3f20d5ee830569e8218 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11611 Reviewed-by: Connor Brewster <cbrewster@hey.com> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI