tests.buildenv: test derivationArgs forwarding

Verify that:
- derivationArgs attributes reach the underlying mkDerivation (tested via allowSubstitutes overriding the default false)
- The backward-compat layer for top-level nativeBuildInputs still works (these are forwarded through compatArgs)
This commit is contained in:
Philip Taron
2026-03-19 13:17:21 -07:00
parent dbf1fa96d8
commit 83669e31a2
+32 -1
View File
@@ -159,12 +159,43 @@ let
};
};
tests-derivationArgs =
let
env = buildEnv {
name = "test-env";
paths = [ ];
derivationArgs.allowSubstitutes = true;
};
in
{
# derivationArgs.allowSubstitutes overrides the default (false)
testDerivationArgsForwarded = {
expr = env.allowSubstitutes;
expected = true;
};
# Backward compat: top-level nativeBuildInputs still works
testCompatNativeBuildInputs = {
expr =
let
env' = buildEnv {
name = "test-env";
paths = [ ];
nativeBuildInputs = [ pkgs.hello ];
};
in
builtins.length env'.nativeBuildInputs > 0;
expected = true;
};
};
tests =
tests-name
// tests-passthru-paths
// tests-finalAttrs
// tests-overrideAttrs
// tests-passthru-merging;
// tests-passthru-merging
// tests-derivationArgs;
in
stdenvNoCC.mkDerivation (finalAttrs: {