From 8da01484cdbedac6d556976635329fadab694cd3 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 21 Mar 2024 13:51:50 +0100 Subject: [PATCH] pkgs/stdenv/adapters.nix: Rename internal name `finalAttrs` is never the first argument. This should have been called `prevAttrs` all along. It confused me for a bit, because the callback _must not_ be strict in `finalAttrs` (the first of _two_ parameters), or it will recurse infinitely while trying to figure out what the attrNames are. --- pkgs/stdenv/adapters.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 10ed96acc209..0eedc241fead 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -144,10 +144,10 @@ rec { # extraBuildInputs are dropped in cross.nix, but darwin still needs them extraBuildInputs = [ pkgs.buildPackages.darwin.CF ]; mkDerivationFromStdenv = withOldMkDerivation old (stdenv: mkDerivationSuper: args: - (mkDerivationSuper args).overrideAttrs (finalAttrs: { - NIX_CFLAGS_LINK = toString (finalAttrs.NIX_CFLAGS_LINK or "") + (mkDerivationSuper args).overrideAttrs (prevAttrs: { + NIX_CFLAGS_LINK = toString (prevAttrs.NIX_CFLAGS_LINK or "") + lib.optionalString (stdenv.cc.isGNU or false) " -static-libgcc"; - nativeBuildInputs = (finalAttrs.nativeBuildInputs or []) + nativeBuildInputs = (prevAttrs.nativeBuildInputs or []) ++ lib.optionals stdenv.hasCC [ (pkgs.buildPackages.makeSetupHook { name = "darwin-portable-libSystem-hook";