907ecff999
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>
53 lines
1.3 KiB
TOML
53 lines
1.3 KiB
TOML
[package]
|
|
name = "nix-compat"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
[features]
|
|
async = ["futures-util", "tokio"]
|
|
|
|
[dependencies]
|
|
bitflags = "2.4.1"
|
|
bstr = { version = "1.6.0", features = ["alloc", "unicode", "serde"] }
|
|
data-encoding = "2.3.3"
|
|
ed25519 = "2.2.3"
|
|
ed25519-dalek = "2.1.0"
|
|
futures-util = { version = "0.3.30", features = ["io"], optional = true }
|
|
glob = "0.3.0"
|
|
nom = "7.1.3"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
sha2 = "0.10.6"
|
|
thiserror = "1.0.38"
|
|
|
|
[dependencies.tokio]
|
|
optional = true
|
|
version = "1.32.0"
|
|
features = ["io-util", "macros"]
|
|
|
|
[dev-dependencies]
|
|
futures = { version = "0.3.30", default-features = false, features = ["executor"] }
|
|
lazy_static = "1.4.0"
|
|
serde_json = "1.0"
|
|
test-case = "3.3.1"
|
|
criterion = { version = "0.5", features = ["html_reports"] }
|
|
hex-literal = "0.4.1"
|
|
pretty_assertions = "1.4.0"
|
|
tokio-test = "0.4.3"
|
|
zstd = "^0.13.0"
|
|
|
|
[dev-dependencies.test-generator]
|
|
# This fork of test-generator adds support for cargo workspaces, see
|
|
# also https://github.com/frehberg/test-generator/pull/14
|
|
git = "https://github.com/JamesGuthrie/test-generator.git"
|
|
rev = "82e799979980962aec1aa324ec6e0e4cad781f41"
|
|
|
|
[[bench]]
|
|
name = "derivation_parse_aterm"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "narinfo_parse"
|
|
harness = false
|