From 8df919dcf04b5c2502f3a63b4d013669da5e70c1 Mon Sep 17 00:00:00 2001 From: Vova Kryachko Date: Sun, 10 Nov 2024 11:16:48 -0500 Subject: [PATCH] refactor(nix-compat): Move serialization machinery into wire. This groups most `wire` feature gated logic into a single module. The nix_daemon module will be gated by a feature that adds nix-compat-derive as a dependency. All of this is a way to break the crate2nix dependency cycle between nix-compat and nix-compat-derive(which depends on nix-compat for its doctests). Change-Id: I95938a6f280c11967371ff21f8b5a19e6d3d3805 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12761 Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/nix-compat-derive-tests/tests/read_derive.rs | 4 ++-- .../tests/ui/deserialize_bad_type.stderr | 2 +- .../ui/deserialize_from_str_error_not_display.stderr | 2 +- .../tests/ui/deserialize_remote_missing_attr.stderr | 7 ++++--- .../ui/deserialize_try_from_error_not_display.stderr | 2 +- tvix/nix-compat-derive-tests/tests/write_derive.rs | 2 +- tvix/nix-compat-derive/src/de.rs | 8 ++++---- tvix/nix-compat-derive/src/ser.rs | 8 ++++---- tvix/nix-compat/src/lib.rs | 2 -- tvix/nix-compat/src/nix_daemon/mod.rs | 6 ------ tvix/nix-compat/src/nix_daemon/worker_protocol.rs | 2 +- tvix/nix-compat/src/{nix_daemon => wire}/de/bytes.rs | 2 +- .../src/{nix_daemon => wire}/de/collections.rs | 2 +- tvix/nix-compat/src/{nix_daemon => wire}/de/int.rs | 2 +- tvix/nix-compat/src/{nix_daemon => wire}/de/mock.rs | 4 ++-- tvix/nix-compat/src/{nix_daemon => wire}/de/mod.rs | 0 .../nix-compat/src/{nix_daemon => wire}/de/reader.rs | 5 ++--- tvix/nix-compat/src/wire/mod.rs | 6 ++++++ .../src/{nix_daemon => wire}/protocol_version.rs | 0 .../nix-compat/src/{nix_daemon => wire}/ser/bytes.rs | 2 +- .../src/{nix_daemon => wire}/ser/collections.rs | 2 +- .../src/{nix_daemon => wire}/ser/display.rs | 0 tvix/nix-compat/src/{nix_daemon => wire}/ser/int.rs | 2 +- tvix/nix-compat/src/{nix_daemon => wire}/ser/mock.rs | 12 ++++++------ tvix/nix-compat/src/{nix_daemon => wire}/ser/mod.rs | 0 .../src/{nix_daemon => wire}/ser/writer.rs | 6 ++---- tvix/store/src/bin/tvix-store.rs | 2 +- users/picnoir/tvix-daemon/src/main.rs | 2 +- 28 files changed, 45 insertions(+), 49 deletions(-) rename tvix/nix-compat/src/{nix_daemon => wire}/de/bytes.rs (97%) rename tvix/nix-compat/src/{nix_daemon => wire}/de/collections.rs (97%) rename tvix/nix-compat/src/{nix_daemon => wire}/de/int.rs (98%) rename tvix/nix-compat/src/{nix_daemon => wire}/de/mock.rs (98%) rename tvix/nix-compat/src/{nix_daemon => wire}/de/mod.rs (100%) rename tvix/nix-compat/src/{nix_daemon => wire}/de/reader.rs (99%) rename tvix/nix-compat/src/{nix_daemon => wire}/protocol_version.rs (100%) rename tvix/nix-compat/src/{nix_daemon => wire}/ser/bytes.rs (98%) rename tvix/nix-compat/src/{nix_daemon => wire}/ser/collections.rs (97%) rename tvix/nix-compat/src/{nix_daemon => wire}/ser/display.rs (100%) rename tvix/nix-compat/src/{nix_daemon => wire}/ser/int.rs (98%) rename tvix/nix-compat/src/{nix_daemon => wire}/ser/mock.rs (98%) rename tvix/nix-compat/src/{nix_daemon => wire}/ser/mod.rs (100%) rename tvix/nix-compat/src/{nix_daemon => wire}/ser/writer.rs (98%) diff --git a/tvix/nix-compat-derive-tests/tests/read_derive.rs b/tvix/nix-compat-derive-tests/tests/read_derive.rs index e47c8ad43..56123026f 100644 --- a/tvix/nix-compat-derive-tests/tests/read_derive.rs +++ b/tvix/nix-compat-derive-tests/tests/read_derive.rs @@ -1,7 +1,7 @@ use std::str::FromStr; -use nix_compat::nix_daemon::de::mock::{Builder, Error}; -use nix_compat::nix_daemon::de::NixRead; +use nix_compat::wire::de::mock::{Builder, Error}; +use nix_compat::wire::de::NixRead; use nix_compat_derive::NixDeserialize; #[derive(Debug, PartialEq, Eq, NixDeserialize)] diff --git a/tvix/nix-compat-derive-tests/tests/ui/deserialize_bad_type.stderr b/tvix/nix-compat-derive-tests/tests/ui/deserialize_bad_type.stderr index 12ffdc83c..9a57d5e2d 100644 --- a/tvix/nix-compat-derive-tests/tests/ui/deserialize_bad_type.stderr +++ b/tvix/nix-compat-derive-tests/tests/ui/deserialize_bad_type.stderr @@ -15,7 +15,7 @@ error[E0277]: the trait bound `BadType: NixDeserialize` is not satisfied u64 usize note: required by a bound in `try_read_value` - --> $WORKSPACE/nix-compat/src/nix_daemon/de/mod.rs + --> $WORKSPACE/nix-compat/src/wire/de/mod.rs | | fn try_read_value( | ^^^^^^^^^^^^^^ required by this bound in `NixRead::try_read_value` diff --git a/tvix/nix-compat-derive-tests/tests/ui/deserialize_from_str_error_not_display.stderr b/tvix/nix-compat-derive-tests/tests/ui/deserialize_from_str_error_not_display.stderr index 8283ed534..9041e261c 100644 --- a/tvix/nix-compat-derive-tests/tests/ui/deserialize_from_str_error_not_display.stderr +++ b/tvix/nix-compat-derive-tests/tests/ui/deserialize_from_str_error_not_display.stderr @@ -7,7 +7,7 @@ error[E0277]: `()` doesn't implement `std::fmt::Display` = help: the trait `std::fmt::Display` is not implemented for `()` = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead note: required by a bound in `invalid_data` - --> $WORKSPACE/nix-compat/src/nix_daemon/de/mod.rs + --> $WORKSPACE/nix-compat/src/wire/de/mod.rs | | fn invalid_data(msg: T) -> Self { | ^^^^^^^^^^^^ required by this bound in `Error::invalid_data` diff --git a/tvix/nix-compat-derive-tests/tests/ui/deserialize_remote_missing_attr.stderr b/tvix/nix-compat-derive-tests/tests/ui/deserialize_remote_missing_attr.stderr index a1c18adc6..fe6047ba5 100644 --- a/tvix/nix-compat-derive-tests/tests/ui/deserialize_remote_missing_attr.stderr +++ b/tvix/nix-compat-derive-tests/tests/ui/deserialize_remote_missing_attr.stderr @@ -1,5 +1,6 @@ error: Missing from_str, from or try_from attribute - --> tests/ui/deserialize_remote_missing_attr.rs:10:25 + --> tests/ui/deserialize_remote_missing_attr.rs:11:5 | -10 | nix_deserialize_remote!(#[nix()] Value); - | ^^^^^^^^^^^^^^ +11 | / #[nix()] +12 | | Value + | |_________^ diff --git a/tvix/nix-compat-derive-tests/tests/ui/deserialize_try_from_error_not_display.stderr b/tvix/nix-compat-derive-tests/tests/ui/deserialize_try_from_error_not_display.stderr index 8e55a3c56..27a2aa10a 100644 --- a/tvix/nix-compat-derive-tests/tests/ui/deserialize_try_from_error_not_display.stderr +++ b/tvix/nix-compat-derive-tests/tests/ui/deserialize_try_from_error_not_display.stderr @@ -7,7 +7,7 @@ error[E0277]: `()` doesn't implement `std::fmt::Display` = help: the trait `std::fmt::Display` is not implemented for `()` = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead note: required by a bound in `invalid_data` - --> $WORKSPACE/nix-compat/src/nix_daemon/de/mod.rs + --> $WORKSPACE/nix-compat/src/wire/de/mod.rs | | fn invalid_data(msg: T) -> Self { | ^^^^^^^^^^^^ required by this bound in `Error::invalid_data` diff --git a/tvix/nix-compat-derive-tests/tests/write_derive.rs b/tvix/nix-compat-derive-tests/tests/write_derive.rs index 1ed5dbf7e..435b7be75 100644 --- a/tvix/nix-compat-derive-tests/tests/write_derive.rs +++ b/tvix/nix-compat-derive-tests/tests/write_derive.rs @@ -1,6 +1,6 @@ use std::fmt; -use nix_compat::nix_daemon::ser::{ +use nix_compat::wire::ser::{ mock::{Builder, Error}, NixWrite as _, }; diff --git a/tvix/nix-compat-derive/src/de.rs b/tvix/nix-compat-derive/src/de.rs index e678b50b0..d9779713d 100644 --- a/tvix/nix-compat-derive/src/de.rs +++ b/tvix/nix-compat-derive/src/de.rs @@ -58,12 +58,12 @@ fn nix_deserialize_impl( quote! { #[automatically_derived] - impl #impl_generics #crate_path::nix_daemon::de::NixDeserialize for #ty #ty_generics + impl #impl_generics #crate_path::wire::de::NixDeserialize for #ty #ty_generics #where_clause { #[allow(clippy::manual_async_fn)] fn try_deserialize(reader: &mut R) -> impl ::std::future::Future, R::Error>> + Send + '_ - where R: ?Sized + #crate_path::nix_daemon::de::NixRead + Send, + where R: ?Sized + #crate_path::wire::de::NixRead + Send, { #body } @@ -253,7 +253,7 @@ fn nix_deserialize_try_from(crate_path: &Path, ty: &Type) -> TokenStream { quote_spanned! { ty.span() => async move { - use #crate_path::nix_daemon::de::Error; + use #crate_path::wire::de::Error; if let Some(item) = reader.try_read_value::<#ty>().await? { >::try_from(item) .map_err(Error::invalid_data) @@ -269,7 +269,7 @@ fn nix_deserialize_from_str(crate_path: &Path, span: Span) -> TokenStream { quote_spanned! { span => async move { - use #crate_path::nix_daemon::de::Error; + use #crate_path::wire::de::Error; if let Some(buf) = reader.try_read_bytes().await? { let s = ::std::str::from_utf8(&buf) .map_err(Error::invalid_data)?; diff --git a/tvix/nix-compat-derive/src/ser.rs b/tvix/nix-compat-derive/src/ser.rs index 47ddfa393..52e777c28 100644 --- a/tvix/nix-compat-derive/src/ser.rs +++ b/tvix/nix-compat-derive/src/ser.rs @@ -55,13 +55,13 @@ fn nix_serialize_impl( quote! { #[automatically_derived] - impl #impl_generics #crate_path::nix_daemon::ser::NixSerialize for #ty #ty_generics + impl #impl_generics #crate_path::wire::ser::NixSerialize for #ty #ty_generics #where_clause { async fn serialize(&self, writer: &mut W) -> std::result::Result<(), W::Error> - where W: #crate_path::nix_daemon::ser::NixWrite + where W: #crate_path::wire::ser::NixWrite { - use #crate_path::nix_daemon::ser::Error as _; + use #crate_path::wire::ser::Error as _; #body } } @@ -207,7 +207,7 @@ fn nix_serialize_try_into(crate_path: &Path, ty: &Type) -> TokenStream { quote_spanned! { ty.span() => { - use #crate_path::nix_daemon::ser::Error; + use #crate_path::wire::ser::Error; let other : #ty = ::clone(self).try_into().map_err(Error::unsupported_data)?; writer.write_value(&other).await } diff --git a/tvix/nix-compat/src/lib.rs b/tvix/nix-compat/src/lib.rs index f30c55788..ae9f16744 100644 --- a/tvix/nix-compat/src/lib.rs +++ b/tvix/nix-compat/src/lib.rs @@ -18,5 +18,3 @@ pub mod wire; pub mod nix_daemon; #[cfg(feature = "wire")] pub use nix_daemon::worker_protocol; -#[cfg(feature = "wire")] -pub use nix_daemon::ProtocolVersion; diff --git a/tvix/nix-compat/src/nix_daemon/mod.rs b/tvix/nix-compat/src/nix_daemon/mod.rs index a943b279f..633fdbebd 100644 --- a/tvix/nix-compat/src/nix_daemon/mod.rs +++ b/tvix/nix-compat/src/nix_daemon/mod.rs @@ -1,7 +1 @@ pub mod worker_protocol; - -mod protocol_version; -pub use protocol_version::ProtocolVersion; - -pub mod de; -pub mod ser; diff --git a/tvix/nix-compat/src/nix_daemon/worker_protocol.rs b/tvix/nix-compat/src/nix_daemon/worker_protocol.rs index cc99bdb54..92259a063 100644 --- a/tvix/nix-compat/src/nix_daemon/worker_protocol.rs +++ b/tvix/nix-compat/src/nix_daemon/worker_protocol.rs @@ -10,7 +10,7 @@ use tokio::io::{AsyncReadExt, AsyncWriteExt}; use crate::wire; -use super::ProtocolVersion; +use crate::wire::ProtocolVersion; static WORKER_MAGIC_1: u64 = 0x6e697863; // "nixc" static WORKER_MAGIC_2: u64 = 0x6478696f; // "dxio" diff --git a/tvix/nix-compat/src/nix_daemon/de/bytes.rs b/tvix/nix-compat/src/wire/de/bytes.rs similarity index 97% rename from tvix/nix-compat/src/nix_daemon/de/bytes.rs rename to tvix/nix-compat/src/wire/de/bytes.rs index 7daced54e..4c64247f7 100644 --- a/tvix/nix-compat/src/nix_daemon/de/bytes.rs +++ b/tvix/nix-compat/src/wire/de/bytes.rs @@ -34,7 +34,7 @@ mod test { use rstest::rstest; use tokio_test::io::Builder; - use crate::nix_daemon::de::{NixRead, NixReader}; + use crate::wire::de::{NixRead, NixReader}; #[rstest] #[case::empty("", &hex!("0000 0000 0000 0000"))] diff --git a/tvix/nix-compat/src/nix_daemon/de/collections.rs b/tvix/nix-compat/src/wire/de/collections.rs similarity index 97% rename from tvix/nix-compat/src/nix_daemon/de/collections.rs rename to tvix/nix-compat/src/wire/de/collections.rs index cf79f5845..e1271635e 100644 --- a/tvix/nix-compat/src/nix_daemon/de/collections.rs +++ b/tvix/nix-compat/src/wire/de/collections.rs @@ -64,7 +64,7 @@ mod test { use rstest::rstest; use tokio_test::io::Builder; - use crate::nix_daemon::de::{NixDeserialize, NixRead, NixReader}; + use crate::wire::de::{NixDeserialize, NixRead, NixReader}; #[rstest] #[case::empty(vec![], &hex!("0000 0000 0000 0000"))] diff --git a/tvix/nix-compat/src/nix_daemon/de/int.rs b/tvix/nix-compat/src/wire/de/int.rs similarity index 98% rename from tvix/nix-compat/src/nix_daemon/de/int.rs rename to tvix/nix-compat/src/wire/de/int.rs index eecf641cf..d505de9b1 100644 --- a/tvix/nix-compat/src/nix_daemon/de/int.rs +++ b/tvix/nix-compat/src/wire/de/int.rs @@ -45,7 +45,7 @@ mod test { use rstest::rstest; use tokio_test::io::Builder; - use crate::nix_daemon::de::{NixRead, NixReader}; + use crate::wire::de::{NixRead, NixReader}; #[rstest] #[case::simple_false(false, &hex!("0000 0000 0000 0000"))] diff --git a/tvix/nix-compat/src/nix_daemon/de/mock.rs b/tvix/nix-compat/src/wire/de/mock.rs similarity index 98% rename from tvix/nix-compat/src/nix_daemon/de/mock.rs rename to tvix/nix-compat/src/wire/de/mock.rs index 31cc3a489..8a1fb8177 100644 --- a/tvix/nix-compat/src/nix_daemon/de/mock.rs +++ b/tvix/nix-compat/src/wire/de/mock.rs @@ -6,7 +6,7 @@ use std::thread; use bytes::Bytes; use thiserror::Error; -use crate::nix_daemon::ProtocolVersion; +use crate::wire::ProtocolVersion; use super::NixRead; @@ -189,7 +189,7 @@ mod test { use bytes::Bytes; use hex_literal::hex; - use crate::nix_daemon::de::NixRead; + use crate::wire::de::NixRead; use super::{Builder, Error}; diff --git a/tvix/nix-compat/src/nix_daemon/de/mod.rs b/tvix/nix-compat/src/wire/de/mod.rs similarity index 100% rename from tvix/nix-compat/src/nix_daemon/de/mod.rs rename to tvix/nix-compat/src/wire/de/mod.rs diff --git a/tvix/nix-compat/src/nix_daemon/de/reader.rs b/tvix/nix-compat/src/wire/de/reader.rs similarity index 99% rename from tvix/nix-compat/src/nix_daemon/de/reader.rs rename to tvix/nix-compat/src/wire/de/reader.rs index 87c623b22..b7825f393 100644 --- a/tvix/nix-compat/src/nix_daemon/de/reader.rs +++ b/tvix/nix-compat/src/wire/de/reader.rs @@ -8,8 +8,7 @@ use bytes::{Buf, BufMut, Bytes, BytesMut}; use pin_project_lite::pin_project; use tokio::io::{AsyncBufRead, AsyncRead, AsyncReadExt, ReadBuf}; -use crate::nix_daemon::ProtocolVersion; -use crate::wire::EMPTY_BYTES; +use crate::wire::{ProtocolVersion, EMPTY_BYTES}; use super::{Error, NixRead}; @@ -270,7 +269,7 @@ mod test { use tokio_test::io::Builder; use super::*; - use crate::nix_daemon::de::NixRead; + use crate::wire::de::NixRead; #[tokio::test] async fn test_read_u64() { diff --git a/tvix/nix-compat/src/wire/mod.rs b/tvix/nix-compat/src/wire/mod.rs index a197e3a1f..c3e88dda0 100644 --- a/tvix/nix-compat/src/wire/mod.rs +++ b/tvix/nix-compat/src/wire/mod.rs @@ -3,3 +3,9 @@ mod bytes; pub use bytes::*; + +mod protocol_version; +pub use protocol_version::ProtocolVersion; + +pub mod de; +pub mod ser; diff --git a/tvix/nix-compat/src/nix_daemon/protocol_version.rs b/tvix/nix-compat/src/wire/protocol_version.rs similarity index 100% rename from tvix/nix-compat/src/nix_daemon/protocol_version.rs rename to tvix/nix-compat/src/wire/protocol_version.rs diff --git a/tvix/nix-compat/src/nix_daemon/ser/bytes.rs b/tvix/nix-compat/src/wire/ser/bytes.rs similarity index 98% rename from tvix/nix-compat/src/nix_daemon/ser/bytes.rs rename to tvix/nix-compat/src/wire/ser/bytes.rs index 19494934f..4338d3f87 100644 --- a/tvix/nix-compat/src/nix_daemon/ser/bytes.rs +++ b/tvix/nix-compat/src/wire/ser/bytes.rs @@ -45,7 +45,7 @@ mod test { use tokio::io::AsyncWriteExt as _; use tokio_test::io::Builder; - use crate::nix_daemon::ser::{NixWrite, NixWriter}; + use crate::wire::ser::{NixWrite, NixWriter}; #[rstest] #[case::empty("", &hex!("0000 0000 0000 0000"))] diff --git a/tvix/nix-compat/src/nix_daemon/ser/collections.rs b/tvix/nix-compat/src/wire/ser/collections.rs similarity index 97% rename from tvix/nix-compat/src/nix_daemon/ser/collections.rs rename to tvix/nix-compat/src/wire/ser/collections.rs index 70c32e1c7..478e1d04d 100644 --- a/tvix/nix-compat/src/nix_daemon/ser/collections.rs +++ b/tvix/nix-compat/src/wire/ser/collections.rs @@ -53,7 +53,7 @@ mod test { use tokio::io::AsyncWriteExt as _; use tokio_test::io::Builder; - use crate::nix_daemon::ser::{NixSerialize, NixWrite, NixWriter}; + use crate::wire::ser::{NixSerialize, NixWrite, NixWriter}; #[rstest] #[case::empty(vec![], &hex!("0000 0000 0000 0000"))] diff --git a/tvix/nix-compat/src/nix_daemon/ser/display.rs b/tvix/nix-compat/src/wire/ser/display.rs similarity index 100% rename from tvix/nix-compat/src/nix_daemon/ser/display.rs rename to tvix/nix-compat/src/wire/ser/display.rs diff --git a/tvix/nix-compat/src/nix_daemon/ser/int.rs b/tvix/nix-compat/src/wire/ser/int.rs similarity index 98% rename from tvix/nix-compat/src/nix_daemon/ser/int.rs rename to tvix/nix-compat/src/wire/ser/int.rs index 1be06442e..e68179c71 100644 --- a/tvix/nix-compat/src/nix_daemon/ser/int.rs +++ b/tvix/nix-compat/src/wire/ser/int.rs @@ -67,7 +67,7 @@ mod test { use tokio::io::AsyncWriteExt as _; use tokio_test::io::Builder; - use crate::nix_daemon::ser::{NixWrite, NixWriter}; + use crate::wire::ser::{NixWrite, NixWriter}; #[rstest] #[case::simple_false(false, &hex!("0000 0000 0000 0000"))] diff --git a/tvix/nix-compat/src/nix_daemon/ser/mock.rs b/tvix/nix-compat/src/wire/ser/mock.rs similarity index 98% rename from tvix/nix-compat/src/nix_daemon/ser/mock.rs rename to tvix/nix-compat/src/wire/ser/mock.rs index 1319a8da3..7104a9423 100644 --- a/tvix/nix-compat/src/nix_daemon/ser/mock.rs +++ b/tvix/nix-compat/src/wire/ser/mock.rs @@ -7,7 +7,7 @@ use std::thread; use ::proptest::prelude::TestCaseError; use thiserror::Error; -use crate::nix_daemon::ProtocolVersion; +use crate::wire::ProtocolVersion; use super::NixWrite; @@ -491,11 +491,11 @@ mod test { use proptest::prelude::TestCaseError; use proptest::proptest; - use crate::nix_daemon::ser::mock::proptest::arb_extra_write; - use crate::nix_daemon::ser::mock::Operation; - use crate::nix_daemon::ser::mock::OperationType; - use crate::nix_daemon::ser::Error as _; - use crate::nix_daemon::ser::NixWrite; + use crate::wire::ser::mock::proptest::arb_extra_write; + use crate::wire::ser::mock::Operation; + use crate::wire::ser::mock::OperationType; + use crate::wire::ser::Error as _; + use crate::wire::ser::NixWrite; use super::{Builder, Error}; diff --git a/tvix/nix-compat/src/nix_daemon/ser/mod.rs b/tvix/nix-compat/src/wire/ser/mod.rs similarity index 100% rename from tvix/nix-compat/src/nix_daemon/ser/mod.rs rename to tvix/nix-compat/src/wire/ser/mod.rs diff --git a/tvix/nix-compat/src/nix_daemon/ser/writer.rs b/tvix/nix-compat/src/wire/ser/writer.rs similarity index 98% rename from tvix/nix-compat/src/nix_daemon/ser/writer.rs rename to tvix/nix-compat/src/wire/ser/writer.rs index 87e30580a..da1c2b18c 100644 --- a/tvix/nix-compat/src/nix_daemon/ser/writer.rs +++ b/tvix/nix-compat/src/wire/ser/writer.rs @@ -8,9 +8,7 @@ use bytes::{Buf, BufMut, BytesMut}; use pin_project_lite::pin_project; use tokio::io::{AsyncWrite, AsyncWriteExt}; -use crate::nix_daemon::ProtocolVersion; -use crate::wire::padding_len; -use crate::wire::EMPTY_BYTES; +use crate::wire::{padding_len, ProtocolVersion, EMPTY_BYTES}; use super::{Error, NixWrite}; @@ -225,7 +223,7 @@ mod test { use tokio::io::AsyncWriteExt as _; use tokio_test::io::Builder; - use crate::nix_daemon::ser::NixWrite; + use crate::wire::ser::NixWrite; use super::NixWriter; diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs index 0ae18ec21..75f1ec11d 100644 --- a/tvix/store/src/bin/tvix-store.rs +++ b/tvix/store/src/bin/tvix-store.rs @@ -3,9 +3,9 @@ use clap::Subcommand; use futures::StreamExt; use futures::TryStreamExt; -use nix_compat::nix_daemon::de::Error; use nix_compat::nixhash::CAHash; use nix_compat::nixhash::NixHash; +use nix_compat::wire::de::Error; use nix_compat::{path_info::ExportedPathInfo, store_path::StorePath}; use serde::Deserialize; use serde::Serialize; diff --git a/users/picnoir/tvix-daemon/src/main.rs b/users/picnoir/tvix-daemon/src/main.rs index 580f07652..d34acabc9 100644 --- a/users/picnoir/tvix-daemon/src/main.rs +++ b/users/picnoir/tvix-daemon/src/main.rs @@ -3,8 +3,8 @@ use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio_listener::{self, SystemOptions, UserOptions}; use tracing::{debug, error, info, instrument, Level}; +use nix_compat::wire::ProtocolVersion; use nix_compat::worker_protocol::{self, server_handshake_client, ClientSettings, Trust}; -use nix_compat::ProtocolVersion; #[derive(Parser, Debug)] struct Cli {