diff options
author | Florian Klink <flokli@flokli.de> | 2024-03-14T13·08+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-03-15T10·23+0000 |
commit | 907ecff999e9f5e8cffbc1b6ab0edc97e672c833 (patch) | |
tree | dd0155c2e783625ef28345a88d5e5824ea2c246d /tvix/Cargo.nix | |
parent | 905a79308e8b9b66736e6cc62edc62d60f026cb9 (diff) |
feat(nix-compat/wire): add low-level wire format primitives code r/7695
This brings some initial Nix wire format parsing code, used in the nix daemon protocol, remote store/builder protocol, as well as the NAR format itself (note we already have more specialized code for the last one). Thanks to embr, this code already exists, in https://codeberg.org/gorgon/gorgon/src/branch/main/nix-daemon/src/wire.rs, and we can vendor it into here, as EUPL is compatible with GPL (in that direction). The code uses the tokio::io Reader and Writer traits, not the ones from the `futures` crate, as they provide some more convenient `read_u64_le` functions. More application-specific parsing code, as well as code to read strings, or bytes are left out for now, as we want to be be more restrictive w.r.t allowed max sizes, and need to parse bytes, not strings. The code slightly diverges, as we have clippy looped into CI. `Ok(…?)` can be turned into just the inner expression, and some .and_then can be expressed in a simpler fashion. Change-Id: Ie3adcb485e9d66786673b1962a08d4e5df3781d9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11148 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
Diffstat (limited to 'tvix/Cargo.nix')
-rw-r--r-- | tvix/Cargo.nix | 57 |
1 files changed, 54 insertions, 3 deletions
diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix index 6fc42a71b59f..258461ffe427 100644 --- a/tvix/Cargo.nix +++ b/tvix/Cargo.nix @@ -5149,6 +5149,12 @@ rec { name = "thiserror"; packageId = "thiserror"; } + { + name = "tokio"; + packageId = "tokio"; + optional = true; + features = [ "io-util" "macros" ]; + } ]; devDependencies = [ { @@ -5187,15 +5193,20 @@ rec { packageId = "test-generator"; } { + name = "tokio-test"; + packageId = "tokio-test"; + } + { name = "zstd"; packageId = "zstd"; } ]; features = { - "async" = [ "futures-util" ]; + "async" = [ "futures-util" "tokio" ]; "futures-util" = [ "dep:futures-util" ]; + "tokio" = [ "dep:tokio" ]; }; - resolvedDefaultFeatures = [ "async" "futures-util" ]; + resolvedDefaultFeatures = [ "async" "futures-util" "tokio" ]; }; "nom" = rec { crateName = "nom"; @@ -9687,7 +9698,7 @@ rec { "tracing" = [ "dep:tracing" ]; "windows-sys" = [ "dep:windows-sys" ]; }; - resolvedDefaultFeatures = [ "bytes" "default" "fs" "io-std" "io-util" "libc" "macros" "mio" "net" "num_cpus" "rt" "rt-multi-thread" "signal" "signal-hook-registry" "socket2" "sync" "time" "tokio-macros" "windows-sys" ]; + resolvedDefaultFeatures = [ "bytes" "default" "fs" "io-std" "io-util" "libc" "macros" "mio" "net" "num_cpus" "rt" "rt-multi-thread" "signal" "signal-hook-registry" "socket2" "sync" "test-util" "time" "tokio-macros" "windows-sys" ]; }; "tokio-io-timeout" = rec { crateName = "tokio-io-timeout"; @@ -9995,6 +10006,46 @@ rec { }; resolvedDefaultFeatures = [ "default" "xattr" ]; }; + "tokio-test" = rec { + crateName = "tokio-test"; + version = "0.4.3"; + edition = "2021"; + sha256 = "06fplzcc2ymahfzykd2ickw2qn7g3lz47bll00865s1spnx3r6z8"; + authors = [ + "Tokio Contributors <team@tokio.rs>" + ]; + dependencies = [ + { + name = "async-stream"; + packageId = "async-stream"; + } + { + name = "bytes"; + packageId = "bytes"; + } + { + name = "futures-core"; + packageId = "futures-core"; + } + { + name = "tokio"; + packageId = "tokio"; + features = [ "rt" "sync" "time" "test-util" ]; + } + { + name = "tokio-stream"; + packageId = "tokio-stream"; + } + ]; + devDependencies = [ + { + name = "tokio"; + packageId = "tokio"; + features = [ "full" ]; + } + ]; + + }; "tokio-util" = rec { crateName = "tokio-util"; version = "0.7.10"; |