about summary refs log tree commit diff
path: root/tvix/nix-compat-derive-tests/tests
diff options
context:
space:
mode:
authorVova Kryachko <v.kryachko@gmail.com>2024-11-10T16·16-0500
committerVladimir Kryachko <v.kryachko@gmail.com>2024-11-10T20·54+0000
commit8df919dcf04b5c2502f3a63b4d013669da5e70c1 (patch)
tree3a527553fc48f62f331ef2b6a5667b6fe591290d /tvix/nix-compat-derive-tests/tests
parent11ee751aff42804319788a9033685a455bdf8f8e (diff)
refactor(nix-compat): Move serialization machinery into wire. HEAD r/8898 canon
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 <flokli@flokli.de>
Diffstat (limited to 'tvix/nix-compat-derive-tests/tests')
-rw-r--r--tvix/nix-compat-derive-tests/tests/read_derive.rs4
-rw-r--r--tvix/nix-compat-derive-tests/tests/ui/deserialize_bad_type.stderr2
-rw-r--r--tvix/nix-compat-derive-tests/tests/ui/deserialize_from_str_error_not_display.stderr2
-rw-r--r--tvix/nix-compat-derive-tests/tests/ui/deserialize_remote_missing_attr.stderr7
-rw-r--r--tvix/nix-compat-derive-tests/tests/ui/deserialize_try_from_error_not_display.stderr2
-rw-r--r--tvix/nix-compat-derive-tests/tests/write_derive.rs2
6 files changed, 10 insertions, 9 deletions
diff --git a/tvix/nix-compat-derive-tests/tests/read_derive.rs b/tvix/nix-compat-derive-tests/tests/read_derive.rs
index e47c8ad4346f..56123026fc75 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 12ffdc83c726..9a57d5e2d15e 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<V: NixDeserialize>(
   |                          ^^^^^^^^^^^^^^ 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 8283ed5340f3..9041e261c605 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<T: fmt::Display>(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 a1c18adc6e48..fe6047ba5ef3 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 8e55a3c56189..27a2aa10abd7 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<T: fmt::Display>(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 1ed5dbf7e735..435b7be7585d 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 _,
 };