about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/Cargo.nix6
-rw-r--r--tvix/nix-compat-derive/Cargo.toml5
-rw-r--r--tvix/nix-compat-derive/src/lib.rs45
-rw-r--r--tvix/nix-compat/Cargo.toml1
-rw-r--r--tvix/nix-compat/src/lib.rs2
5 files changed, 3 insertions, 56 deletions
diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix
index c9fec85e2e37..be49a5c019b6 100644
--- a/tvix/Cargo.nix
+++ b/tvix/Cargo.nix
@@ -7419,7 +7419,6 @@ rec {
             name = "nix-compat-derive";
             packageId = "nix-compat-derive";
             optional = true;
-            usesDefaultFeatures = false;
           }
           {
             name = "nom";
@@ -7575,10 +7574,7 @@ rec {
             packageId = "tokio-test";
           }
         ];
-        features = {
-          "default" = [ "external" ];
-        };
-        resolvedDefaultFeatures = [ "default" "external" ];
+
       };
       "nix-compat-derive-tests" = rec {
         crateName = "nix-compat-derive-tests";
diff --git a/tvix/nix-compat-derive/Cargo.toml b/tvix/nix-compat-derive/Cargo.toml
index dea8ab5ab159..a8743b426638 100644
--- a/tvix/nix-compat-derive/Cargo.toml
+++ b/tvix/nix-compat-derive/Cargo.toml
@@ -6,11 +6,6 @@ edition = "2021"
 [lib]
 proc-macro = true
 
-[features]
-external = []
-default = ["external"]
-
-
 [dependencies]
 proc-macro2 = { version = "1.0.86",  features = ["proc-macro"] }
 quote = { version = "1.0.36", features = ["proc-macro"] }
diff --git a/tvix/nix-compat-derive/src/lib.rs b/tvix/nix-compat-derive/src/lib.rs
index 59ed9a4f170c..e3faed02ebab 100644
--- a/tvix/nix-compat-derive/src/lib.rs
+++ b/tvix/nix-compat-derive/src/lib.rs
@@ -261,17 +261,6 @@ use syn::{parse_quote, DeriveInput};
 mod de;
 mod internal;
 
-#[cfg(not(feature = "external"))]
-#[proc_macro_derive(NixDeserialize, attributes(nix))]
-pub fn derive_nix_deserialize(item: TokenStream) -> TokenStream {
-    let mut input = syn::parse_macro_input!(item as DeriveInput);
-    let nnixrs: syn::Path = parse_quote!(crate);
-    de::expand_nix_deserialize(nnixrs, &mut input)
-        .unwrap_or_else(syn::Error::into_compile_error)
-        .into()
-}
-
-#[cfg(feature = "external")]
 #[proc_macro_derive(NixDeserialize, attributes(nix))]
 pub fn derive_nix_deserialize(item: TokenStream) -> TokenStream {
     let mut input = syn::parse_macro_input!(item as DeriveInput);
@@ -304,40 +293,6 @@ pub fn derive_nix_deserialize(item: TokenStream) -> TokenStream {
 ///
 /// nix_deserialize_remote!(#[nix(from="u64")] MyU64);
 /// ```
-#[cfg(not(feature = "external"))]
-#[proc_macro]
-pub fn nix_deserialize_remote(item: TokenStream) -> TokenStream {
-    let input = syn::parse_macro_input!(item as RemoteInput);
-    let crate_path = parse_quote!(crate);
-    de::expand_nix_deserialize_remote(crate_path, &input)
-        .unwrap_or_else(syn::Error::into_compile_error)
-        .into()
-}
-
-/// Macro to implement `NixDeserialize` on a type.
-/// Sometimes you can't use the deriver to implement `NixDeserialize`
-/// (like when dealing with types in Rust standard library) but don't want
-/// to implement it yourself. So this macro can be used for those situations
-/// where you would derive using `#[nix(from_str)]`,
-/// `#[nix(from = "FromType")]` or `#[nix(try_from = "FromType")]` if you
-/// could.
-///
-/// #### Example
-///
-/// ```rust
-/// # use nix_compat_derive::nix_deserialize_remote;
-/// #
-/// struct MyU64(u64);
-///
-/// impl From<u64> for MyU64 {
-///     fn from(value: u64) -> Self {
-///         Self(value)
-///     }
-/// }
-///
-/// nix_deserialize_remote!(#[nix(from="u64")] MyU64);
-/// ```
-#[cfg(feature = "external")]
 #[proc_macro]
 pub fn nix_deserialize_remote(item: TokenStream) -> TokenStream {
     let input = syn::parse_macro_input!(item as RemoteInput);
diff --git a/tvix/nix-compat/Cargo.toml b/tvix/nix-compat/Cargo.toml
index 87e9b1e6760c..fade4f117a09 100644
--- a/tvix/nix-compat/Cargo.toml
+++ b/tvix/nix-compat/Cargo.toml
@@ -37,7 +37,6 @@ version = "1.6.1"
 [dependencies.nix-compat-derive]
 path = "../nix-compat-derive"
 optional = true
-default-features = false
 
 [dependencies.tokio]
 optional = true
diff --git a/tvix/nix-compat/src/lib.rs b/tvix/nix-compat/src/lib.rs
index 6eec4b8d03a8..f30c557889a8 100644
--- a/tvix/nix-compat/src/lib.rs
+++ b/tvix/nix-compat/src/lib.rs
@@ -1,3 +1,5 @@
+extern crate self as nix_compat;
+
 pub(crate) mod aterm;
 pub mod derivation;
 pub mod nar;