about summary refs log tree commit diff
path: root/tvix/Cargo.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/Cargo.nix')
-rw-r--r--tvix/Cargo.nix38
1 files changed, 24 insertions, 14 deletions
diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix
index 297825787ae1..f88f64291ae4 100644
--- a/tvix/Cargo.nix
+++ b/tvix/Cargo.nix
@@ -1,5 +1,5 @@
-# This file was @generated by crate2nix 0.10.0 with the command:
-#   "generate"
+# This file was @generated by crate2nix 0.11.0-rc.4 with the command:
+#   "generate" "--all-features"
 # See https://github.com/kolloch/crate2nix for more info.
 
 { nixpkgs ? <nixpkgs>
@@ -4102,7 +4102,7 @@ rec {
         # We can't filter paths with references in Nix 2.4
         # See https://github.com/NixOS/nix/issues/5410
         src =
-          if (lib.versionOlder builtins.nixVersion "2.4pre20211007")
+          if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
           then lib.cleanSourceWith { filter = sourceFilter; src = ./nix_cli; }
           else ./nix_cli;
         dependencies = [
@@ -4125,7 +4125,7 @@ rec {
         # We can't filter paths with references in Nix 2.4
         # See https://github.com/NixOS/nix/issues/5410
         src =
-          if (lib.versionOlder builtins.nixVersion "2.4pre20211007")
+          if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
           then lib.cleanSourceWith { filter = sourceFilter; src = ./nix-compat; }
           else ./nix-compat;
         dependencies = [
@@ -8293,7 +8293,7 @@ rec {
         # We can't filter paths with references in Nix 2.4
         # See https://github.com/NixOS/nix/issues/5410
         src =
-          if (lib.versionOlder builtins.nixVersion "2.4pre20211007")
+          if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
           then lib.cleanSourceWith { filter = sourceFilter; src = ./castore; }
           else ./castore;
         dependencies = [
@@ -8425,7 +8425,7 @@ rec {
         # We can't filter paths with references in Nix 2.4
         # See https://github.com/NixOS/nix/issues/5410
         src =
-          if (lib.versionOlder builtins.nixVersion "2.4pre20211007")
+          if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
           then lib.cleanSourceWith { filter = sourceFilter; src = ./cli; }
           else ./cli;
         dependencies = [
@@ -8488,7 +8488,7 @@ rec {
         # We can't filter paths with references in Nix 2.4
         # See https://github.com/NixOS/nix/issues/5410
         src =
-          if (lib.versionOlder builtins.nixVersion "2.4pre20211007")
+          if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
           then lib.cleanSourceWith { filter = sourceFilter; src = ./eval; }
           else ./eval;
         libName = "tvix_eval";
@@ -8624,7 +8624,7 @@ rec {
         # We can't filter paths with references in Nix 2.4
         # See https://github.com/NixOS/nix/issues/5410
         src =
-          if (lib.versionOlder builtins.nixVersion "2.4pre20211007")
+          if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
           then lib.cleanSourceWith { filter = sourceFilter; src = ./eval/builtin-macros; }
           else ./eval/builtin-macros;
         procMacro = true;
@@ -8661,7 +8661,7 @@ rec {
         # We can't filter paths with references in Nix 2.4
         # See https://github.com/NixOS/nix/issues/5410
         src =
-          if (lib.versionOlder builtins.nixVersion "2.4pre20211007")
+          if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
           then lib.cleanSourceWith { filter = sourceFilter; src = ./serde; }
           else ./serde;
         dependencies = [
@@ -8691,7 +8691,7 @@ rec {
         # We can't filter paths with references in Nix 2.4
         # See https://github.com/NixOS/nix/issues/5410
         src =
-          if (lib.versionOlder builtins.nixVersion "2.4pre20211007")
+          if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
           then lib.cleanSourceWith { filter = sourceFilter; src = ./store; }
           else ./store;
         dependencies = [
@@ -11624,11 +11624,21 @@ rec {
         explicitFeatures = dependency.features or [ ];
         additionalDependencyFeatures =
           let
-            dependencyPrefix = (dependency.rename or dependency.name) + "/";
-            dependencyFeatures =
-              builtins.filter (f: lib.hasPrefix dependencyPrefix f) features;
+            name = dependency.rename or dependency.name;
+            stripPrefixMatch = prefix: s:
+              if lib.hasPrefix prefix s
+              then lib.removePrefix prefix s
+              else null;
+            extractFeature = feature: lib.findFirst
+              (f: f != null)
+              null
+              (map (prefix: stripPrefixMatch prefix feature) [
+                (name + "/")
+                (name + "?/")
+              ]);
+            dependencyFeatures = lib.filter (f: f != null) (map extractFeature features);
           in
-          builtins.map (lib.removePrefix dependencyPrefix) dependencyFeatures;
+          dependencyFeatures;
       in
       defaultOrNil ++ explicitFeatures ++ additionalDependencyFeatures;