From c35a5ff611eed94c4cf32de4e26baca4fe38889e Mon Sep 17 00:00:00 2001 From: Picnoir Date: Thu, 21 Mar 2024 09:53:23 +0100 Subject: feat(users/picnoir/tvix-daemon): parse up to the operation Using all the primitives recently implemented to nix-compat to reach the point where the Nix client start to send us operation requests. Using a small integration test script (or the VM test, but let's face it, it's too slow to be useful), we manage to reach the point where we're able to read a store operation: 2024-03-21T18:53:27.624876Z INFO tvix_daemon: Incoming connection addr=unix 2024-03-21T18:53:27.625312Z INFO worker:perform_init_handshake: tvix_daemon: Trust sent conn=Connection(unix) conn=Connection(unix) 2024-03-21T18:53:27.625406Z INFO worker: tvix_daemon: Client hanshake succeeded conn=Connection(unix) 2024-03-21T18:53:27.625488Z INFO worker: tvix_daemon: Operation received op=SetOptions conn=Connection(unix) We had to take some shortcuts wrt. stderr/log management. The CPP Nix codebase is a bit confusing in that area. I'll need to spend more time reading this to fully understand what's happening there. For now, sending the STDERR_LAST command to the client does the trick. Change-Id: I9b0e20a52d885e64fe29188496aac5334de61edd Reviewed-on: https://cl.tvl.fyi/c/depot/+/11233 Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/nix-compat/src/wire/worker_protocol.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tvix/nix-compat/src/wire/worker_protocol.rs') diff --git a/tvix/nix-compat/src/wire/worker_protocol.rs b/tvix/nix-compat/src/wire/worker_protocol.rs index 3d891068eab7..ed47aedbca46 100644 --- a/tvix/nix-compat/src/wire/worker_protocol.rs +++ b/tvix/nix-compat/src/wire/worker_protocol.rs @@ -6,6 +6,8 @@ use tokio::io::{AsyncReadExt, AsyncWriteExt}; use crate::wire::primitive; +pub static STDERR_LAST: u64 = 0x616c7473; + /// Worker Operation /// /// These operations are encoded as unsigned 64 bits before being sent -- cgit 1.4.1