From 1b3d2ac6f462995f4e2958313437cf94c81722b7 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Thu, 26 Dec 2024 08:39:10 +0800 Subject: [PATCH] stdenv.mkDerivation: inputDerivation: fix for __structuredAttrs = true --- pkgs/stdenv/generic/make-derivation.nix | 29 +++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 087787055c1e..76c2cd3da4be 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -644,15 +644,26 @@ extendDerivation printf "%s" "$(< "''${!pathVar}")" >> $out done '' ]; - - # inputDerivation produces the inputs; not the outputs, so any - # restrictions on what used to be the outputs don't serve a purpose - # anymore. - allowedReferences = null; - allowedRequisites = null; - disallowedReferences = [ ]; - disallowedRequisites = [ ]; - }); + } + // ( + let + sharedOutputChecks = { + # inputDerivation produces the inputs; not the outputs, so any + # restrictions on what used to be the outputs don't serve a purpose + # anymore. + allowedReferences = null; + allowedRequisites = null; + disallowedReferences = [ ]; + disallowedRequisites = [ ]; + }; + in + if __structuredAttrs then + { + outputChecks.out = sharedOutputChecks; + } + else + sharedOutputChecks + )); inherit passthru overrideAttrs; inherit meta;