From b74402e4e8f8cebbec860f0ba8fef2f703ad79f0 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sun, 9 Mar 2025 00:11:21 -0600 Subject: [PATCH] tests: expose scrubDerivation Will use it with darwin scrubbing --- tests/default.nix | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/tests/default.nix b/tests/default.nix index fe7527fdb..a7d571e3d 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -14,35 +14,33 @@ let # `"@package-name@"`. This allows the tests to refer to derivations through # their values without establishing an actual dependency on the derivation # output. - scrubDerivations = attrs: + scrubDerivation = name: value: let - scrubDerivation = name: value: - let - scrubbedValue = scrubDerivations value; + scrubbedValue = scrubDerivations value; - newDrvAttrs = { - buildScript = abort "no build allowed"; + newDrvAttrs = { + buildScript = abort "no build allowed"; - outPath = builtins.traceVerbose ("${name} - got out path") - "@${lib.getName value}@"; + outPath = builtins.traceVerbose "${name} - got out path" + "@${lib.getName value}@"; - # Prevent getOutput from descending into outputs - outputSpecified = true; + # Prevent getOutput from descending into outputs + outputSpecified = true; - # Allow the original package to be used in derivation inputs - __spliced = { - buildHost = value; - hostTarget = value; - }; - }; - in if lib.isAttrs value then - if lib.isDerivation value then - scrubbedValue // newDrvAttrs - else - scrubbedValue - else - value; - in lib.mapAttrs scrubDerivation attrs; + # Allow the original package to be used in derivation inputs + __spliced = { + buildHost = value; + hostTarget = value; + }; + }; + in if lib.isAttrs value then + if lib.isDerivation value then + scrubbedValue // newDrvAttrs + else + scrubbedValue + else + value; + scrubDerivations = attrs: let in lib.mapAttrs scrubDerivation attrs; # Globally unscrub a few selected packages that are used by a wide selection of tests. whitelist = let