From d545f11819a34637ce016c31a0fc5ca17af0c475 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 31 Oct 2023 10:33:30 +0200 Subject: chore(tvix): regenerate Cargo.nix Change-Id: I96e01f938a46d12a94da85968caaf190d041b9ab Reviewed-on: https://cl.tvl.fyi/c/depot/+/9887 Reviewed-by: edef Tested-by: BuildkiteCI Autosubmit: flokli --- tvix/Cargo.nix | 28 ++++++++++++++++++++++------ 1 file 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; -- cgit 1.4.1