diff options
author | Vova Kryachko <v.kryachko@gmail.com> | 2024-11-08T15·44-0500 |
---|---|---|
committer | Vladimir Kryachko <v.kryachko@gmail.com> | 2024-11-12T02·15+0000 |
commit | b564ed9d43f17c620439815b86d2940be197bd47 (patch) | |
tree | a828f081e0b9f3568366534b800c12d88d5cfff7 /users/edef/crunch-v2 | |
parent | 72bc4e0270891d72213989096ff1180adc07a578 (diff) |
feat(nix-daemon): Implement client handler. r/8907
This change includes only the basic nix handshake protocol handling and sets up a client session. The only supported operation at this point is SetOptions. Additional operations will be implemented in subsequent cls. Change-Id: I3eccd9e0ceb270c3865929543c702f1491768852 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12743 Autosubmit: Vladimir Kryachko <v.kryachko@gmail.com> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de> Reviewed-by: edef <edef@edef.eu> Reviewed-by: Brian Olsen <me@griff.name>
Diffstat (limited to 'users/edef/crunch-v2')
-rw-r--r-- | users/edef/crunch-v2/Cargo.lock | 57 | ||||
-rw-r--r-- | users/edef/crunch-v2/Cargo.nix | 165 |
2 files changed, 219 insertions, 3 deletions
diff --git a/users/edef/crunch-v2/Cargo.lock b/users/edef/crunch-v2/Cargo.lock index d7959aeee154..5a167c6d79f9 100644 --- a/users/edef/crunch-v2/Cargo.lock +++ b/users/edef/crunch-v2/Cargo.lock @@ -1430,6 +1430,7 @@ dependencies = [ "nix-compat-derive", "nom", "num-traits", + "num_enum", "pin-project-lite", "serde", "serde_json", @@ -1487,6 +1488,27 @@ dependencies = [ ] [[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] name = "number_prefix" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1959,6 +1981,15 @@ dependencies = [ ] [[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] name = "proc-macro2" version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2758,6 +2789,23 @@ dependencies = [ ] [[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] name = "tower-service" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3046,6 +3094,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +] + +[[package]] name = "xml-rs" version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" diff --git a/users/edef/crunch-v2/Cargo.nix b/users/edef/crunch-v2/Cargo.nix index 6bd2be6b113c..502d2ea497cd 100644 --- a/users/edef/crunch-v2/Cargo.nix +++ b/users/edef/crunch-v2/Cargo.nix @@ -4142,6 +4142,10 @@ rec { packageId = "num-traits"; } { + name = "num_enum"; + packageId = "num_enum"; + } + { name = "pin-project-lite"; packageId = "pin-project-lite"; optional = true; @@ -4167,7 +4171,7 @@ rec { name = "tokio"; packageId = "tokio"; optional = true; - features = [ "io-util" "macros" ]; + features = [ "io-util" "macros" "sync" ]; } { name = "tracing"; @@ -4187,13 +4191,14 @@ rec { features = { "async" = [ "tokio" ]; "bytes" = [ "dep:bytes" ]; - "default" = [ "async" "wire" "nix-compat-derive" ]; + "daemon" = [ "tokio" "nix-compat-derive" ]; + "default" = [ "async" "daemon" "wire" "nix-compat-derive" ]; "nix-compat-derive" = [ "dep:nix-compat-derive" ]; "pin-project-lite" = [ "dep:pin-project-lite" ]; "tokio" = [ "dep:tokio" ]; "wire" = [ "tokio" "pin-project-lite" "bytes" ]; }; - resolvedDefaultFeatures = [ "async" "bytes" "default" "nix-compat-derive" "pin-project-lite" "tokio" "wire" ]; + resolvedDefaultFeatures = [ "async" "bytes" "daemon" "default" "nix-compat-derive" "pin-project-lite" "tokio" "wire" ]; }; "nix-compat-derive" = rec { crateName = "nix-compat-derive"; @@ -4314,6 +4319,76 @@ rec { }; resolvedDefaultFeatures = [ "default" "libm" "std" ]; }; + "num_enum" = rec { + crateName = "num_enum"; + version = "0.7.3"; + edition = "2021"; + sha256 = "0yai0vafhy85mvhknzfqd7lm04hzaln7i5c599rhy8mj831kyqaf"; + authors = [ + "Daniel Wagner-Hall <dawagner@gmail.com>" + "Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>" + "Vincent Esche <regexident@gmail.com>" + ]; + dependencies = [ + { + name = "num_enum_derive"; + packageId = "num_enum_derive"; + usesDefaultFeatures = false; + } + ]; + features = { + "complex-expressions" = [ "num_enum_derive/complex-expressions" ]; + "default" = [ "std" ]; + "std" = [ "num_enum_derive/std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "num_enum_derive" = rec { + crateName = "num_enum_derive"; + version = "0.7.3"; + edition = "2021"; + sha256 = "0mksna1jj87ydh146gn6jcqkvvs920c3dgh0p4f3xk184kpl865g"; + procMacro = true; + authors = [ + "Daniel Wagner-Hall <dawagner@gmail.com>" + "Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>" + "Vincent Esche <regexident@gmail.com>" + ]; + dependencies = [ + { + name = "proc-macro-crate"; + packageId = "proc-macro-crate"; + optional = true; + } + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn 2.0.79"; + features = [ "parsing" ]; + } + ]; + devDependencies = [ + { + name = "syn"; + packageId = "syn 2.0.79"; + features = [ "extra-traits" "parsing" ]; + } + ]; + features = { + "complex-expressions" = [ "syn/full" ]; + "default" = [ "std" ]; + "proc-macro-crate" = [ "dep:proc-macro-crate" ]; + "std" = [ "proc-macro-crate" ]; + }; + resolvedDefaultFeatures = [ "proc-macro-crate" "std" ]; + }; "number_prefix" = rec { crateName = "number_prefix"; version = "0.4.0"; @@ -6476,6 +6551,23 @@ rec { "verbatim" = [ "syn/parsing" ]; }; }; + "proc-macro-crate" = rec { + crateName = "proc-macro-crate"; + version = "3.2.0"; + edition = "2021"; + sha256 = "0yzsqnavb3lmrcsmbrdjfrky9vcbl46v59xi9avn0796rb3likwf"; + libName = "proc_macro_crate"; + authors = [ + "Bastian Köcher <git@kchr.de>" + ]; + dependencies = [ + { + name = "toml_edit"; + packageId = "toml_edit"; + } + ]; + + }; "proc-macro2" = rec { crateName = "proc-macro2"; version = "1.0.88"; @@ -9062,6 +9154,51 @@ rec { }; resolvedDefaultFeatures = [ "codec" "default" "io" "io-util" ]; }; + "toml_datetime" = rec { + crateName = "toml_datetime"; + version = "0.6.8"; + edition = "2021"; + sha256 = "0hgv7v9g35d7y9r2afic58jvlwnf73vgd1mz2k8gihlgrf73bmqd"; + authors = [ + "Alex Crichton <alex@alexcrichton.com>" + ]; + features = { + "serde" = [ "dep:serde" ]; + }; + }; + "toml_edit" = rec { + crateName = "toml_edit"; + version = "0.22.22"; + edition = "2021"; + sha256 = "1xf7sxfzmnc45f75x302qrn5aph52vc8w226v59yhrm211i8vr2a"; + authors = [ + "Andronik Ordian <write@reusable.software>" + "Ed Page <eopage@gmail.com>" + ]; + dependencies = [ + { + name = "indexmap"; + packageId = "indexmap"; + features = [ "std" ]; + } + { + name = "toml_datetime"; + packageId = "toml_datetime"; + } + { + name = "winnow"; + packageId = "winnow"; + optional = true; + } + ]; + features = { + "default" = [ "parse" "display" ]; + "parse" = [ "dep:winnow" ]; + "perf" = [ "dep:kstring" ]; + "serde" = [ "dep:serde" "toml_datetime/serde" "dep:serde_spanned" ]; + }; + resolvedDefaultFeatures = [ "default" "display" "parse" ]; + }; "tower-service" = rec { crateName = "tower-service"; version = "0.3.3"; @@ -10658,6 +10795,28 @@ rec { ]; }; + "winnow" = rec { + crateName = "winnow"; + version = "0.6.20"; + edition = "2021"; + sha256 = "16y4i8z9vh8hazjxg5mvmq0c5i35wlk8rxi5gkq6cn5vlb0zxh9n"; + dependencies = [ + { + name = "memchr"; + packageId = "memchr"; + optional = true; + usesDefaultFeatures = false; + } + ]; + features = { + "debug" = [ "std" "dep:anstream" "dep:anstyle" "dep:is-terminal" "dep:terminal_size" ]; + "default" = [ "std" ]; + "simd" = [ "dep:memchr" ]; + "std" = [ "alloc" "memchr?/std" ]; + "unstable-doc" = [ "alloc" "std" "simd" "unstable-recover" ]; + }; + resolvedDefaultFeatures = [ "alloc" "default" "std" ]; + }; "xml-rs" = rec { crateName = "xml-rs"; version = "0.8.22"; |