feat(tvix/nix-compat): introduce write_bytes

Write counterpart of read_bytes. Despite its name, we mostly use it to
write strings (as in ascii strings) to the wire.

We also extract the padding calculation in its own function.

Change-Id: I8d936e989961107261b3089e4275acbd2c093a7f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11230
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
Picnoir 2024-03-21 16:09:43 +01:00 committed by picnoir picnoir
parent f7cdbbef45
commit 017ff431fe
2 changed files with 79 additions and 10 deletions

View file

@ -1,4 +1,4 @@
{ depot, lib, pkgs, ... }:
{ depot, pkgs, ... }:
let
crate2nix = pkgs.callPackage ./Cargo.nix {
@ -19,6 +19,22 @@ in
{
shell = (import ./shell.nix { inherit pkgs; });
tvix-daemon = crate2nix.rootCrate.build;
clippy = pkgs.stdenv.mkDerivation {
src = ./.;
cargoDeps = crate2nix.allWorkspaceMembers;
name = "tvix-daemon-clippy";
nativeBuildInputs = with pkgs; [
cargo
clippy
pkg-config
protobuf
rustc
rustPlatform.cargoSetupHook
];
buildPhase = "cargo clippy --tests --all-features --benches --examples | tee $out";
};
meta.ci.targets = [
"tvix-daemon"
"shell"