about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-10-31T08·33+0200
committerflokli <flokli@flokli.de>2023-10-31T12·11+0000
commitd545f11819a34637ce016c31a0fc5ca17af0c475 (patch)
tree0603f382739f63f3763f1653896d91bc9587a786
parentea92ba788c9eec9e9683fd06c7dd47fb3133155d (diff)
chore(tvix): regenerate Cargo.nix r/6919
Change-Id: I96e01f938a46d12a94da85968caaf190d041b9ab
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9887
Reviewed-by: edef <edef@edef.eu>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
-rw-r--r--tvix/Cargo.nix28
1 files changed, 22 insertions, 6 deletions
diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix
index d67ecf058cb0..487a17573aed 100644
--- a/tvix/Cargo.nix
+++ b/tvix/Cargo.nix
@@ -1,4 +1,4 @@
-# This file was @generated by crate2nix 0.11.0-rc.4 with the command:
+# This file was @generated by crate2nix 0.11.0 with the command:
 #   "generate" "--all-features"
 # See https://github.com/kolloch/crate2nix for more info.
 
@@ -11406,7 +11406,7 @@ rec {
               inherit testCrateFlags;
               buildInputs = testInputs;
             } ''
-            set -ex
+            set -e
 
             export RUST_BACKTRACE=1
 
@@ -11617,6 +11617,8 @@ rec {
             buildRustCrateForPkgsFunc pkgs
               (
                 crateConfig // {
+                  # https://github.com/NixOS/nixpkgs/issues/218712
+                  dontStrip = stdenv.hostPlatform.isDarwin;
                   src = crateConfig.src or (
                     pkgs.fetchurl rec {
                       name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz";
@@ -11861,10 +11863,24 @@ rec {
       assert (builtins.isAttrs featureMap);
       assert (builtins.isList inputFeatures);
       let
-        expandFeature = feature:
-          assert (builtins.isString feature);
-          [ feature ] ++ (expandFeatures featureMap (featureMap."${feature}" or [ ]));
-        outFeatures = lib.concatMap expandFeature inputFeatures;
+        expandFeaturesNoCycle = oldSeen: inputFeatures:
+          if inputFeatures != [ ]
+          then
+            let
+              # The feature we're currently expanding.
+              feature = builtins.head inputFeatures;
+              # All the features we've seen/expanded so far, including the one
+              # we're currently processing.
+              seen = oldSeen // { ${feature} = 1; };
+              # Expand the feature but be careful to not re-introduce a feature
+              # that we've already seen: this can easily cause a cycle, see issue
+              # #209.
+              enables = builtins.filter (f: !(seen ? "${f}")) (featureMap."${feature}" or [ ]);
+            in
+            [ feature ] ++ (expandFeaturesNoCycle seen (builtins.tail inputFeatures ++ enables))
+          # No more features left, nothing to expand to.
+          else [ ];
+        outFeatures = expandFeaturesNoCycle { } inputFeatures;
       in
       sortedUnique outFeatures;