about summary refs log tree commit diff
path: root/tvix/nix-compat/src/wire/primitive.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-03-22 r/7758 feat(tvix/nix-compat): add read_u32 wire primitivePicnoir1-1/+35
Change-Id: I87a40f79ee7e91bc4fe3dc0ee7818a533c729373 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11225 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-03-19 r/7741 feat(tvix/nix-compat): introduce magic hello/responsePicnoir1-0/+5
Setting the wire module as public to re-use it from tvix-daemon. Change-Id: I570cffc480c7b784d813663f77572bbe9d4e8259 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11197 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-03-15 r/7696 docs(nix-compat/wire): update docstringsFlorian Klink1-5/+4
These are not streams, but AsyncRead and AsyncWrite. Change-Id: I7d988fa0490800b72862f4f0fcac3dceac70ec26 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11149 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
2024-03-15 r/7695 feat(nix-compat/wire): add low-level wire format primitives codeFlorian Klink1-0/+75
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>