From 966fc630ddfae521af2fc9f5575a78275145827d Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 5 Apr 2025 18:54:01 +0200 Subject: [PATCH] tests.srcOnly: Work around duplication of attr on darwin --- pkgs/build-support/src-only/tests.nix | 31 ++++++++++++++++++--------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/pkgs/build-support/src-only/tests.nix b/pkgs/build-support/src-only/tests.nix index d00a2060703e..f739715e717d 100644 --- a/pkgs/build-support/src-only/tests.nix +++ b/pkgs/build-support/src-only/tests.nix @@ -1,4 +1,5 @@ { + lib, runCommand, srcOnly, hello, @@ -32,16 +33,26 @@ let ; }; helloDrvSimpleSrc = srcOnly helloDrvSimple; - helloDrvSimpleSrcFreeform = srcOnly { - inherit (helloDrvSimple) - name - pname - version - src - patches - stdenv - ; - }; + helloDrvSimpleSrcFreeform = srcOnly ( + { + inherit (helloDrvSimple) + name + pname + version + src + patches + stdenv + ; + } + # __impureHostDeps get duplicated in helloDrvSimpleSrc (on darwin) + # This is harmless, but fails the test for what is arguably an + # unrelated non-problem, so we just work around it here. + # The inclusion of __impureHostDeps really shouldn't be required, + # and should be removed from this test. + // lib.optionalAttrs (helloDrvSimple ? __impureHostDeps) { + inherit (helloDrvSimple) __impureHostDeps; + } + ); in